1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include
"nsISupports.idl"
9 /* NOTE: this interface is completely undesigned, not stable and likely to change */
10 [scriptable
, builtinclass
, uuid(1accd618
-4c80
-4703-9d29
-ecf257d397c8
)]
11 interface nsIGfxInfo
: nsISupports
14 * These are win32-specific
16 readonly attribute
boolean D2DEnabled
;
17 readonly attribute
boolean DWriteEnabled
;
18 readonly attribute
boolean EmbeddedInFirefoxReality
;
19 readonly attribute AString AzureCanvasBackend
;
20 readonly attribute AString AzureContentBackend
;
21 readonly attribute
boolean usingGPUProcess
;
22 readonly attribute
boolean hasBattery
;
23 readonly attribute AString DWriteVersion
;
24 readonly attribute AString cleartypeParameters
;
27 * These are non-Android linux-specific
29 readonly attribute AString windowProtocol
;
30 readonly attribute AString desktopEnvironment
;
31 readonly attribute AString testType
;
34 * These are valid across all platforms.
36 readonly attribute AString ContentBackend
;
37 readonly attribute
boolean WebRenderEnabled
;
38 readonly attribute
boolean isHeadless
;
39 readonly attribute
unsigned long TargetFrameRate
;
41 // XXX: Switch to a list of devices, rather than explicitly numbering them.
44 * The name of the display adapter.
46 readonly attribute AString adapterDescription
;
47 readonly attribute AString adapterDescription2
;
49 readonly attribute AString adapterDriver
;
50 readonly attribute AString adapterDriver2
;
52 /* These types are inspired by DXGI_ADAPTER_DESC */
53 readonly attribute AString adapterVendorID
;
54 readonly attribute AString adapterVendorID2
;
56 readonly attribute AString adapterDeviceID
;
57 readonly attribute AString adapterDeviceID2
;
59 readonly attribute AString adapterSubsysID
;
60 readonly attribute AString adapterSubsysID2
;
63 * The amount of RAM in MB in the display adapter.
65 readonly attribute
unsigned long adapterRAM
;
66 readonly attribute
unsigned long adapterRAM2
;
68 readonly attribute AString adapterDriverVendor
;
69 readonly attribute AString adapterDriverVendor2
;
71 readonly attribute AString adapterDriverVersion
;
72 readonly attribute AString adapterDriverVersion2
;
74 readonly attribute AString adapterDriverDate
;
75 readonly attribute AString adapterDriverDate2
;
77 readonly attribute
boolean isGPU2Active
;
79 readonly attribute ACString drmRenderDevice
;
82 * Returns an array of objects describing each monitor. Guaranteed properties
83 * are "screenWidth" and "screenHeight". This is only implemented on Desktop.
85 * Windows additionally supplies "refreshRate" and "pseudoDisplay".
87 * OS X additionally supplies "scale".
92 Array
<ACString
> getFailures
(out Array
<long> indices
);
94 [noscript
, notxpcom
] void logFailure
(in ACString failure
);
96 * A set of constants for features that we can ask this GfxInfo object
97 * about via GetFeatureStatus
99 /* Don't assign any value <= 0 */
100 /* Values must be contiguous */
101 /* Whether Direct2D is supported for content rendering. */
102 const long FEATURE_DIRECT2D
= 1;
103 /* Whether Direct3D 9 is supported for layers. */
104 const long FEATURE_DIRECT3D_9_LAYERS
= 2;
105 /* Whether Direct3D 10.0 is supported for layers. */
106 const long FEATURE_DIRECT3D_10_LAYERS
= 3;
107 /* Whether Direct3D 10.1 is supported for layers. */
108 const long FEATURE_DIRECT3D_10_1_LAYERS
= 4;
109 /* Whether OpenGL is supported for layers */
110 const long FEATURE_OPENGL_LAYERS
= 5;
111 /* Whether WebGL is supported via OpenGL. */
112 const long FEATURE_WEBGL_OPENGL
= 6;
113 /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */
114 const long FEATURE_WEBGL_ANGLE
= 7;
115 /* (Unused) Whether WebGL antialiasing is supported. */
116 const long UNUSED_FEATURE_WEBGL_MSAA
= 8;
117 /* Whether Stagefright is supported, starting in 17. */
118 const long FEATURE_STAGEFRIGHT
= 9;
119 /* Whether Webrtc Hardware H.264 acceleration is supported, starting in 71. */
120 const long FEATURE_WEBRTC_HW_ACCELERATION_H264
= 10;
121 /* Whether Direct3D 11 is supported for layers, starting in 32. */
122 const long FEATURE_DIRECT3D_11_LAYERS
= 11;
123 /* Whether hardware accelerated video decoding is supported, starting in 36. */
124 const long FEATURE_HARDWARE_VIDEO_DECODING
= 12;
125 /* Whether Direct3D 11 is supported for ANGLE, starting in 38. */
126 const long FEATURE_DIRECT3D_11_ANGLE
= 13;
127 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
128 const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE
= 14;
129 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
130 const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE
= 15;
131 /* Whether Canvas acceleration is supported, starting in 45 */
132 const long FEATURE_CANVAS2D_ACCELERATION
= 16;
133 /* Whether hardware VP8 decoding is supported, starting in 48; not for downloadable blocking. */
134 const long FEATURE_VP8_HW_DECODE
= 17;
135 /* Whether hardware VP9 decoding is supported, starting in 48; not for downloadable blocking. */
136 const long FEATURE_VP9_HW_DECODE
= 18;
137 /* Whether NV_dx_interop2 is supported, starting in 50; downloadable blocking in 58. */
138 const long FEATURE_DX_INTEROP2
= 19;
139 /* Whether the GPU process is supported, starting in 52; downloadable blocking in 58. */
140 const long FEATURE_GPU_PROCESS
= 20;
141 /* Whether the WebGL2 is supported, starting in 54 */
142 const long FEATURE_WEBGL2
= 21;
143 /* Whether D3D11 keyed mutex is supported, starting in 56 */
144 const long FEATURE_D3D11_KEYED_MUTEX
= 22;
145 /* Whether WebRender is supported, starting in 62 */
146 const long FEATURE_WEBRENDER
= 23;
147 /* Whether WebRender is supported, starting in 62 */
148 const long FEATURE_DX_NV12
= 24;
149 const long FEATURE_DX_P010
= 25;
150 const long FEATURE_DX_P016
= 26;
151 /* Whether OpenGL swizzle configuration of texture units is supported, starting in 70 */
152 const long FEATURE_GL_SWIZZLE
= 27;
153 /* Whether WebRender native compositor is supported, starting in 73 */
154 const long FEATURE_WEBRENDER_COMPOSITOR
= 28;
155 /* Whether WebRender can use scissored clears for cached surfaces, staring in 79 */
156 const long FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS
= 29;
157 /* Support webgl.out-of-process: true (starting in 83) */
158 const long FEATURE_ALLOW_WEBGL_OUT_OF_PROCESS
= 30;
159 /* Is OpenGL threadsafe (starting in 83) */
160 const long FEATURE_THREADSAFE_GL
= 31;
161 /* Whether webrender uses pre-optimized shaders, starting in 87. */
162 const long FEATURE_WEBRENDER_OPTIMIZED_SHADERS
= 32;
163 /* Whether we prefer EGL over GLX with X11, starting in 88. */
164 const long FEATURE_X11_EGL
= 33;
165 /* Whether DMABUF is supported, starting in 88. */
166 const long FEATURE_DMABUF
= 34;
167 /* Whether webrender caches shader program binaries to disk, starting in 89. */
168 const long FEATURE_WEBRENDER_SHADER_CACHE
= 35;
169 /* Whether partial present is allowed with WebRender, starting in 98. */
170 const long FEATURE_WEBRENDER_PARTIAL_PRESENT
= 36;
171 /* Whether VA-API is supported, starting in 96. */
172 const long FEATURE_VAAPI
= 37;
173 /* Whether WebGPU is supported, starting in 100. */
174 const long FEATURE_WEBGPU
= 38;
175 /* Whether video overlay is supported, starting in 100. */
176 const long FEATURE_VIDEO_OVERLAY
= 39;
177 /* Whether hardware decoded video zero copy is supported, starting in 101. */
178 const long FEATURE_HW_DECODED_VIDEO_ZERO_COPY
= 40;
179 /* Whether DMABUF export is supported, starting in 103. */
180 const long FEATURE_DMABUF_SURFACE_EXPORT
= 41;
181 /* Whether reuse decoder device is supported, starting in 104. */
182 const long FEATURE_REUSE_DECODER_DEVICE
= 42;
183 /* the maximum feature value. */
184 const long FEATURE_MAX_VALUE
= FEATURE_REUSE_DECODER_DEVICE
;
187 * A set of return values from GetFeatureStatus
190 /* The driver is safe to the best of our knowledge */
191 const long FEATURE_STATUS_OK
= 1;
192 /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
193 const long FEATURE_STATUS_UNKNOWN
= 2;
194 /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
195 const long FEATURE_BLOCKED_DRIVER_VERSION
= 3;
196 /* This feature is blocked on this device, regardless of driver version.
197 * Typically means we hit too many driver crashes without a good reason to hope for them to
199 const long FEATURE_BLOCKED_DEVICE
= 4;
200 /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
201 const long FEATURE_DISCOURAGED
= 5;
202 /* This feature is blocked on this OS version. */
203 const long FEATURE_BLOCKED_OS_VERSION
= 6;
204 /* This feature is blocked because of mismatched driver versions. */
205 const long FEATURE_BLOCKED_MISMATCHED_VERSION
= 7;
206 /* This feature is blocked due to not being on the allowlist. */
207 const long FEATURE_DENIED
= 8;
208 /* This feature is safe to be on this device due to the allowlist. */
209 const long FEATURE_ALLOW_ALWAYS
= 9;
210 /* This feature is safe to be on this device due to the allowlist, depending on qualified/experiment status. */
211 const long FEATURE_ALLOW_QUALIFIED
= 10;
214 * Ask about a feature, and return the status of that feature.
215 * If the feature is not ok then aFailureId will give a unique failure Id
216 * otherwise it will be empty.
218 long getFeatureStatus
(in long aFeature
, [optional] out ACString aFailureId
);
221 * Ask about a feature, return the minimum driver version required for it if its status is
222 * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
224 AString getFeatureSuggestedDriverVersion
(in long aFeature
);
226 // only useful on X11
227 [noscript
, notxpcom
] void GetData
();
230 * Maximum refresh rate among detected monitors. -1 if unknown. aMixed is set
231 * to true if we know there are multiple displays and they have different
232 * refresh rates, else false. The returned value is in Hz.
234 [noscript
, notxpcom
] long GetMaxRefreshRate
(out boolean aMixed
);
239 // Return an object describing all features that have been configured:
242 // // For each feature:
245 // "description": <string>,
246 // "status": <string>,
248 // // One or more log entries, the first denotes the default value.
250 // "type": <string>, // "base", "user", "env", or "runtime"
251 // "status": <string>,
252 // "message": <string> // Set unless type is "base" and status is "available".
258 // // For each workaround:
261 // "description": <string>,
262 // "message": <string>
266 // When a message is prefixed with a '#', it is a special status code. Status
267 // codes are unique identifiers that can be searched in the codebase to find
268 // which line of code caused the message. Some codes are standardized to
269 // improve about:support messaging:
271 // "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
272 // CONTEXT is optional and can currently only be "BLOCKLIST".
273 // <number> refers to a bug number in Bugzilla.
276 jsval getFeatureLog
();
278 // Returns an object containing information about graphics features. It is
279 // intended to be directly included into the Telemetry environment.
283 // "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
284 // // ("none" indicates no compositors have been created)
285 // // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
287 // // Each backend can have one of the following statuses:
288 // // "unused" - This feature has not been requested.
289 // // "unavailable" - OS version or restriction prevents use.
290 // // "blocked" - An internal condition (such as safe mode) prevents use.
291 // // "blocklisted" - Blocked due to a blocklist restriction.
292 // // "denied" - Blocked due to allowlist restrictions.
293 // // "disabled" - User explicitly disabled this default feature.
294 // // "failed" - Feature failed to initialize.
295 // // "available" - User has this feature available by default.
296 // "status": "<status>",
297 // "version": "<version>",
298 // "warp": true|false, // D3D11 only.
299 // "textureSharing": true|false, // D3D11 only.
305 // Returns an array listing any active crash guards.
309 // // Type is one of "d3d11layers", or "glcontext".
310 // "type": "<identifier>",
312 // // Preference that must be deleted/reset to retrigger the guard.
313 // "prefName": "<preference>",
317 jsval getActiveCrashGuards
();
319 // Forces the GPU process to start or shutdown. This is intended only for
321 boolean controlGPUProcessForXPCShell
(in boolean aEnable
);
323 // Kills the GPU process cleanly, without generating a crash dump.
324 // This is intended only for use by tests.
325 void killGPUProcessForTests
();
327 // Causes the GPU process to crash. This is intended only for use by tests.
328 void crashGPUProcessForTests
();