1// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// gpu/config/gpu_info.h
6module gpu.mojom;
7
8import "gpu/ipc/common/dx_diag_node.mojom";
9[EnableIf=is_win]
10import "gpu/ipc/common/luid.mojom";
11import "mojo/public/mojom/base/time.mojom";
12import "ui/gfx/geometry/mojom/geometry.mojom";
13
14[EnableIf=supports_vulkan]
15import "gpu/ipc/common/vulkan_info.mojom";
16
17// gpu::GPUInfo::GPUDevice
18struct GpuDevice {
19  uint32 vendor_id;
20  uint32 device_id;
21  [EnableIf=is_win]
22  uint32 sub_sys_id;
23  [EnableIf=is_win]
24  uint32 revision;
25  bool active;
26  string vendor_string;
27  string device_string;
28  string driver_vendor;
29  string driver_version;
30  int32 cuda_compute_capability_major;
31  [EnableIf=is_win]
32  Luid luid;
33};
34
35// gpu::VideoCodecProfile
36enum VideoCodecProfile {
37  VIDEO_CODEC_PROFILE_UNKNOWN = -1,
38  H264PROFILE_BASELINE = 0,
39  H264PROFILE_MAIN,
40  H264PROFILE_EXTENDED,
41  H264PROFILE_HIGH,
42  H264PROFILE_HIGH10PROFILE,
43  H264PROFILE_HIGH422PROFILE,
44  H264PROFILE_HIGH444PREDICTIVEPROFILE,
45  H264PROFILE_SCALABLEBASELINE,
46  H264PROFILE_SCALABLEHIGH,
47  H264PROFILE_STEREOHIGH,
48  H264PROFILE_MULTIVIEWHIGH,
49  VP8PROFILE_ANY,
50  VP9PROFILE_PROFILE0,
51  VP9PROFILE_PROFILE1,
52  VP9PROFILE_PROFILE2,
53  VP9PROFILE_PROFILE3,
54  HEVCPROFILE_MAIN,
55  HEVCPROFILE_MAIN10,
56  HEVCPROFILE_MAIN_STILL_PICTURE,
57  DOLBYVISION_PROFILE0,
58  DOLBYVISION_PROFILE4,
59  DOLBYVISION_PROFILE5,
60  DOLBYVISION_PROFILE7,
61  THEORAPROFILE_ANY,
62  AV1PROFILE_PROFILE_MAIN,
63  AV1PROFILE_PROFILE_HIGH,
64  AV1PROFILE_PROFILE_PRO,
65  DOLBYVISION_PROFILE8,
66  DOLBYVISION_PROFILE9,
67};
68
69// gpu::VideoDecodeAcceleratorSupportedProfile
70struct VideoDecodeAcceleratorSupportedProfile {
71  VideoCodecProfile profile;
72  gfx.mojom.Size max_resolution;
73  gfx.mojom.Size min_resolution;
74  bool encrypted_only;
75};
76
77// gpu::VideoDecodeAcceleratorCapabilities
78struct VideoDecodeAcceleratorCapabilities {
79  array<VideoDecodeAcceleratorSupportedProfile> supported_profiles;
80  uint32 flags;
81};
82
83// gpu::VideoEncodeAcceleratorSupportedProfile
84struct VideoEncodeAcceleratorSupportedProfile {
85  VideoCodecProfile profile;
86  gfx.mojom.Size min_resolution;
87  gfx.mojom.Size max_resolution;
88  uint32 max_framerate_numerator;
89  uint32 max_framerate_denominator;
90};
91
92// gpu::ImageDecodeAcceleratorType
93enum ImageDecodeAcceleratorType {
94  kJpeg,
95  kWebP,
96  kUnknown,
97};
98
99// gpu::ImageDecodeAcceleratorSubsampling
100enum ImageDecodeAcceleratorSubsampling {
101  k420,
102  k422,
103  k444,
104};
105
106// gpu::ImageDecodeAcceleratorSupportedProfile
107struct ImageDecodeAcceleratorSupportedProfile {
108  ImageDecodeAcceleratorType image_type;
109  gfx.mojom.Size min_encoded_dimensions;
110  gfx.mojom.Size max_encoded_dimensions;
111  array<ImageDecodeAcceleratorSubsampling> subsamplings;
112};
113
114// gpu::OverlaySupport
115[EnableIf=is_win]
116enum OverlaySupport {
117  NONE,
118  DIRECT,
119  SCALING,
120  SOFTWARE,
121};
122
123// gpu::OverlayInfo
124[EnableIf=is_win]
125struct OverlayInfo {
126  bool direct_composition;
127  bool supports_overlays;
128  OverlaySupport yuy2_overlay_support;
129  OverlaySupport nv12_overlay_support;
130  OverlaySupport bgra8_overlay_support;
131  OverlaySupport rgb10a2_overlay_support;
132};
133
134// Corresponds to |gpu::GPUInfo| in gpu/config/gpu_info.h
135struct GpuInfo {
136  mojo_base.mojom.TimeDelta initialization_time;
137  bool optimus;
138  bool amd_switchable;
139  GpuDevice gpu;
140  array<GpuDevice> secondary_gpus;
141  string pixel_shader_version;
142  string vertex_shader_version;
143  string max_msaa_samples;
144  string machine_model_name;
145  string machine_model_version;
146  string gl_version;
147  string gl_vendor;
148  string gl_renderer;
149  string gl_extensions;
150  string gl_ws_vendor;
151  string gl_ws_version;
152  string gl_ws_extensions;
153  uint32 gl_reset_notification_strategy;
154  bool software_rendering;
155  string direct_rendering_version;
156  bool sandboxed;
157  bool in_process_gpu;
158  bool passthrough_cmd_decoder;
159  bool can_support_threaded_texture_mailbox;
160
161  [EnableIf=is_mac]
162  uint32 macos_specific_texture_target;
163
164  [EnableIf=is_win]
165  DxDiagNode dx_diagnostics;
166  [EnableIf=is_win]
167  uint32 d3d12_feature_level;
168  [EnableIf=is_win]
169  uint32 vulkan_version;
170  [EnableIf=is_win]
171  OverlayInfo overlay_info;
172
173  VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
174  array<VideoEncodeAcceleratorSupportedProfile>
175    video_encode_accelerator_supported_profiles;
176  bool jpeg_decode_accelerator_supported;
177
178  array<ImageDecodeAcceleratorSupportedProfile>
179    image_decode_accelerator_supported_profiles;
180
181  bool oop_rasterization_supported;
182  bool subpixel_font_rendering;
183
184  [EnableIf=supports_vulkan]
185  VulkanInfo? vulkan_info;
186};
187