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