gpu_messages.h revision 68043e1e95eeb07d5cae7aca370b26518b0867d6
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Multiply-included message file, hence no include guard here, but see below
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// for a much smaller-than-usual include guard section.
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
117dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "base/memory/shared_memory.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_export.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/gpu/gpu_memory_allocation.h"
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/common/gpu/gpu_memory_uma_stats.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/gpu/gpu_process_launch_causes.h"
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/gpu/gpu_rendering_stats.h"
17424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "content/common/gpu/surface_capturer.h"
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/common_param_traits.h"
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/gpu_memory_stats.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/command_buffer.h"
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/constants.h"
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "gpu/command_buffer/common/mailbox.h"
2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "gpu/config/gpu_info.h"
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/ipc/gpu_command_buffer_traits.h"
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_channel_handle.h"
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_macros.h"
273551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "media/base/video_frame.h"
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "media/video/video_decode_accelerator.h"
293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "media/video/video_encode_accelerator.h"
3068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)#include "ui/events/latency_info.h"
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/size.h"
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gl/gpu_preference.h"
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/android/surface_texture_peer.h"
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START GpuMsgStart
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, share_group_id)
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::vector<int>, attribs)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(GURL, active_url)
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference)
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#undef IPC_MESSAGE_EXPORT
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, surface_id)
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(uint64, surface_handle)
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, route_id)
542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, mailbox_name)
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, size)
5690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(float, scale_factor)
5790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info)
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params)
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, surface_id)
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(uint64, surface_handle)
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, route_id)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, x)
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, y)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, width)
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, height)
682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, mailbox_name)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, surface_size)
7090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(float, surface_scale_factor)
7190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info)
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
73d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#undef IPC_MESSAGE_EXPORT
74d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#define IPC_MESSAGE_EXPORT
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params)
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, surface_id)
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, route_id)
792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_END()
802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params)
822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, mailbox_name)
832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(uint32, sync_point)
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_MACOSX)
852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(int32, renderer_id)
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
87d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#if defined(OS_WIN)
88d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  IPC_STRUCT_MEMBER(base::TimeTicks, vsync_timebase)
89d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  IPC_STRUCT_MEMBER(base::TimeDelta, vsync_interval)
90d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#endif
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage)
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, id)
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, message)
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m00)
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m01)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m02)
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m03)
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m10)
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m11)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m12)
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m13)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m20)
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m21)
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m22)
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m23)
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m30)
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m31)
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m32)
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m33)
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
11990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode)
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(values)
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(children)
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
12490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPerformanceStats)
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(graphics)
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gaming)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(overall)
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
13090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vendor_id)
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(device_id)
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vendor_string)
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(device_string)
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
13790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo)
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(finalized)
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(initialization_time)
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(optimus)
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(amd_switchable)
1422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute)
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gpu)
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(secondary_gpus)
14590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(adapter_luid)
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_vendor)
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_version)
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_date)
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version)
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version)
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(machine_model)
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_version)
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_version_string)
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_vendor)
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_renderer)
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_extensions)
157868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor)
158868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_version)
159868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions)
160a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(can_lose_context)
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(performance_stats)
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(software_rendering)
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(sandboxed)
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics)
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats::ProcessStats)
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(video_memory)
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(has_duplicates)
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats)
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(process_map)
1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated)
1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_historical_max)
1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_END()
1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUMemoryUmaStats)
1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_current)
1832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_max)
1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit)
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuMemoryAllocationForRenderer)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_visible)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_visible)
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_not_visible)
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_not_visible)
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(have_backbuffer_when_not_visible)
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(content::GpuMemoryAllocationForRenderer::PriorityCutoff)
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuManagedMemoryStats)
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_required)
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_nice_to_have)
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated)
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(backbuffer_requested)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_ENUM_TRAITS(gfx::SurfaceType)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gfx::GLSurfaceHandle)
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(handle)
2062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(transport_type)
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(parent_gpu_process_id)
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(parent_client_id)
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(content::CauseForGpuLaunch)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(gfx::GpuPreference)
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(gpu::error::ContextLostReason)
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoCodecProfile)
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats)
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count)
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time)
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(texture_upload_count)
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time)
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time)
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time)
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2263551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoFrame::Format)
2273551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
2283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error)
2293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
230424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_ENUM_TRAITS(content::SurfaceCapturer::Error)
231424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Messages
2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from the browser to the GPU process.
2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to initialize itself. The browser explicitly
2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requests this be done so that we are guaranteed that the channel is set
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// up between the browser and GPU process before doing any work that might
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// potentially crash the GPU process. Detection of the child process
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// exiting abruptly is predicated on having the IPC channel set up.
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Initialize)
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new channel for communication with a
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// given client.  The channel name is returned in a
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GpuHostMsg_ChannelEstablished message.  The client ID is passed so that
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the GPU process reuses an existing channel to that process if it exists.
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This ID is a unique opaque identifier generated by the browser process.
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuMsg_EstablishChannel,
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* client_id */,
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     bool /* share_context */)
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to close the channel identified by IPC channel
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// handle.  If no channel can be identified, do nothing.
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel,
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     IPC::ChannelHandle /* channel_handle */)
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders directly
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to a native view. A corresponding GpuCommandBufferStub is created.
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL4(GpuMsg_CreateViewCommandBuffer,
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::GLSurfaceHandle, /* compositing_surface */
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* surface_id */
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GPUCreateCommandBufferConfig /* init_params */)
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new image from a window. Images
2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be bound to textures using CHROMIUM_texture_from_image.
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_CreateImage,
2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::PluginWindowHandle, /* window */
2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* image_id */)
2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to delete image.
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_DeleteImage,
2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* image_id */
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* sync_point */)
2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a context for collecting graphics card
2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// information.
2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to report video_memory information for the task manager
2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats)
2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has finished resizing the
2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// view.
2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK)
2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has handled the swap
2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffers or post sub-buffer request. A non-zero sync point means
2912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that we should wait for the sync point. The surface_handle identifies
2922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that buffer that has finished presented, i.e. the buffer being returned.
2932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedSurfaceMsg_BufferPresented,
2942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    AcceleratedSurfaceMsg_BufferPresented_Params)
2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to remove all contexts.
2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Clean)
2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to crash.
3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Crash)
3015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to hang.
3035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Hang)
3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the GPU process to disable the watchdog thread.
3062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_DisableWatchdog)
3072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Host Messages
3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages to the browser.
3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this when it wants to create a connection to the GPU
3135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process. The browser will create the GPU process if necessary, and will
3145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// return a handle to the channel via a GpuChannelEstablished message.
3155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_3(GpuHostMsg_EstablishGpuChannel,
3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            content::CauseForGpuLaunch,
3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int /* client id */,
3185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            IPC::ChannelHandle /* handle to channel */,
31990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                            gpu::GPUInfo /* stats about GPU process*/)
3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this to the browser process when it wants to
3225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// create a GL context associated with the given view_id.
3235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_CreateViewCommandBuffer,
3245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32, /* surface_id */
3255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            GPUCreateCommandBufferConfig, /* init_params */
3265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* route_id */)
3275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GputMsg_Initialize message.
32990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuHostMsg_Initialized,
33090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     bool /* result */,
33190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     ::gpu::GPUInfo /* gpu_info */)
3325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuHostMsg_EstablishChannel message.
3345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ChannelEstablished,
3355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     IPC::ChannelHandle /* channel_handle */)
3365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message from GPU to notify to destroy the channel.
3382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyChannel,
3392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int32 /* client_id */)
3402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to cache the given shader information.
3422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_CacheShader,
3432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int32 /* client_id */,
3442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* key */,
3452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* shader */)
3462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to the GPU that a shader was loaded from disk.
3482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_LoadedShader,
3492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* encoded shader */)
3502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Respond from GPU to a GpuMsg_CreateViewCommandBuffer message.
3525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_CommandBufferCreated,
3535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* route_id */)
3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request from GPU to free the browser resources associated with the
3565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// command buffer.
3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyCommandBuffer,
3585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */)
3595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CreateImage message.
3615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ImageCreated,
3625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::Size /* size */)
3635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CollectGraphicsInfo.
3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
36690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     gpu::GPUInfo /* GPU logging stats */)
3675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_GetVideoMemory.
3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_VideoMemoryUsageStats,
3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     content::GPUVideoMemoryUsageStats /* GPU memory stats */)
3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Message from GPU to add a GPU log message to the about:gpu page.
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_OnLogMessage,
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /*severity*/,
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     std::string /* header */,
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     std::string /* message */)
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Resize the window that is being drawn into. It's important that this
3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// resize be synchronized with the swapping of the front and back buffers.
3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_ResizeView,
3815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */,
3825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* route_id */,
3835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::Size /* size */)
3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Tells the browser that a frame with the specific latency info was drawn to
386c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// the screen
387c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn,
38890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     ui::LatencyInfo /* latency_info */)
389c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Same as above with a rect of the part of the surface that changed.
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
3935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This message notifies the browser process that the renderer
3955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// swapped a portion of the buffers associated with the given "window", which
3965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// should cause the browser to redraw the compositor's contents.
3975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer,
3985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params)
3995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release whatever resources are associated with
4015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the given surface. The browser must send an ACK once this operation
4025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is complete.
4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceRelease,
4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfaceRelease_Params)
4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release resources for the given surface until the next
4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// time swap buffers or post sub buffer is sent.
4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSuspend,
4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */)
4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser about updated parameters for vsync alignment.
4125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_UpdateVSyncParameters,
4135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */,
4145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     base::TimeTicks /* timebase */,
4155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     base::TimeDelta /* interval */)
4165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidCreateOffscreenContext,
4182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_DidLoseContext,
4212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     bool /* offscreen */,
4222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     gpu::error::ContextLostReason /* reason */,
4232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidDestroyOffscreenContext,
4262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the browser about GPU memory usage statistics for UMA logging.
4292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryUmaStats,
4302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     content::GPUMemoryUmaStats /* GPU memory UMA stats */)
4312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
4335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Channel Messages
4345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from a renderer process to the GPU process.
4355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders to an
4375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// offscreen frame buffer.
4385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_CreateOffscreenCommandBuffer,
4395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            gfx::Size, /* size */
4405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            GPUCreateCommandBufferConfig, /* init_params */
4415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* route_id */)
4425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The CommandBufferProxy sends this to the GpuCommandBufferStub in its
4445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destructor, so that the stub deletes the actual CommandBufferService
4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// object that it's hosting.
4465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer,
4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* instance_id */)
4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Generates n new unique mailbox names synchronously.
4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_GenerateMailboxNames,
4515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            unsigned, /* num */
4522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                            std::vector<gpu::Mailbox> /* mailbox_names */)
4535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Generates n new unique mailbox names asynchronously.
4555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync,
4565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     unsigned /* num */)
4575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Reply to GpuChannelMsg_GenerateMailboxNamesAsync.
4595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesReply,
4602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::vector<gpu::Mailbox> /* mailbox_names */)
4615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4623551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Create a new GPU-accelerated video encoder.
4633551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_CreateVideoEncoder,
4643551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                            int32 /* route_id */)
4653551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
4663551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroyVideoEncoder, int32 /* route_id */)
4673551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
4685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
4695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Register the StreamTextureProxy class with the GPU process, so that
4705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the renderer process will get notified whenever a frame becomes available.
471eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_RegisterStreamTextureProxy,
4725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32, /* stream_id */
4735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int /* route_id */)
4745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process create and send the java surface texture object to
4765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the renderer process through the binder thread.
4772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuChannelMsg_EstablishStreamTexture,
4785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* stream_id */
4795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* primary_id */
4805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* secondary_id */)
481eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
482eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Tells the GPU process to set the size of StreamTexture from the given
483eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// stream Id.
484eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_CONTROL2(GpuChannelMsg_SetStreamTextureSize,
485eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                     int32, /* stream_id */
486eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                     gfx::Size /* size */)
4875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
4885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to collect rendering stats.
4905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CollectRenderingStatsForSurface,
4915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* surface_id */,
4925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            content::GpuRenderingStats /* stats */)
4935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Stream Texture Messages
4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer that a new frame is available.
4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuStreamTextureMsg_FrameAvailable)
4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer process that the transform matrix has changed.
5015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuStreamTextureMsg_MatrixChanged,
5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    GpuStreamTextureMsg_MatrixChanged_Params /* params */)
5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
5065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Command Buffer Messages
5075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages between a renderer process to the GPU process relating to
5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a single OpenGL context.
5095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Initialize a command buffer with the given number of command entries.
5105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the shared memory handle for the command buffer mapped to the
5115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// calling process.
5122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize,
5132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                           base::SharedMemoryHandle /* shared_state */,
5145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           bool /* result */)
5155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the shared memory buffer used for commands.
5175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_SetGetBuffer,
5185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int32 /* shm_id */)
5195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
520868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Produces the front buffer into a mailbox. This allows another context to draw
521868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// the output of this context.
522868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ProduceFrontBuffer,
523868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                    gpu::Mailbox /* mailbox */)
5245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer.
5265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState,
5275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           gpu::CommandBuffer::State /* state */)
5285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer, as fast as possible.
5305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetStateFast,
5315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           gpu::CommandBuffer::State /* state */)
5325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously synchronize the put and get offsets of both processes.
5345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Caller passes its current put offset. Current state (including get offset)
5355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is returned in shared memory.
5365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush,
5375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32 /* put_offset */,
5385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* flush_count */)
5395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
540c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Sends information about the latency of the current frame to the GPU
541c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// process.
542c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo,
54390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                    ui::LatencyInfo /* latency_info */)
544c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
5455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously process any commands known to the GPU process. This is only
5465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used in the event that a channel is unscheduled and needs to be flushed
5475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// again to process any commands issued subsequent to unscheduling. The GPU
5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process actually sends it (deferred) to itself.
5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled)
5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent by the GPU process to display messages in the console.
5525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg,
5535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    GPUCommandBufferConsoleMessage /* msg */)
5545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Register an existing shared memory transfer buffer. Returns an id that can be
5565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used to identify the transfer buffer from a command buffer.
5572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(GpuCommandBufferMsg_RegisterTransferBuffer,
5582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int32 /* id */,
5592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    base::SharedMemoryHandle /* transfer_buffer */,
5602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    uint32 /* size */)
5615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Destroy a previously created transfer buffer.
5632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyTransferBuffer,
5642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int32 /* id */)
5655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the shared memory handle for a transfer buffer mapped to the callers
5675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process.
5685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer,
5695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int32 /* id */,
5705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           base::SharedMemoryHandle /* transfer_buffer */,
5715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           uint32 /* size */)
5725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Create and initialize a hardware video decoder, returning its new route_id.
574c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Created decoders should be freed with AcceleratedVideoDecoderMsg_Destroy when
575c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// no longer needed.
5765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateVideoDecoder,
5775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           media::VideoCodecProfile /* profile */,
5785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int /* route_id */)
5795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
580424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Create and initialize a surface capturer, returning its new route_id.
581424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Created capturers should be freed with SurfaceCapturerMsg_Destroy when no
582424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// longer needed.
583424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_CreateSurfaceCapturer,
584424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                           int /* route_id */)
585424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
5865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the proxy that there was an error and the command buffer had to be
5875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destroyed for some reason.
5885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Destroyed,
5895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    gpu::error::ContextLostReason /* reason */)
5905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request that the GPU process reply with the given message. Reply may be
5925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// delayed.
5935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Echo,
5945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    IPC::Message /* reply */)
5955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to a GpuChannelMsg_Echo message.
5975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EchoAck)
5985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send to stub on surface visibility change.
6005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetSurfaceVisible, bool /* visible */)
6015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_DiscardBackbuffer)
6035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EnsureBackbuffer)
6045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to proxy when the gpu memory manager changes its memory allocation.
6065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetMemoryAllocation,
6075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    content::GpuMemoryAllocationForRenderer /* allocation */)
6085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub from the proxy with statistics on managed memory usage and
6105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requirements.
6115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(
6125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    GpuCommandBufferMsg_SendClientManagedMemoryStats,
6135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    content::GpuManagedMemoryStats /* stats */)
6145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub when proxy is assigned a memory allocation changed callback.
6165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(
6175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback,
6185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    bool /* has_callback */)
6195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inserts a sync point into the channel. This is handled on the IO thread, so
6215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be expected to be reasonably fast, but the sync point is actually
6225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// retired in order with respect to the other calls. The sync point is shared
6235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// across channels.
6245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_InsertSyncPoint,
6255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           uint32 /* sync_point */)
6265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Retires the sync point. Note: this message is not sent explicitly by the
6285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// renderer, but is synthesized by the GPU process.
6295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_RetireSyncPoint,
6305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* sync_point */)
6315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Makes this command buffer signal when a sync point is reached, by sending
6335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same
6345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// signal_id.
6355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalSyncPoint,
6365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* sync_point */,
6375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* signal_id */)
6385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to GpuCommandBufferMsg_SignalSyncPoint.
6405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SignalSyncPointAck,
6415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* signal_id */)
6425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
643eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Makes this command buffer signal when a query is reached, by sending
644eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same
645eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// signal_id.
646eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalQuery,
647eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    uint32 /* query */,
648eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    uint32 /* signal_id */)
649eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
6505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
6515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Messages
6525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from Renderer process to GPU process.
6535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send input buffer for decoding.
6555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode,
6565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    base::SharedMemoryHandle, /* input_buffer_handle */
6575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32, /* bitstream_buffer_id */
6582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    uint32) /* size */
6595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent from Renderer process to the GPU process to give the texture IDs for
6615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the textures the decoder will use for output.
66268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers,
66368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                    std::vector<int32>,  /* Picture buffer ID */
66468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                    std::vector<uint32>) /* Texture ID */
6655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send from Renderer process to the GPU process to recycle the given picture
6675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffer for further decoding.
6685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer,
6695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Picture buffer ID */
6705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send flush request to the decoder.
6725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Flush)
6735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send reset request to the decoder.
6755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Reset)
6765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send destroy request to the decoder.
678c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Destroy)
6795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
6815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Host Messages
6825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from GPU process to Renderer process.
6835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform AcceleratedVideoDecoderHost that AcceleratedVideoDecoder has been
6845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// created.
6855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated video decoder has consumed input buffer from transfer buffer.
6875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed,
6885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Processed buffer ID */
6895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Allocate video frames for output of the hardware video decoder.
6915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(
6925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers,
6935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    int32, /* Number of video frames to generate */
6945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    gfx::Size, /* Requested size of buffer */
6955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    uint32 ) /* Texture target */
6965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready and buffer does not need to be passed
6985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back to the decoder.
6995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer,
7005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Picture buffer ID */
7015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready.
7035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderHostMsg_PictureReady,
7045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32,  /* Picture buffer ID */
7055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32)  /* Bitstream buffer ID */
7065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been flushed.
7085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone)
7095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been reset.
7115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone)
7125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Video decoder has encountered an error.
7145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification,
7155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32) /* Error ID */
7163551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7173551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------
7183551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Messages
7193551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from the Renderer process to GPU process.
7203551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7213551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Initialize the accelerated encoder.
7223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Initialize,
7233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoFrame::Format /* input_format */,
7243551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    gfx::Size /* input_visible_size */,
7253551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoCodecProfile /* output_profile */,
7263551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* initial_bitrate */)
7273551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a input buffer to the encoder to encode. |frame_id| will be returned by
7293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// AcceleratedVideoEncoderHostMsg_NotifyEncodeDone.
7303551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Encode,
7313551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* frame_id */,
7323551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    base::SharedMemoryHandle /* buffer_handle */,
7333551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* buffer_size */,
7343551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    bool /* force_keyframe */)
7353551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7363551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a buffer to the encoder for use in returning output.  |buffer_id| will
7373551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// be returned by AcceleratedVideoEncoderHostMsg_BitstreamBufferReady.
7383551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderMsg_UseOutputBitstreamBuffer,
7393551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* buffer_id */,
7403551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    base::SharedMemoryHandle /* buffer_handle */,
7413551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* buffer_size */)
7423551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7433551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Request a runtime encoding parameter change.
7443551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoEncoderMsg_RequestEncodingParametersChange,
7453551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* bitrate */,
7463551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* framerate */)
7473551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7483551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------
7493551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Host Messages
7503551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from GPU process to Renderer process.
7513551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7523551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify of the completion of initialization.
7533551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderHostMsg_NotifyInitializeDone)
7543551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7553551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify renderer of the input/output buffer requirements of the encoder.
7563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_RequireBitstreamBuffers,
7573551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* input_count */,
7583551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    gfx::Size /* input_coded_size */,
7593551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* output_buffer_size */)
7603551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7613551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that the encoder has finished using an input buffer.
7623551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// There is no congruent entry point in the media::VideoEncodeAccelerator
7633551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// interface, in VEA this same done condition is indicated by dropping the
7643551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// reference to the media::VideoFrame passed to VEA::Encode().
7653551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyInputDone,
7663551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* frame_id */)
7673551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7683551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that an output buffer has been filled with encoded data.
7693551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady,
7703551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* bitstream_buffer_id */,
7713551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* payload_size */,
7723551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    bool /* key_frame */)
7733551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7743551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Report error condition.
7753551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError,
7763551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoEncodeAccelerator::Error /* error */)
777424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
778424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)//------------------------------------------------------------------------------
779424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Gpu Surface Capturer Messages
780424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// These messages are sent from the Browser process to the GPU process.
781424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
782424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Initialize the capturer.
783424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED1(SurfaceCapturerMsg_Initialize,
784424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    media::VideoFrame::Format /* format */)
785424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
786424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Attempt to start a capture.
787424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED0(SurfaceCapturerMsg_TryCapture)
788424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
789424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Copy captured contents to a video frame.
790424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED3(SurfaceCapturerMsg_CopyCaptureToVideoFrame,
791424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    int32 /* buffer_id */,
792424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    base::SharedMemoryHandle /* buffer_shm */,
793424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    uint32 /* buffer_size */)
794424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
795424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Destroy the capturer.
796424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED0(SurfaceCapturerMsg_Destroy)
797424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
798424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)//------------------------------------------------------------------------------
799424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Gpu Surface Capturer Host Messages
800424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// These messages are sent from GPU process to Browser process.
801424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
802424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Report the capture output parameters to the Browser process.
803424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED2(SurfaceCapturerHostMsg_NotifyCaptureParameters,
804424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    gfx::Size /* buffer_size */,
805424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    gfx::Rect /* visible_rect */)
806424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
807424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Report successful copy of a capture of a surface.
808424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED1(SurfaceCapturerHostMsg_NotifyCopyCaptureDone,
809424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    int32 /* frame_id */)
810424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
811424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)// Report error.
812424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)IPC_MESSAGE_ROUTED1(SurfaceCapturerHostMsg_NotifyError,
813424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                    content::SurfaceCapturer::Error /* error */)
814