gpu_messages.h revision e5d81f57cb97b3b6b7fccc9c5610d21eb81db09d
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" 132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/common/gpu/gpu_memory_uma_stats.h" 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/gpu/gpu_process_launch_causes.h" 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/common_param_traits.h" 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/gpu_memory_stats.h" 17a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "gpu/command_buffer/common/capabilities.h" 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/command_buffer.h" 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "gpu/command_buffer/common/constants.h" 201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "gpu/command_buffer/common/gpu_memory_allocation.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" 2968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)#include "ui/events/latency_info.h" 301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ui/gfx/gpu_memory_buffer.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) 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#undef IPC_MESSAGE_EXPORT 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define IPC_MESSAGE_EXPORT CONTENT_EXPORT 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START GpuMsgStart 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch, 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1) 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, 475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gfx::GpuPreferenceLast) 485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(gfx::SurfaceType, 495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gfx::SURFACE_TYPE_LAST) 505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff, 515d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gpu::MemoryAllocation::CUTOFF_LAST) 525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason, 535d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gpu::error::kContextLostReasonLast) 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error, 555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) media::VideoEncodeAccelerator::kErrorMax) 565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::Format, 57a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) media::VideoFrame::FORMAT_MAX) 585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile, 595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) media::VIDEO_CODEC_PROFILE_MIN, 605d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) media::VIDEO_CODEC_PROFILE_MAX) 615d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, share_group_id) 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(std::vector<int>, attribs) 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(GURL, active_url) 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, surface_id) 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(uint64, surface_handle) 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, route_id) 735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(gfx::Size, size) 7590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) IPC_STRUCT_MEMBER(float, scale_factor) 765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, surface_id) 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(uint64, surface_handle) 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, route_id) 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int, x) 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int, y) 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int, width) 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int, height) 875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(gfx::Size, surface_size) 8990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) IPC_STRUCT_MEMBER(float, surface_scale_factor) 905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, surface_id) 952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_END() 962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) 985d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) 992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_MEMBER(uint32, sync_point) 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_MACOSX) 1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_MEMBER(int32, renderer_id) 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 103d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#if defined(OS_WIN) 104d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) IPC_STRUCT_MEMBER(base::TimeTicks, vsync_timebase) 105d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) IPC_STRUCT_MEMBER(base::TimeDelta, vsync_interval) 106d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#endif 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(int32, id) 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(std::string, message) 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID) 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params) 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m00) 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m01) 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m02) 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m03) 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m10) 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m11) 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m12) 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m13) 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m20) 1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m21) 1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m22) 1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m23) 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m30) 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m31) 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m32) 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_MEMBER(float, m33) 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END() 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 13590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode) 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(values) 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(children) 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 14090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPerformanceStats) 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(graphics) 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gaming) 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(overall) 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 14690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice) 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(vendor_id) 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(device_id) 149e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch IPC_STRUCT_TRAITS_MEMBER(active) 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(vendor_string) 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(device_string) 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 15490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo) 1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(finalized) 1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(initialization_time) 1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(optimus) 1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(amd_switchable) 1592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute) 1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gpu) 1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(secondary_gpus) 16290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(adapter_luid) 1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(driver_vendor) 1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(driver_version) 1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(driver_date) 1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version) 1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version) 1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(machine_model) 1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_version) 1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_version_string) 1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_vendor) 1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_renderer) 1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_extensions) 174868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor) 175868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_ws_version) 176868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions) 177a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy) 1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(can_lose_context) 1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(performance_stats) 1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(software_rendering) 181effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch IPC_STRUCT_TRAITS_MEMBER(direct_rendering) 1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(sandboxed) 1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN) 1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics) 1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 188a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::Capabilities) 189a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(post_sub_buffer) 190a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(fast_npot_mo8_textures) 191a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(egl_image_external) 192a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(texture_format_bgra8888) 193a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(texture_format_etc1) 194a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(texture_rectangle) 195a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(iosurface) 196a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(texture_usage) 197a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(texture_storage) 198a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(discard_framebuffer) 199a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(map_image) 200a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 201a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats::ProcessStats) 2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(video_memory) 2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(has_duplicates) 2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats) 2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(process_map) 2092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_allocated) 2102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_historical_max) 2112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_END() 2122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 2132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(content::GPUMemoryUmaStats) 2142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_current) 2152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_max) 2162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_limit) 2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::MemoryAllocation) 2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_visible) 2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_visible) 2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gpu::ManagedMemoryStats) 2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_required) 2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_nice_to_have) 2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(bytes_allocated) 2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(backbuffer_requested) 2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(gfx::GLSurfaceHandle) 2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(handle) 2332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(transport_type) 2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(parent_client_id) 2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Messages 2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from the browser to the GPU process. 2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to initialize itself. The browser explicitly 2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requests this be done so that we are guaranteed that the channel is set 2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// up between the browser and GPU process before doing any work that might 2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// potentially crash the GPU process. Detection of the child process 2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// exiting abruptly is predicated on having the IPC channel set up. 2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Initialize) 2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new channel for communication with a 2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// given client. The channel name is returned in a 2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GpuHostMsg_ChannelEstablished message. The client ID is passed so that 2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the GPU process reuses an existing channel to that process if it exists. 2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This ID is a unique opaque identifier generated by the browser process. 2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuMsg_EstablishChannel, 2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /* client_id */, 2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool /* share_context */) 2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to close the channel identified by IPC channel 2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// handle. If no channel can be identified, do nothing. 2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel, 2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::ChannelHandle /* channel_handle */) 2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders directly 2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to a native view. A corresponding GpuCommandBufferStub is created. 2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL4(GpuMsg_CreateViewCommandBuffer, 2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::GLSurfaceHandle, /* compositing_surface */ 2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* surface_id */ 2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* client_id */ 2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GPUCreateCommandBufferConfig /* init_params */) 2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new image from a window. Images 2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be bound to textures using CHROMIUM_texture_from_image. 2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_CreateImage, 2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::PluginWindowHandle, /* window */ 2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* client_id */ 2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* image_id */) 2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to delete image. 2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuMsg_DeleteImage, 2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* client_id */ 2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* image_id */ 2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* sync_point */) 2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a context for collecting graphics card 2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// information. 2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) 2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to report video_memory information for the task manager 2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) 2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has finished resizing the 2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// view. 2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK) 2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process that the browser process has handled the swap 2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffers or post sub-buffer request. A non-zero sync point means 2962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that we should wait for the sync point. The surface_handle identifies 2972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// that buffer that has finished presented, i.e. the buffer being returned. 2982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedSurfaceMsg_BufferPresented, 2992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) AcceleratedSurfaceMsg_BufferPresented_Params) 3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 301f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Tells the GPU process to wake up the GPU because we're about to draw. 302f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_WakeUpGpu) 303f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to remove all contexts. 3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Clean) 3065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to crash. 3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Crash) 3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to hang. 3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_Hang) 3125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the GPU process to disable the watchdog thread. 3142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuMsg_DisableWatchdog) 3152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Host Messages 3185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages to the browser. 3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this when it wants to create a connection to the GPU 3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process. The browser will create the GPU process if necessary, and will 3225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// return a handle to the channel via a GpuChannelEstablished message. 3235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_3(GpuHostMsg_EstablishGpuChannel, 3245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) content::CauseForGpuLaunch, 3255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /* client id */, 3265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::ChannelHandle /* handle to channel */, 32790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) gpu::GPUInfo /* stats about GPU process*/) 3285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A renderer sends this to the browser process when it wants to 3305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// create a GL context associated with the given view_id. 3315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_CreateViewCommandBuffer, 3325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* surface_id */ 3335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GPUCreateCommandBufferConfig, /* init_params */ 3345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* route_id */) 3355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GputMsg_Initialize message. 33790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuHostMsg_Initialized, 33890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) bool /* result */, 33990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) ::gpu::GPUInfo /* gpu_info */) 3405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuHostMsg_EstablishChannel message. 3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ChannelEstablished, 3435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::ChannelHandle /* channel_handle */) 3445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message from GPU to notify to destroy the channel. 3462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyChannel, 3472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int32 /* client_id */) 3482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to cache the given shader information. 3502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_CacheShader, 3512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int32 /* client_id */, 3522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) std::string /* key */, 3532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) std::string /* shader */) 3542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Message to the GPU that a shader was loaded from disk. 3562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuMsg_LoadedShader, 3572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) std::string /* encoded shader */) 3582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Respond from GPU to a GpuMsg_CreateViewCommandBuffer message. 3605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_CommandBufferCreated, 3615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* route_id */) 3625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request from GPU to free the browser resources associated with the 3645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// command buffer. 3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyCommandBuffer, 3665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* surface_id */) 3675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CreateImage message. 3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_ImageCreated, 3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size /* size */) 3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_CollectGraphicsInfo. 3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, 37490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) gpu::GPUInfo /* GPU logging stats */) 3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response from GPU to a GpuMsg_GetVideoMemory. 3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_VideoMemoryUsageStats, 3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) content::GPUVideoMemoryUsageStats /* GPU memory stats */) 3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Message from GPU to add a GPU log message to the about:gpu page. 3815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_OnLogMessage, 3825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /*severity*/, 3835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::string /* header */, 3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::string /* message */) 3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Resize the window that is being drawn into. It's important that this 3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// resize be synchronized with the swapping of the front and back buffers. 3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_ResizeView, 3895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* surface_id */, 3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* route_id */, 3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size /* size */) 3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 393f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Tells the browser that a new accelerated surface was initialized. 394f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)IPC_MESSAGE_CONTROL2(GpuHostMsg_AcceleratedSurfaceInitialized, 395f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) int32 /* surface_id */, 396f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) int32 /* route_id */) 397f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 398c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Tells the browser that a frame with the specific latency info was drawn to 399c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// the screen 400c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn, 4015d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::vector<ui::LatencyInfo> /* latency_info */) 402c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Same as above with a rect of the part of the surface that changed. 4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) 4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This message notifies the browser process that the renderer 4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// swapped a portion of the buffers associated with the given "window", which 4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// should cause the browser to redraw the compositor's contents. 4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer, 4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) 4125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release whatever resources are associated with 4145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the given surface. The browser must send an ACK once this operation 4155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is complete. 4165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceRelease, 4175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GpuHostMsg_AcceleratedSurfaceRelease_Params) 4185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser to release resources for the given surface until the next 4205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// time swap buffers or post sub buffer is sent. 4215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSuspend, 4225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* surface_id */) 4235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser about updated parameters for vsync alignment. 4255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_UpdateVSyncParameters, 4265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* surface_id */, 4275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeTicks /* timebase */, 4285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeDelta /* interval */) 4295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidCreateOffscreenContext, 4312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GURL /* url */) 4322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 4332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL3(GpuHostMsg_DidLoseContext, 4342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool /* offscreen */, 4352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gpu::error::ContextLostReason /* reason */, 4362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GURL /* url */) 4372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 4382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_DidDestroyOffscreenContext, 4392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GURL /* url */) 4402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 4412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the browser about GPU memory usage statistics for UMA logging. 4422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryUmaStats, 4432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) content::GPUMemoryUmaStats /* GPU memory UMA stats */) 4442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 4465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Channel Messages 4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages from a renderer process to the GPU process. 4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the GPU process to create a new command buffer that renders to an 4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// offscreen frame buffer. 4515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_CreateOffscreenCommandBuffer, 4525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size, /* size */ 4535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GPUCreateCommandBufferConfig, /* init_params */ 4545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* route_id */) 4555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The CommandBufferProxy sends this to the GpuCommandBufferStub in its 4575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destructor, so that the stub deletes the actual CommandBufferService 4585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// object that it's hosting. 4595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer, 4605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* instance_id */) 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) 468f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Sent by DevTools agent in the inspected renderer process to initiate GPU 469f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// instrumentation events recording. 470f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_DevToolsStartEventsRecording, 471f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) int32 /* route_id */) 472f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 473f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// The message is sent when DevTools want to stop events recording. 474f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)IPC_MESSAGE_CONTROL0(GpuChannelMsg_DevToolsStopEventsRecording) 475f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 4765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_ANDROID) 4775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 4785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Stream Texture Messages 4795d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Tells the GPU process create and send the java surface texture object to 4805d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// the renderer process through the binder thread. 4815d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuStreamTextureMsg_EstablishPeer, 4825d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int32, /* primary_id */ 4835d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int32 /* secondary_id */) 4845d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 4855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Tells the GPU process to set the size of StreamTexture from the given 4865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// stream Id. 4875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuStreamTextureMsg_SetSize, 4885d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gfx::Size /* size */) 4895d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 4905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Tells the service-side instance to start sending frame available 4915d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// notifications. 4925d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuStreamTextureMsg_StartListening) 4935d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer that a new frame is available. 4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuStreamTextureMsg_FrameAvailable) 4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the renderer process that the transform matrix has changed. 4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuStreamTextureMsg_MatrixChanged, 4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GpuStreamTextureMsg_MatrixChanged_Params /* params */) 5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 5015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// GPU Command Buffer Messages 5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These are messages between a renderer process to the GPU process relating to 5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a single OpenGL context. 5065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Initialize a command buffer with the given number of command entries. 5075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the shared memory handle for the command buffer mapped to the 5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// calling process. 509a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_Initialize, 5102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::SharedMemoryHandle /* shared_state */, 511a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) bool /* result */, 512a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) gpu::Capabilities /* capabilities */) 5135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the shared memory buffer used for commands. 5155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_SetGetBuffer, 5165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* shm_id */) 5175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 518868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Produces the front buffer into a mailbox. This allows another context to draw 519868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// the output of this context. 520868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ProduceFrontBuffer, 521868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) gpu::Mailbox /* mailbox */) 5225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer. 5245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, 5255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gpu::CommandBuffer::State /* state */) 5265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the current state of the command buffer, as fast as possible. 5285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetStateFast, 5295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gpu::CommandBuffer::State /* state */) 5305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously synchronize the put and get offsets of both processes. 5325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Caller passes its current put offset. Current state (including get offset) 5335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is returned in shared memory. 5345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, 5355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 /* put_offset */, 5365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* flush_count */) 5375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 538c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Sends information about the latency of the current frame to the GPU 539c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// process. 540c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo, 5415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::vector<ui::LatencyInfo> /* latency_info */) 542c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 5435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Asynchronously process any commands known to the GPU process. This is only 5445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used in the event that a channel is unscheduled and needs to be flushed 5455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// again to process any commands issued subsequent to unscheduling. The GPU 5465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process actually sends it (deferred) to itself. 5475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled) 5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent by the GPU process to display messages in the console. 5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg, 5515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GPUCommandBufferConsoleMessage /* msg */) 5525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5531e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Register an existing shared memory transfer buffer. The id that can be 5545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// used to identify the transfer buffer from a command buffer. 5552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(GpuCommandBufferMsg_RegisterTransferBuffer, 5562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int32 /* id */, 5572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::SharedMemoryHandle /* transfer_buffer */, 5582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) uint32 /* size */) 5595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Destroy a previously created transfer buffer. 5612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyTransferBuffer, 5622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int32 /* id */) 5635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Create and initialize a hardware video decoder, returning its new route_id. 565c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Created decoders should be freed with AcceleratedVideoDecoderMsg_Destroy when 566c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// no longer needed. 5675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateVideoDecoder, 5685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) media::VideoCodecProfile /* profile */, 5695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /* route_id */) 5705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the proxy that there was an error and the command buffer had to be 5725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// destroyed for some reason. 5735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Destroyed, 5745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gpu::error::ContextLostReason /* reason */) 5755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Request that the GPU process reply with the given message. Reply may be 5775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// delayed. 5785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_Echo, 5795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::Message /* reply */) 5805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to a GpuChannelMsg_Echo message. 5825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EchoAck) 5835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send to stub on surface visibility change. 5855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetSurfaceVisible, bool /* visible */) 5865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to proxy when the gpu memory manager changes its memory allocation. 5885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetMemoryAllocation, 5891e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) gpu::MemoryAllocation /* allocation */) 5905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub from the proxy with statistics on managed memory usage and 5925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requirements. 5931e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SendClientManagedMemoryStats, 5941e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) gpu::ManagedMemoryStats /* stats */) 5955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent to stub when proxy is assigned a memory allocation changed callback. 5975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1( 5985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback, 5995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool /* has_callback */) 6005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inserts a sync point into the channel. This is handled on the IO thread, so 6025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// can be expected to be reasonably fast, but the sync point is actually 6035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// retired in order with respect to the other calls. The sync point is shared 6045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// across channels. 6055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_InsertSyncPoint, 6065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* sync_point */) 6075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Retires the sync point. Note: this message is not sent explicitly by the 6095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// renderer, but is synthesized by the GPU process. 6105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_RetireSyncPoint, 6115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* sync_point */) 6125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Makes this command buffer signal when a sync point is reached, by sending 6145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same 6155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// signal_id. 6165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalSyncPoint, 6175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* sync_point */, 6185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* signal_id */) 6195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Response to GpuCommandBufferMsg_SignalSyncPoint. 6215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SignalSyncPointAck, 6225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 /* signal_id */) 6235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 624eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Makes this command buffer signal when a query is reached, by sending 625eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// back a GpuCommandBufferMsg_SignalSyncPointAck message with the same 626eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// signal_id. 627eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalQuery, 628eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch uint32 /* query */, 629eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch uint32 /* signal_id */) 630eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch 6311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Register an existing gpu memory buffer. The id that can be 6321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// used to identify the gpu memory buffer from a command buffer. 6331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)IPC_MESSAGE_ROUTED5(GpuCommandBufferMsg_RegisterGpuMemoryBuffer, 6341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) int32 /* id */, 6351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) gfx::GpuMemoryBufferHandle /* gpu_memory_buffer */, 6361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) uint32 /* width */, 6371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) uint32 /* height */, 6381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) uint32 /* internalformat */) 6391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 6401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Destroy a previously created gpu memory buffer. 6411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyGpuMemoryBuffer, 6421e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) int32 /* id */) 6431e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 6445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Attaches an external image stream to the client texture. 6455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateStreamTexture, 6465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) uint32, /* client_texture_id */ 6475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int32 /* stream_id */) 6485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 6495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 6505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Messages 6515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from Renderer process to GPU process. 6525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send input buffer for decoding. 6545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode, 6555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::SharedMemoryHandle, /* input_buffer_handle */ 6565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* bitstream_buffer_id */ 6572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) uint32) /* size */ 6585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent from Renderer process to the GPU process to give the texture IDs for 6605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the textures the decoder will use for output. 66168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers, 66268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) std::vector<int32>, /* Picture buffer ID */ 66368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) std::vector<uint32>) /* Texture ID */ 6645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send from Renderer process to the GPU process to recycle the given picture 6665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// buffer for further decoding. 6675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer, 6685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32) /* Picture buffer ID */ 6695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send flush request to the decoder. 6715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Flush) 6725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send reset request to the decoder. 6745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Reset) 6755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send destroy request to the decoder. 677c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Destroy) 6785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//------------------------------------------------------------------------------ 6805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated Video Decoder Host Messages 6815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are sent from GPU process to Renderer process. 6825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform AcceleratedVideoDecoderHost that AcceleratedVideoDecoder has been 6835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// created. 6845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accelerated video decoder has consumed input buffer from transfer buffer. 6865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed, 6875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32) /* Processed buffer ID */ 6885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Allocate video frames for output of the hardware video decoder. 6905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3( 6915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers, 6925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* Number of video frames to generate */ 6935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size, /* Requested size of buffer */ 6945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32 ) /* Texture target */ 6955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready and buffer does not need to be passed 6975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// back to the decoder. 6985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer, 6995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32) /* Picture buffer ID */ 7005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Decoder reports that a picture is ready. 7025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderHostMsg_PictureReady, 7035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32, /* Picture buffer ID */ 7045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32) /* Bitstream buffer ID */ 7055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been flushed. 7075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) 7085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Confirm decoder has been reset. 7105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) 7115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Video decoder has encountered an error. 7135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, 7145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) uint32) /* Error ID */ 7153551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7163551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------ 7173551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Messages 7183551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from the Renderer process to GPU process. 7193551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7203551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Initialize the accelerated encoder. 7213551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Initialize, 7223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) media::VideoFrame::Format /* input_format */, 7233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) gfx::Size /* input_visible_size */, 7243551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) media::VideoCodecProfile /* output_profile */, 7253551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* initial_bitrate */) 7263551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7273551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a input buffer to the encoder to encode. |frame_id| will be returned by 7283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// AcceleratedVideoEncoderHostMsg_NotifyEncodeDone. 7293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Encode, 7303551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) int32 /* frame_id */, 7313551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) base::SharedMemoryHandle /* buffer_handle */, 7323551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* buffer_size */, 7333551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) bool /* force_keyframe */) 7343551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7353551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Queue a buffer to the encoder for use in returning output. |buffer_id| will 7363551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// be returned by AcceleratedVideoEncoderHostMsg_BitstreamBufferReady. 7373551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderMsg_UseOutputBitstreamBuffer, 7383551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) int32 /* buffer_id */, 7393551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) base::SharedMemoryHandle /* buffer_handle */, 7403551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* buffer_size */) 7413551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7423551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Request a runtime encoding parameter change. 7433551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AcceleratedVideoEncoderMsg_RequestEncodingParametersChange, 7443551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* bitrate */, 7453551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* framerate */) 7463551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7473551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)//------------------------------------------------------------------------------ 7483551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Accelerated Video Encoder Host Messages 7493551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// These messages are sent from GPU process to Renderer process. 7503551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7513551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify of the completion of initialization. 7523551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderHostMsg_NotifyInitializeDone) 7533551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7543551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify renderer of the input/output buffer requirements of the encoder. 7553551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_RequireBitstreamBuffers, 7563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* input_count */, 7573551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) gfx::Size /* input_coded_size */, 7583551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* output_buffer_size */) 7593551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7603551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that the encoder has finished using an input buffer. 7613551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// There is no congruent entry point in the media::VideoEncodeAccelerator 7623551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// interface, in VEA this same done condition is indicated by dropping the 7633551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// reference to the media::VideoFrame passed to VEA::Encode(). 7643551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyInputDone, 7653551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) int32 /* frame_id */) 7663551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7673551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notify the renderer that an output buffer has been filled with encoded data. 7683551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady, 7693551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) int32 /* bitstream_buffer_id */, 7703551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) uint32 /* payload_size */, 7713551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) bool /* key_frame */) 7723551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 7733551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Report error condition. 7743551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, 7753551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) media::VideoEncodeAccelerator::Error /* error */) 776