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 usingGPUProcess
;
19 readonly attribute AString DWriteVersion
;
20 readonly attribute AString cleartypeParameters
;
23 * These are non-Android linux-specific
25 readonly attribute AString windowProtocol
;
28 * These are valid across all platforms.
30 readonly attribute AString ContentBackend
;
31 readonly attribute
boolean WebRenderEnabled
;
32 readonly attribute
boolean isHeadless
;
33 readonly attribute
boolean UsesTiling
;
34 readonly attribute
boolean ContentUsesTiling
;
35 readonly attribute
boolean OffMainThreadPaintEnabled
;
36 readonly attribute
long OffMainThreadPaintWorkerCount
;
37 readonly attribute
unsigned long TargetFrameRate
;
39 // XXX: Switch to a list of devices, rather than explicitly numbering them.
42 * The name of the display adapter.
44 readonly attribute AString adapterDescription
;
45 readonly attribute AString adapterDescription2
;
47 readonly attribute AString adapterDriver
;
48 readonly attribute AString adapterDriver2
;
50 /* These types are inspired by DXGI_ADAPTER_DESC */
51 readonly attribute AString adapterVendorID
;
52 readonly attribute AString adapterVendorID2
;
54 readonly attribute AString adapterDeviceID
;
55 readonly attribute AString adapterDeviceID2
;
57 readonly attribute AString adapterSubsysID
;
58 readonly attribute AString adapterSubsysID2
;
61 * The amount of RAM in MB in the display adapter.
63 readonly attribute AString adapterRAM
;
64 readonly attribute AString adapterRAM2
;
66 readonly attribute AString adapterDriverVendor
;
67 readonly attribute AString adapterDriverVendor2
;
69 readonly attribute AString adapterDriverVersion
;
70 readonly attribute AString adapterDriverVersion2
;
72 readonly attribute AString adapterDriverDate
;
73 readonly attribute AString adapterDriverDate2
;
75 readonly attribute
boolean isGPU2Active
;
78 * Returns an array of objects describing each monitor. Guaranteed properties
79 * are "screenWidth" and "screenHeight". This is only implemented on Desktop.
81 * Windows additionally supplies "refreshRate" and "pseudoDisplay".
83 * OS X additionally supplies "scale".
89 out unsigned long failureCount
,
90 [optional, array
, size_is(failureCount
)] out long indices
,
91 [retval, array
, size_is(failureCount
)] out string failures
);
93 [noscript
, notxpcom
] void logFailure
(in ACString failure
);
95 * A set of constants for features that we can ask this GfxInfo object
96 * about via GetFeatureStatus
98 /* Don't assign any value <= 0 */
99 /* Whether Direct2D is supported for content rendering. */
100 const long FEATURE_DIRECT2D
= 1;
101 /* Whether Direct3D 9 is supported for layers. */
102 const long FEATURE_DIRECT3D_9_LAYERS
= 2;
103 /* Whether Direct3D 10.0 is supported for layers. */
104 const long FEATURE_DIRECT3D_10_LAYERS
= 3;
105 /* Whether Direct3D 10.1 is supported for layers. */
106 const long FEATURE_DIRECT3D_10_1_LAYERS
= 4;
107 /* Whether OpenGL is supported for layers */
108 const long FEATURE_OPENGL_LAYERS
= 5;
109 /* Whether WebGL is supported via OpenGL. */
110 const long FEATURE_WEBGL_OPENGL
= 6;
111 /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */
112 const long FEATURE_WEBGL_ANGLE
= 7;
113 /* Whether WebGL antialiasing is supported. */
114 const long FEATURE_WEBGL_MSAA
= 8;
115 /* Whether Stagefright is supported, starting in 17. */
116 const long FEATURE_STAGEFRIGHT
= 9;
117 /* Whether Webrtc Hardware acceleration is supported, starting in 31. */
118 const long FEATURE_WEBRTC_HW_ACCELERATION
= 10;
119 /* Whether Direct3D 11 is supported for layers, starting in 32. */
120 const long FEATURE_DIRECT3D_11_LAYERS
= 11;
121 /* Whether hardware accelerated video decoding is supported, starting in 36. */
122 const long FEATURE_HARDWARE_VIDEO_DECODING
= 12;
123 /* Whether Direct3D 11 is supported for ANGLE, starting in 38. */
124 const long FEATURE_DIRECT3D_11_ANGLE
= 13;
125 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
126 const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE
= 14;
127 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
128 const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE
= 15;
129 /* Whether Canvas acceleration is supported, starting in 45 */
130 const long FEATURE_CANVAS2D_ACCELERATION
= 16;
131 /* Whether hardware VP8 decoding is supported, starting in 48; not for downloadable blocking. */
132 const long FEATURE_VP8_HW_DECODE
= 17;
133 /* Whether hardware VP9 decoding is supported, starting in 48; not for downloadable blocking. */
134 const long FEATURE_VP9_HW_DECODE
= 18;
135 /* Whether NV_dx_interop2 is supported, starting in 50; downloadable blocking in 58. */
136 const long FEATURE_DX_INTEROP2
= 19;
137 /* Whether the GPU process is supported, starting in 52; downloadable blocking in 58. */
138 const long FEATURE_GPU_PROCESS
= 20;
139 /* Whether the WebGL2 is supported, starting in 54 */
140 const long FEATURE_WEBGL2
= 21;
141 /* Whether Advanced Layers is supported, starting in 56 */
142 const long FEATURE_ADVANCED_LAYERS
= 22;
143 /* Whether D3D11 keyed mutex is supported, starting in 56 */
144 const long FEATURE_D3D11_KEYED_MUTEX
= 23;
145 /* Whether WebRender is supported, starting in 62 */
146 const long FEATURE_WEBRENDER
= 24;
147 /* Whether WebRender is supported, starting in 62 */
148 const long FEATURE_DX_NV12
= 25;
149 const long FEATURE_DX_P010
= 26;
150 const long FEATURE_DX_P016
= 27;
151 /* the maximum feature value. */
152 const long FEATURE_MAX_VALUE
= FEATURE_DX_P016
;
155 * A set of return values from GetFeatureStatus
158 /* The driver is safe to the best of our knowledge */
159 const long FEATURE_STATUS_OK
= 1;
160 /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
161 const long FEATURE_STATUS_UNKNOWN
= 2;
162 /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
163 const long FEATURE_BLOCKED_DRIVER_VERSION
= 3;
164 /* This feature is blocked on this device, regardless of driver version.
165 * Typically means we hit too many driver crashes without a good reason to hope for them to
167 const long FEATURE_BLOCKED_DEVICE
= 4;
168 /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
169 const long FEATURE_DISCOURAGED
= 5;
170 /* This feature is blocked on this OS version. */
171 const long FEATURE_BLOCKED_OS_VERSION
= 6;
172 /* This feature is blocked because of mismatched driver versions. */
173 const long FEATURE_BLOCKED_MISMATCHED_VERSION
= 7;
176 * Ask about a feature, and return the status of that feature.
177 * If the feature is not ok then aFailureId will give a unique failure Id
178 * otherwise it will be empty.
180 long getFeatureStatus
(in long aFeature
, [optional] out ACString aFailureId
);
183 * Ask about a feature, return the minimum driver version required for it if its status is
184 * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
186 AString getFeatureSuggestedDriverVersion
(in long aFeature
);
188 // only useful on X11
189 [noscript
, notxpcom
] void GetData
();
194 // Return an object describing all features that have been configured:
197 // // For each feature:
200 // "description": <string>,
201 // "status": <string>,
203 // // One or more log entries, the first denotes the default value.
205 // "type": <string>, // "base", "user", "env", or "runtime"
206 // "status": <string>,
207 // "message": <string> // Set unless type is "base" and status is "available".
213 // // For each workaround:
216 // "description": <string>,
217 // "message": <string>
221 // When a message is prefixed with a '#', it is a special status code. Status
222 // codes are unique identifiers that can be searched in the codebase to find
223 // which line of code caused the message. Some codes are standardized to
224 // improve about:support messaging:
226 // "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
227 // CONTEXT is optional and can currently only be "BLOCKLIST".
228 // <number> refers to a bug number in Bugzilla.
231 jsval getFeatureLog
();
233 // Returns an object containing information about graphics features. It is
234 // intended to be directly included into the Telemetry environment.
238 // "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
239 // // ("none" indicates no compositors have been created)
240 // // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
242 // // Each backend can have one of the following statuses:
243 // // "unused" - This feature has not been requested.
244 // // "unavailable" - OS version or restriction prevents use.
245 // // "blocked" - An internal condition (such as safe mode) prevents use.
246 // // "blacklisted" - Blocked due to a blacklist restriction.
247 // // "disabled" - User explicitly disabled this default feature.
248 // // "failed" - Feature failed to initialize.
249 // // "available" - User has this feature available by default.
250 // "status": "<status>",
251 // "version": "<version>",
252 // "warp": true|false, // D3D11 only.
253 // "textureSharing": true|false, // D3D11 only.
259 // Returns an array listing any active crash guards.
263 // // Type is one of "d3d11layers", "d3d9video", "glcontext",
264 // // or "d3d11video".
265 // "type": "<identifier>",
267 // // Preference that must be deleted/reset to retrigger the guard.
268 // "prefName": "<preference>",
272 jsval getActiveCrashGuards
();
274 // Forces the GPU process to start or shutdown. This is intended only for
276 boolean controlGPUProcessForXPCShell
(in boolean aEnable
);