gpu_messages.h revision 3551c9c881056c480085172ff9840cab31610854
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"
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/common_param_traits.h"
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/gpu_memory_stats.h"
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/command_buffer.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/constants.h"
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "gpu/command_buffer/common/mailbox.h"
2290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "gpu/config/gpu_info.h"
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/ipc/gpu_command_buffer_traits.h"
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_channel_handle.h"
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_macros.h"
263551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "media/base/video_frame.h"
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "media/video/video_decode_accelerator.h"
283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "media/video/video_encode_accelerator.h"
2990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ui/base/latency_info.h"
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/size.h"
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gl/gpu_preference.h"
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/android/surface_texture_peer.h"
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START GpuMsgStart
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, share_group_id)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, allowed_extensions)
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)#undef IPC_MESSAGE_EXPORT
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_EXPORT
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params)
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, surface_id)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(uint64, surface_handle)
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, route_id)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, x)
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, y)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, width)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, height)
702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, mailbox_name)
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, surface_size)
7290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(float, surface_scale_factor)
7390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
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
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage)
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(int32, id)
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, message)
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m00)
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m01)
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m02)
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m03)
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m10)
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m11)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m12)
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m13)
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m20)
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m21)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m22)
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m23)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m30)
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m31)
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m32)
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, m33)
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
11590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode)
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(values)
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(children)
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
12090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPerformanceStats)
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(graphics)
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gaming)
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(overall)
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
12690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vendor_id)
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(device_id)
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vendor_string)
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(device_string)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
13390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo)
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(finalized)
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(initialization_time)
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(optimus)
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(amd_switchable)
1382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute)
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gpu)
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(secondary_gpus)
14190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(adapter_luid)
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_vendor)
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_version)
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(driver_date)
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version)
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version)
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(machine_model)
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_version)
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_version_string)
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_vendor)
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_renderer)
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_extensions)
153868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor)
154868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_version)
155868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions)
156a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy)
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(can_lose_context)
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(performance_stats)
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(software_rendering)
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(sandboxed)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics)
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats::ProcessStats)
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(video_memory)
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(has_duplicates)
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats)
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(process_map)
1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated)
1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_historical_max)
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_END()
1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUMemoryUmaStats)
1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_current)
1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_max)
1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit)
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuMemoryAllocationForRenderer)
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_visible)
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_visible)
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_not_visible)
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_not_visible)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(have_backbuffer_when_not_visible)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(content::GpuMemoryAllocationForRenderer::PriorityCutoff)
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuManagedMemoryStats)
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_required)
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_nice_to_have)
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(bytes_allocated)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(backbuffer_requested)
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_ENUM_TRAITS(gfx::SurfaceType)
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gfx::GLSurfaceHandle)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(handle)
2022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(transport_type)
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(parent_gpu_process_id)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(parent_client_id)
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(content::CauseForGpuLaunch)
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(gfx::GpuPreference)
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(gpu::error::ContextLostReason)
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoCodecProfile)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats)
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count)
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time)
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(texture_upload_count)
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time)
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time)
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time)
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END()
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoFrame::Format)
2233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
2243551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error)
2253551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Messages
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from the browser to the GPU process.
2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to initialize itself. The browser explicitly
2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requests this be done so that we are guaranteed that the channel is set
2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// up between the browser and GPU process before doing any work that might
2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// potentially crash the GPU process. Detection of the child process
2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// exiting abruptly is predicated on having the IPC channel set up.
2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Initialize)
2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new channel for communication with a
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// given client.  The channel name is returned in a
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GpuHostMsg_ChannelEstablished message.  The client ID is passed so that
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the GPU process reuses an existing channel to that process if it exists.
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This ID is a unique opaque identifier generated by the browser process.
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuMsg_EstablishChannel,
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* client_id */,
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     bool /* share_context */)
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to close the channel identified by IPC channel
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// handle.  If no channel can be identified, do nothing.
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel,
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     IPC::ChannelHandle /* channel_handle */)
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders directly
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to a native view. A corresponding GpuCommandBufferStub is created.
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL4(GpuMsg_CreateViewCommandBuffer,
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::GLSurfaceHandle, /* compositing_surface */
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* surface_id */
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GPUCreateCommandBufferConfig /* init_params */)
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new image from a window. Images
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be bound to textures using CHROMIUM_texture_from_image.
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_CreateImage,
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::PluginWindowHandle, /* window */
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* image_id */)
2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to delete image.
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_DeleteImage,
2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* client_id */
2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* image_id */
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* sync_point */)
2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a context for collecting graphics card
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// information.
2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to report video_memory information for the task manager
2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats)
2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has finished resizing the
2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// view.
2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK)
2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has handled the swap
2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffers or post sub-buffer request. A non-zero sync point means
2852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that we should wait for the sync point. The surface_handle identifies
2862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that buffer that has finished presented, i.e. the buffer being returned.
2872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedSurfaceMsg_BufferPresented,
2882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    AcceleratedSurfaceMsg_BufferPresented_Params)
2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to remove all contexts.
2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Clean)
2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to crash.
2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Crash)
2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to hang.
2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Hang)
2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the GPU process to disable the watchdog thread.
3002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_DisableWatchdog)
3012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
3035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Host Messages
3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages to the browser.
3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this when it wants to create a connection to the GPU
3075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process. The browser will create the GPU process if necessary, and will
3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// return a handle to the channel via a GpuChannelEstablished message.
3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_3(GpuHostMsg_EstablishGpuChannel,
3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            content::CauseForGpuLaunch,
3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int /* client id */,
3125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            IPC::ChannelHandle /* handle to channel */,
31390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                            gpu::GPUInfo /* stats about GPU process*/)
3145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this to the browser process when it wants to
3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// create a GL context associated with the given view_id.
3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_CreateViewCommandBuffer,
3185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32, /* surface_id */
3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            GPUCreateCommandBufferConfig, /* init_params */
3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* route_id */)
3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GputMsg_Initialize message.
32390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuHostMsg_Initialized,
32490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     bool /* result */,
32590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     ::gpu::GPUInfo /* gpu_info */)
3265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuHostMsg_EstablishChannel message.
3285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ChannelEstablished,
3295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     IPC::ChannelHandle /* channel_handle */)
3305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message from GPU to notify to destroy the channel.
3322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyChannel,
3332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int32 /* client_id */)
3342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to cache the given shader information.
3362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_CacheShader,
3372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int32 /* client_id */,
3382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* key */,
3392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* shader */)
3402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to the GPU that a shader was loaded from disk.
3422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_LoadedShader,
3432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* encoded shader */)
3442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Respond from GPU to a GpuMsg_CreateViewCommandBuffer message.
3465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_CommandBufferCreated,
3475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* route_id */)
3485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request from GPU to free the browser resources associated with the
3505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// command buffer.
3515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyCommandBuffer,
3525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */)
3535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CreateImage message.
3555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ImageCreated,
3565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::Size /* size */)
3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CollectGraphicsInfo.
3595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
36090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     gpu::GPUInfo /* GPU logging stats */)
3615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_GetVideoMemory.
3635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_VideoMemoryUsageStats,
3645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     content::GPUVideoMemoryUsageStats /* GPU memory stats */)
3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Message from GPU to add a GPU log message to the about:gpu page.
3675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_OnLogMessage,
3685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /*severity*/,
3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     std::string /* header */,
3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     std::string /* message */)
3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Resize the window that is being drawn into. It's important that this
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// resize be synchronized with the swapping of the front and back buffers.
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_ResizeView,
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */,
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* route_id */,
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     gfx::Size /* size */)
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
379c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Tells the browser that a frame with the specific latency info was drawn to
380c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// the screen
381c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn,
38290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                     ui::LatencyInfo /* latency_info */)
383c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Same as above with a rect of the part of the surface that changed.
3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This message notifies the browser process that the renderer
3895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// swapped a portion of the buffers associated with the given "window", which
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// should cause the browser to redraw the compositor's contents.
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer,
3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params)
3935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release whatever resources are associated with
3955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the given surface. The browser must send an ACK once this operation
3965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is complete.
3975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceRelease,
3985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GpuHostMsg_AcceleratedSurfaceRelease_Params)
3995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release resources for the given surface until the next
4015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// time swap buffers or post sub buffer is sent.
4025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSuspend,
4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */)
4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser about updated parameters for vsync alignment.
4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_UpdateVSyncParameters,
4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* surface_id */,
4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     base::TimeTicks /* timebase */,
4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     base::TimeDelta /* interval */)
4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidCreateOffscreenContext,
4122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_DidLoseContext,
4152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     bool /* offscreen */,
4162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     gpu::error::ContextLostReason /* reason */,
4172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidDestroyOffscreenContext,
4202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     GURL /* url */)
4212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the browser about GPU memory usage statistics for UMA logging.
4232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryUmaStats,
4242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     content::GPUMemoryUmaStats /* GPU memory UMA stats */)
4252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
4275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Channel Messages
4285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from a renderer process to the GPU process.
4295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders to an
4315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// offscreen frame buffer.
4325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_CreateOffscreenCommandBuffer,
4335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            gfx::Size, /* size */
4345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            GPUCreateCommandBufferConfig, /* init_params */
4355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* route_id */)
4365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The CommandBufferProxy sends this to the GpuCommandBufferStub in its
4385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destructor, so that the stub deletes the actual CommandBufferService
4395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// object that it's hosting.
4405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer,
4415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* instance_id */)
4425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Generates n new unique mailbox names synchronously.
4445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_GenerateMailboxNames,
4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            unsigned, /* num */
4462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                            std::vector<gpu::Mailbox> /* mailbox_names */)
4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Generates n new unique mailbox names asynchronously.
4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync,
4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     unsigned /* num */)
4515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Reply to GpuChannelMsg_GenerateMailboxNamesAsync.
4535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesReply,
4542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::vector<gpu::Mailbox> /* mailbox_names */)
4555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Create a new GPU-accelerated video encoder.
4573551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_CreateVideoEncoder,
4583551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                            int32 /* route_id */)
4593551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
4603551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroyVideoEncoder, int32 /* route_id */)
4613551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
4625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
4635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Register the StreamTextureProxy class with the GPU process, so that
4645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the renderer process will get notified whenever a frame becomes available.
465eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_RegisterStreamTextureProxy,
4665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32, /* stream_id */
4675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int /* route_id */)
4685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process create and send the java surface texture object to
4705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the renderer process through the binder thread.
4712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuChannelMsg_EstablishStreamTexture,
4725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* stream_id */
4735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32, /* primary_id */
4745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int32 /* secondary_id */)
475eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
476eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Tells the GPU process to set the size of StreamTexture from the given
477eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// stream Id.
478eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_CONTROL2(GpuChannelMsg_SetStreamTextureSize,
479eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                     int32, /* stream_id */
480eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                     gfx::Size /* size */)
4815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
4825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to collect rendering stats.
4845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CollectRenderingStatsForSurface,
4855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            int32 /* surface_id */,
4865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            content::GpuRenderingStats /* stats */)
4875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID)
4895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
4905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Stream Texture Messages
4915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer that a new frame is available.
4925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuStreamTextureMsg_FrameAvailable)
4935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer process that the transform matrix has changed.
4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuStreamTextureMsg_MatrixChanged,
4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    GpuStreamTextureMsg_MatrixChanged_Params /* params */)
4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Command Buffer Messages
5015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages between a renderer process to the GPU process relating to
5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a single OpenGL context.
5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Initialize a command buffer with the given number of command entries.
5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the shared memory handle for the command buffer mapped to the
5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// calling process.
5062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize,
5072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                           base::SharedMemoryHandle /* shared_state */,
5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           bool /* result */)
5095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the shared memory buffer used for commands.
5115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_SetGetBuffer,
5125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int32 /* shm_id */)
5135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
514868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Produces the front buffer into a mailbox. This allows another context to draw
515868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// the output of this context.
516868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ProduceFrontBuffer,
517868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                    gpu::Mailbox /* mailbox */)
5185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer.
5205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState,
5215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           gpu::CommandBuffer::State /* state */)
5225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer, as fast as possible.
5245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetStateFast,
5255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           gpu::CommandBuffer::State /* state */)
5265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously synchronize the put and get offsets of both processes.
5285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Caller passes its current put offset. Current state (including get offset)
5295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is returned in shared memory.
5305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush,
5315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32 /* put_offset */,
5325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* flush_count */)
5335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
534c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Sends information about the latency of the current frame to the GPU
535c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// process.
536c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo,
53790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                    ui::LatencyInfo /* latency_info */)
538c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
5395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously process any commands known to the GPU process. This is only
5405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used in the event that a channel is unscheduled and needs to be flushed
5415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// again to process any commands issued subsequent to unscheduling. The GPU
5425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process actually sends it (deferred) to itself.
5435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled)
5445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent by the GPU process to display messages in the console.
5465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg,
5475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    GPUCommandBufferConsoleMessage /* msg */)
5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Register an existing shared memory transfer buffer. Returns an id that can be
5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used to identify the transfer buffer from a command buffer.
5512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(GpuCommandBufferMsg_RegisterTransferBuffer,
5522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int32 /* id */,
5532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    base::SharedMemoryHandle /* transfer_buffer */,
5542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    uint32 /* size */)
5555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Destroy a previously created transfer buffer.
5572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyTransferBuffer,
5582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int32 /* id */)
5595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the shared memory handle for a transfer buffer mapped to the callers
5615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process.
5625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer,
5635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int32 /* id */,
5645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           base::SharedMemoryHandle /* transfer_buffer */,
5655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           uint32 /* size */)
5665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Create and initialize a hardware video decoder, returning its new route_id.
568c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Created decoders should be freed with AcceleratedVideoDecoderMsg_Destroy when
569c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// no longer needed.
5705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateVideoDecoder,
5715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           media::VideoCodecProfile /* profile */,
5725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           int /* route_id */)
5735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the proxy that there was an error and the command buffer had to be
5755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destroyed for some reason.
5765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Destroyed,
5775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    gpu::error::ContextLostReason /* reason */)
5785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request that the GPU process reply with the given message. Reply may be
5805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// delayed.
5815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Echo,
5825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    IPC::Message /* reply */)
5835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to a GpuChannelMsg_Echo message.
5855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EchoAck)
5865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send to stub on surface visibility change.
5885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetSurfaceVisible, bool /* visible */)
5895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_DiscardBackbuffer)
5915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EnsureBackbuffer)
5925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to proxy when the gpu memory manager changes its memory allocation.
5945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetMemoryAllocation,
5955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    content::GpuMemoryAllocationForRenderer /* allocation */)
5965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub from the proxy with statistics on managed memory usage and
5985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requirements.
5995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(
6005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    GpuCommandBufferMsg_SendClientManagedMemoryStats,
6015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    content::GpuManagedMemoryStats /* stats */)
6025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub when proxy is assigned a memory allocation changed callback.
6045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(
6055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback,
6065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    bool /* has_callback */)
6075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inserts a sync point into the channel. This is handled on the IO thread, so
6095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be expected to be reasonably fast, but the sync point is actually
6105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// retired in order with respect to the other calls. The sync point is shared
6115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// across channels.
6125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_InsertSyncPoint,
6135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           uint32 /* sync_point */)
6145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Retires the sync point. Note: this message is not sent explicitly by the
6165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// renderer, but is synthesized by the GPU process.
6175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_RetireSyncPoint,
6185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* sync_point */)
6195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Makes this command buffer signal when a sync point is reached, by sending
6215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same
6225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// signal_id.
6235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalSyncPoint,
6245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* sync_point */,
6255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* signal_id */)
6265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to GpuCommandBufferMsg_SignalSyncPoint.
6285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SignalSyncPointAck,
6295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32 /* signal_id */)
6305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
631eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Makes this command buffer signal when a query is reached, by sending
632eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same
633eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// signal_id.
634eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalQuery,
635eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    uint32 /* query */,
636eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    uint32 /* signal_id */)
637eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
6385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
6395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Messages
6405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from Renderer process to GPU process.
6415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send input buffer for decoding.
6435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode,
6445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    base::SharedMemoryHandle, /* input_buffer_handle */
6455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32, /* bitstream_buffer_id */
6462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    uint32) /* size */
6475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent from Renderer process to the GPU process to give the texture IDs for
6495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the textures the decoder will use for output.
6505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_AssignPictureBuffers,
6515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    std::vector<int32>, /* Picture buffer ID */
6525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    std::vector<uint32>, /* Texture ID */
6535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    std::vector<gfx::Size>) /* Size */
6545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send from Renderer process to the GPU process to recycle the given picture
6565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffer for further decoding.
6575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer,
6585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Picture buffer ID */
6595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send flush request to the decoder.
6615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Flush)
6625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send reset request to the decoder.
6645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Reset)
6655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send destroy request to the decoder.
667c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Destroy)
6685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------
6705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Host Messages
6715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from GPU process to Renderer process.
6725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform AcceleratedVideoDecoderHost that AcceleratedVideoDecoder has been
6735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// created.
6745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated video decoder has consumed input buffer from transfer buffer.
6765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed,
6775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Processed buffer ID */
6785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Allocate video frames for output of the hardware video decoder.
6805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(
6815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers,
6825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    int32, /* Number of video frames to generate */
6835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    gfx::Size, /* Requested size of buffer */
6845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    uint32 ) /* Texture target */
6855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready and buffer does not need to be passed
6875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back to the decoder.
6885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer,
6895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32) /* Picture buffer ID */
6905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready.
6925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderHostMsg_PictureReady,
6935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32,  /* Picture buffer ID */
6945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int32)  /* Bitstream buffer ID */
6955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been flushed.
6975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone)
6985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been reset.
7005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone)
7015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Video decoder has encountered an error.
7035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification,
7045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    uint32) /* Error ID */
7053551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7063551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------
7073551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Messages
7083551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from the Renderer process to GPU process.
7093551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7103551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Initialize the accelerated encoder.
7113551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Initialize,
7123551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoFrame::Format /* input_format */,
7133551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    gfx::Size /* input_visible_size */,
7143551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoCodecProfile /* output_profile */,
7153551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* initial_bitrate */)
7163551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7173551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a input buffer to the encoder to encode. |frame_id| will be returned by
7183551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// AcceleratedVideoEncoderHostMsg_NotifyEncodeDone.
7193551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Encode,
7203551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* frame_id */,
7213551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    base::SharedMemoryHandle /* buffer_handle */,
7223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* buffer_size */,
7233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    bool /* force_keyframe */)
7243551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7253551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a buffer to the encoder for use in returning output.  |buffer_id| will
7263551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// be returned by AcceleratedVideoEncoderHostMsg_BitstreamBufferReady.
7273551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderMsg_UseOutputBitstreamBuffer,
7283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* buffer_id */,
7293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    base::SharedMemoryHandle /* buffer_handle */,
7303551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* buffer_size */)
7313551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7323551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Request a runtime encoding parameter change.
7333551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoEncoderMsg_RequestEncodingParametersChange,
7343551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* bitrate */,
7353551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* framerate */)
7363551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7373551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------
7383551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Host Messages
7393551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from GPU process to Renderer process.
7403551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7413551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify of the completion of initialization.
7423551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderHostMsg_NotifyInitializeDone)
7433551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7443551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify renderer of the input/output buffer requirements of the encoder.
7453551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_RequireBitstreamBuffers,
7463551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* input_count */,
7473551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    gfx::Size /* input_coded_size */,
7483551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* output_buffer_size */)
7493551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7503551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that the encoder has finished using an input buffer.
7513551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// There is no congruent entry point in the media::VideoEncodeAccelerator
7523551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// interface, in VEA this same done condition is indicated by dropping the
7533551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// reference to the media::VideoFrame passed to VEA::Encode().
7543551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyInputDone,
7553551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* frame_id */)
7563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7573551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that an output buffer has been filled with encoded data.
7583551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady,
7593551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    int32 /* bitstream_buffer_id */,
7603551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    uint32 /* payload_size */,
7613551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    bool /* key_frame */)
7623551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
7633551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Report error condition.
7643551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError,
7653551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    media::VideoEncodeAccelerator::Error /* error */)
766