summaryrefslogtreecommitdiff
path: root/chromium/content/common/gpu_host_messages.h
blob: 6e76f92761f1e4404abe2ca5582141f841cb3b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Multiply-included message file, hence no include guard here, but see below
// for a much smaller-than-usual include guard section.

#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/common/establish_channel_params.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/config/gpu_feature_info.h"
#include "gpu/config/gpu_info.h"
#include "gpu/ipc/common/gpu_command_buffer_traits.h"
#include "gpu/ipc/common/gpu_param_traits.h"
#include "gpu/ipc/common/memory_stats.h"
#include "gpu/ipc/common/surface_handle.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_start.h"
#include "media/media_features.h"
#include "ui/events/ipc/latency_info_param_traits.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT

#define IPC_MESSAGE_START GpuMsgStart

IPC_ENUM_TRAITS_VALIDATE(gpu::GpuPreferences::VpxDecodeVendors,
                         ((value >= gpu::GpuPreferences::VPX_VENDOR_NONE) &&
                          (value <= gpu::GpuPreferences::VPX_VENDOR_ALL)))

IPC_STRUCT_BEGIN(GpuMsg_CreateGpuMemoryBuffer_Params)
  IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferId, id)
  IPC_STRUCT_MEMBER(gfx::Size, size)
  IPC_STRUCT_MEMBER(gfx::BufferFormat, format)
  IPC_STRUCT_MEMBER(gfx::BufferUsage, usage)
  IPC_STRUCT_MEMBER(int32_t, client_id)
  IPC_STRUCT_MEMBER(gpu::SurfaceHandle, surface_handle)
IPC_STRUCT_END()

IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPreferences)
  IPC_STRUCT_TRAITS_MEMBER(single_process)
  IPC_STRUCT_TRAITS_MEMBER(in_process_gpu)
  IPC_STRUCT_TRAITS_MEMBER(ui_prioritize_in_gpu_process)
  IPC_STRUCT_TRAITS_MEMBER(disable_accelerated_video_decode)
#if defined(OS_CHROMEOS)
  IPC_STRUCT_TRAITS_MEMBER(disable_vaapi_accelerated_video_encode)
#endif
#if BUILDFLAG(ENABLE_WEBRTC)
  IPC_STRUCT_TRAITS_MEMBER(disable_web_rtc_hw_encoding)
#endif
#if defined(OS_WIN)
  IPC_STRUCT_TRAITS_MEMBER(enable_accelerated_vpx_decode)
  IPC_STRUCT_TRAITS_MEMBER(enable_low_latency_dxva)
  IPC_STRUCT_TRAITS_MEMBER(enable_zero_copy_dxgi_video)
  IPC_STRUCT_TRAITS_MEMBER(enable_nv12_dxgi_video)
#endif
  IPC_STRUCT_TRAITS_MEMBER(compile_shader_always_succeeds)
  IPC_STRUCT_TRAITS_MEMBER(disable_gl_error_limit)
  IPC_STRUCT_TRAITS_MEMBER(disable_glsl_translator)
  IPC_STRUCT_TRAITS_MEMBER(disable_gpu_driver_bug_workarounds)
  IPC_STRUCT_TRAITS_MEMBER(disable_shader_name_hashing)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_command_logging)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_debugging)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_logging_gpu)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_driver_debug_logging)
  IPC_STRUCT_TRAITS_MEMBER(disable_gpu_program_cache)
  IPC_STRUCT_TRAITS_MEMBER(enforce_gl_minimums)
  IPC_STRUCT_TRAITS_MEMBER(force_gpu_mem_available)
  IPC_STRUCT_TRAITS_MEMBER(gpu_program_cache_size)
  IPC_STRUCT_TRAITS_MEMBER(disable_gpu_shader_disk_cache)
  IPC_STRUCT_TRAITS_MEMBER(enable_threaded_texture_mailboxes)
  IPC_STRUCT_TRAITS_MEMBER(gl_shader_interm_output)
  IPC_STRUCT_TRAITS_MEMBER(emulate_shader_precision)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_logging)
  IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_tracing)
  IPC_STRUCT_TRAITS_MEMBER(enable_es3_apis)
  IPC_STRUCT_TRAITS_MEMBER(use_passthrough_cmd_decoder)
IPC_STRUCT_TRAITS_END()

//------------------------------------------------------------------------------
// GPU Messages
// These are messages from the browser to the GPU process.

// Tells the GPU process to shutdown itself.
IPC_MESSAGE_CONTROL0(GpuMsg_Finalize)

// Tells the GPU process to close the channel identified by |client_id|.
// If no channel can be identified, do nothing.
IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel, int32_t /* client_id */)

// Tells the GPU process to create a new gpu memory buffer.
IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer,
                     GpuMsg_CreateGpuMemoryBuffer_Params)

// Tells the GPU process to destroy buffer.
IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer,
                     gfx::GpuMemoryBufferId, /* id */
                     int32_t,                /* client_id */
                     gpu::SyncToken /* sync_token */)

// Tells the GPU process to create a context for collecting graphics card
// information.
IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)

#if defined(OS_ANDROID)
// Tells the GPU process to wake up the GPU because we're about to draw.
IPC_MESSAGE_CONTROL0(GpuMsg_WakeUpGpu)

// Tells the GPU process to release the surface because it's being destroyed.
IPC_MESSAGE_CONTROL1(GpuMsg_DestroyingVideoSurface, int /* surface_id */)
#endif

// Tells the GPU process to remove all contexts.
IPC_MESSAGE_CONTROL0(GpuMsg_Clean)

// Tells the GPU process to crash.
IPC_MESSAGE_CONTROL0(GpuMsg_Crash)

// Tells the GPU process to hang.
IPC_MESSAGE_CONTROL0(GpuMsg_Hang)

#if defined(OS_ANDROID)
// Tells the GPU process to throw a java exception
IPC_MESSAGE_CONTROL0(GpuMsg_JavaCrash)
#endif

// Tells the GPU process that the browser has seen a GPU switch.
IPC_MESSAGE_CONTROL0(GpuMsg_GpuSwitched)

//------------------------------------------------------------------------------
// GPU Host Messages
// These are messages to the browser.

// Response from GPU to a GputMsg_Initialize message.
IPC_MESSAGE_CONTROL3(GpuHostMsg_Initialized,
                     bool /* result */,
                     ::gpu::GPUInfo /* gpu_info */,
                     ::gpu::GpuFeatureInfo /* gpu_feature_info */)

// Message to the GPU that a shader was loaded from disk.
IPC_MESSAGE_CONTROL1(GpuMsg_LoadedShader, std::string /* encoded shader */)

// Response from GPU to a GpuMsg_CreateGpuMemoryBuffer message.
IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryBufferCreated,
                     gfx::GpuMemoryBufferHandle /* handle */)

// Response from GPU to a GpuMsg_CollectGraphicsInfo.
IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
                     gpu::GPUInfo /* GPU logging stats */)

#if defined(OS_ANDROID)
// Response to a GpuMsg_DestroyingVideoSurface message.
IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyingVideoSurfaceAck,
                     int /* surface_id */)
#endif

// Message from GPU to add a GPU log message to the about:gpu page.
IPC_MESSAGE_CONTROL3(GpuHostMsg_OnLogMessage,
                     int /*severity*/,
                     std::string /* header */,
                     std::string /* message */)

// Sent by the GPU process to indicate that a fields trial has been activated.
IPC_MESSAGE_CONTROL1(GpuHostMsg_FieldTrialActivated, std::string /* name */)