Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * vim: sw=2 ts=8 et :
3 : */
4 : /* This Source Code Form is subject to the terms of the Mozilla Public
5 : * License, v. 2.0. If a copy of the MPL was not distributed with this
6 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 :
8 : #include <unistd.h>
9 : #include <sys/types.h>
10 : #include <sys/wait.h>
11 : #include <errno.h>
12 : #include <sys/utsname.h>
13 : #include "nsCRTGlue.h"
14 : #include "nsExceptionHandler.h"
15 : #include "nsICrashReporter.h"
16 : #include "prenv.h"
17 :
18 : #include "GfxInfoX11.h"
19 :
20 :
21 : namespace mozilla {
22 : namespace widget {
23 :
24 : #ifdef DEBUG
25 0 : NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
26 : #endif
27 :
28 : // these global variables will be set when firing the glxtest process
29 : int glxtest_pipe = -1;
30 : pid_t glxtest_pid = 0;
31 :
32 : nsresult
33 0 : GfxInfo::Init()
34 : {
35 0 : mGLMajorVersion = 0;
36 0 : mMajorVersion = 0;
37 0 : mMinorVersion = 0;
38 0 : mRevisionVersion = 0;
39 0 : mIsMesa = false;
40 0 : mIsNVIDIA = false;
41 0 : mIsFGLRX = false;
42 0 : mIsNouveau = false;
43 0 : mIsIntel = false;
44 0 : mIsOldSwrast = false;
45 0 : mIsLlvmpipe = false;
46 0 : mHasTextureFromPixmap = false;
47 0 : return GfxInfoBase::Init();
48 : }
49 :
50 : void
51 0 : GfxInfo::GetData()
52 : {
53 : // to understand this function, see bug 639842. We retrieve the OpenGL driver information in a
54 : // separate process to protect against bad drivers.
55 :
56 : // if glxtest_pipe == -1, that means that we already read the information
57 0 : if (glxtest_pipe == -1)
58 0 : return;
59 :
60 : enum { buf_size = 1024 };
61 : char buf[buf_size];
62 0 : ssize_t bytesread = read(glxtest_pipe,
63 : &buf,
64 0 : buf_size-1); // -1 because we'll append a zero
65 0 : close(glxtest_pipe);
66 0 : glxtest_pipe = -1;
67 :
68 : // bytesread < 0 would mean that the above read() call failed.
69 : // This should never happen. If it did, the outcome would be to blacklist anyway.
70 0 : if (bytesread < 0)
71 0 : bytesread = 0;
72 :
73 : // let buf be a zero-terminated string
74 0 : buf[bytesread] = 0;
75 :
76 : // Wait for the glxtest process to finish. This serves 2 purposes:
77 : // * avoid having a zombie glxtest process laying around
78 : // * get the glxtest process status info.
79 0 : int glxtest_status = 0;
80 0 : bool wait_for_glxtest_process = true;
81 0 : bool waiting_for_glxtest_process_failed = false;
82 0 : int waitpid_errno = 0;
83 0 : while(wait_for_glxtest_process) {
84 0 : wait_for_glxtest_process = false;
85 0 : if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) {
86 0 : waitpid_errno = errno;
87 0 : if (waitpid_errno == EINTR) {
88 : wait_for_glxtest_process = true;
89 : } else {
90 : // Bug 718629
91 : // ECHILD happens when the glxtest process got reaped got reaped after a PR_CreateProcess
92 : // as per bug 227246. This shouldn't matter, as we still seem to get the data
93 : // from the pipe, and if we didn't, the outcome would be to blacklist anyway.
94 0 : waiting_for_glxtest_process_failed = (waitpid_errno != ECHILD);
95 : }
96 : }
97 : }
98 :
99 0 : bool exited_with_error_code = !waiting_for_glxtest_process_failed &&
100 0 : WIFEXITED(glxtest_status) &&
101 0 : WEXITSTATUS(glxtest_status) != EXIT_SUCCESS;
102 0 : bool received_signal = !waiting_for_glxtest_process_failed &&
103 0 : WIFSIGNALED(glxtest_status);
104 :
105 0 : bool error = waiting_for_glxtest_process_failed || exited_with_error_code || received_signal;
106 :
107 0 : nsCString textureFromPixmap;
108 0 : nsCString *stringToFill = nullptr;
109 0 : char *bufptr = buf;
110 0 : if (!error) {
111 : while(true) {
112 0 : char *line = NS_strtok("\n", &bufptr);
113 0 : if (!line)
114 : break;
115 0 : if (stringToFill) {
116 0 : stringToFill->Assign(line);
117 0 : stringToFill = nullptr;
118 : }
119 0 : else if(!strcmp(line, "VENDOR"))
120 0 : stringToFill = &mVendor;
121 0 : else if(!strcmp(line, "RENDERER"))
122 0 : stringToFill = &mRenderer;
123 0 : else if(!strcmp(line, "VERSION"))
124 0 : stringToFill = &mVersion;
125 0 : else if(!strcmp(line, "TFP"))
126 0 : stringToFill = &textureFromPixmap;
127 : }
128 : }
129 :
130 0 : if (!strcmp(textureFromPixmap.get(), "TRUE"))
131 0 : mHasTextureFromPixmap = true;
132 :
133 : // only useful for Linux kernel version check for FGLRX driver.
134 : // assumes X client == X server, which is sad.
135 : struct utsname unameobj;
136 0 : if (uname(&unameobj) >= 0)
137 : {
138 0 : mOS.Assign(unameobj.sysname);
139 0 : mOSRelease.Assign(unameobj.release);
140 : }
141 :
142 0 : const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR");
143 0 : if (spoofedVendor)
144 0 : mVendor.Assign(spoofedVendor);
145 0 : const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER");
146 0 : if (spoofedRenderer)
147 0 : mRenderer.Assign(spoofedRenderer);
148 0 : const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION");
149 0 : if (spoofedVersion)
150 0 : mVersion.Assign(spoofedVersion);
151 0 : const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS");
152 0 : if (spoofedOS)
153 0 : mOS.Assign(spoofedOS);
154 0 : const char *spoofedOSRelease = PR_GetEnv("MOZ_GFX_SPOOF_OS_RELEASE");
155 0 : if (spoofedOSRelease)
156 0 : mOSRelease.Assign(spoofedOSRelease);
157 :
158 0 : if (error ||
159 0 : mVendor.IsEmpty() ||
160 0 : mRenderer.IsEmpty() ||
161 0 : mVersion.IsEmpty() ||
162 0 : mOS.IsEmpty() ||
163 0 : mOSRelease.IsEmpty())
164 : {
165 0 : mAdapterDescription.AppendLiteral("GLXtest process failed");
166 0 : if (waiting_for_glxtest_process_failed)
167 0 : mAdapterDescription.AppendPrintf(" (waitpid failed with errno=%d for pid %d)", waitpid_errno, glxtest_pid);
168 0 : if (exited_with_error_code)
169 0 : mAdapterDescription.AppendPrintf(" (exited with status %d)", WEXITSTATUS(glxtest_status));
170 0 : if (received_signal)
171 0 : mAdapterDescription.AppendPrintf(" (received signal %d)", WTERMSIG(glxtest_status));
172 0 : if (bytesread) {
173 0 : mAdapterDescription.AppendLiteral(": ");
174 0 : mAdapterDescription.Append(nsDependentCString(buf));
175 0 : mAdapterDescription.Append('\n');
176 : }
177 :
178 0 : CrashReporter::AppendAppNotesToCrashReport(mAdapterDescription);
179 : return;
180 : }
181 :
182 0 : mAdapterDescription.Append(mVendor);
183 0 : mAdapterDescription.AppendLiteral(" -- ");
184 0 : mAdapterDescription.Append(mRenderer);
185 :
186 0 : nsAutoCString note;
187 0 : note.AppendLiteral("OpenGL: ");
188 0 : note.Append(mAdapterDescription);
189 0 : note.AppendLiteral(" -- ");
190 0 : note.Append(mVersion);
191 0 : if (mHasTextureFromPixmap)
192 0 : note.AppendLiteral(" -- texture_from_pixmap");
193 0 : note.Append('\n');
194 :
195 0 : CrashReporter::AppendAppNotesToCrashReport(note);
196 :
197 : // determine the major OpenGL version. That's the first integer in the version string.
198 0 : mGLMajorVersion = strtol(mVersion.get(), 0, 10);
199 :
200 : // determine driver type (vendor) and where in the version string
201 : // the actual driver version numbers should be expected to be found (whereToReadVersionNumbers)
202 0 : const char *whereToReadVersionNumbers = nullptr;
203 0 : const char *Mesa_in_version_string = strstr(mVersion.get(), "Mesa");
204 0 : if (Mesa_in_version_string) {
205 0 : mIsMesa = true;
206 : // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get:
207 : // there is no actual driver version info.
208 0 : whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa");
209 0 : if (strcasestr(mVendor.get(), "nouveau"))
210 0 : mIsNouveau = true;
211 0 : if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string
212 1 : mIsIntel = true;
213 0 : if (strcasestr(mRenderer.get(), "llvmpipe"))
214 0 : mIsLlvmpipe = true;
215 0 : if (strcasestr(mRenderer.get(), "software rasterizer"))
216 0 : mIsOldSwrast = true;
217 0 : } else if (strstr(mVendor.get(), "NVIDIA Corporation")) {
218 0 : mIsNVIDIA = true;
219 : // with the NVIDIA driver, the version string contains "NVIDIA major.minor"
220 : // note that here the vendor and version strings behave differently, that's why we don't put this above
221 : // alongside Mesa_in_version_string.
222 0 : const char *NVIDIA_in_version_string = strstr(mVersion.get(), "NVIDIA");
223 0 : if (NVIDIA_in_version_string)
224 0 : whereToReadVersionNumbers = NVIDIA_in_version_string + strlen("NVIDIA");
225 0 : } else if (strstr(mVendor.get(), "ATI Technologies Inc")) {
226 0 : mIsFGLRX = true;
227 : // with the FGLRX driver, the version string only gives a OpenGL version :/ so let's return that.
228 : // that can at least give a rough idea of how old the driver is.
229 0 : whereToReadVersionNumbers = mVersion.get();
230 : }
231 :
232 : // read major.minor version numbers of the driver (not to be confused with the OpenGL version)
233 0 : if (whereToReadVersionNumbers) {
234 : // copy into writable buffer, for tokenization
235 0 : strncpy(buf, whereToReadVersionNumbers, buf_size);
236 0 : bufptr = buf;
237 :
238 : // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have
239 : // been initialized as 0 anyways
240 0 : char *token = NS_strtok(".", &bufptr);
241 0 : if (token) {
242 0 : mMajorVersion = strtol(token, 0, 10);
243 0 : token = NS_strtok(".", &bufptr);
244 0 : if (token) {
245 0 : mMinorVersion = strtol(token, 0, 10);
246 0 : token = NS_strtok(".", &bufptr);
247 0 : if (token)
248 0 : mRevisionVersion = strtol(token, 0, 10);
249 : }
250 : }
251 : }
252 : }
253 :
254 : static inline uint64_t version(uint32_t major, uint32_t minor, uint32_t revision = 0)
255 : {
256 0 : return (uint64_t(major) << 32) + (uint64_t(minor) << 16) + uint64_t(revision);
257 : }
258 :
259 : const nsTArray<GfxDriverInfo>&
260 0 : GfxInfo::GetGfxDriverInfo()
261 : {
262 : // Nothing here yet.
263 : //if (!sDriverInfo->Length()) {
264 : //
265 : //}
266 0 : return *sDriverInfo;
267 : }
268 :
269 : nsresult
270 0 : GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
271 : int32_t *aStatus,
272 : nsAString & aSuggestedDriverVersion,
273 : const nsTArray<GfxDriverInfo>& aDriverInfo,
274 : nsACString& aFailureId,
275 : OperatingSystem* aOS /* = nullptr */)
276 :
277 : {
278 0 : NS_ENSURE_ARG_POINTER(aStatus);
279 0 : *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
280 0 : aSuggestedDriverVersion.SetIsVoid(true);
281 0 : OperatingSystem os = OperatingSystem::Linux;
282 0 : if (aOS)
283 0 : *aOS = os;
284 :
285 0 : if (sShutdownOccurred) {
286 : return NS_OK;
287 : }
288 :
289 0 : GetData();
290 :
291 0 : if (mGLMajorVersion == 1) {
292 : // We're on OpenGL 1. In most cases that indicates really old hardware.
293 : // We better block them, rather than rely on them to fail gracefully, because they don't!
294 : // see bug 696636
295 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
296 0 : aFailureId = "FEATURE_FAILURE_OPENGL_1";
297 0 : return NS_OK;
298 : }
299 :
300 : // Don't evaluate any special cases if we're checking the downloaded blocklist.
301 0 : if (!aDriverInfo.Length()) {
302 : // Blacklist software GL implementations from using layers acceleration.
303 : // On the test infrastructure, we'll force-enable layers acceleration.
304 0 : if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS &&
305 0 : (mIsLlvmpipe || mIsOldSwrast) &&
306 0 : !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL"))
307 : {
308 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
309 0 : aFailureId = "FEATURE_FAILURE_SOFTWARE_GL";
310 0 : return NS_OK;
311 : }
312 :
313 0 : if (aFeature == nsIGfxInfo::FEATURE_WEBRENDER) {
314 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
315 0 : aFailureId = "FEATURE_UNQUALIFIED_WEBRENDER_LINUX";
316 0 : return NS_OK;
317 : }
318 :
319 : // Only check features relevant to Linux.
320 0 : if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS ||
321 0 : aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL ||
322 0 : aFeature == nsIGfxInfo::FEATURE_WEBGL2 ||
323 : aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {
324 :
325 : // whitelist the linux test slaves' current configuration.
326 : // this is necessary as they're still using the slightly outdated 190.42 driver.
327 : // this isn't a huge risk, as at least this is the exact setting in which we do continuous testing,
328 : // and this only affects GeForce 9400 cards on linux on this precise driver version, which is very few users.
329 : // We do the same thing on Windows XP, see in widget/windows/GfxInfo.cpp
330 0 : if (mIsNVIDIA &&
331 0 : !strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") &&
332 0 : !strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42"))
333 : {
334 0 : *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
335 0 : return NS_OK;
336 : }
337 :
338 0 : if (mIsMesa) {
339 0 : if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) {
340 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
341 0 : aFailureId = "FEATURE_FAILURE_MESA_1";
342 0 : aSuggestedDriverVersion.AssignLiteral("Mesa 8.0");
343 : }
344 0 : else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) {
345 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
346 0 : aFailureId = "FEATURE_FAILURE_MESA_2";
347 0 : aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3");
348 : }
349 0 : else if (mIsOldSwrast) {
350 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
351 : aFailureId = "FEATURE_FAILURE_SW_RAST";
352 : }
353 0 : else if (mIsLlvmpipe && version(mMajorVersion, mMinorVersion) < version(9, 1)) {
354 : // bug 791905, Mesa bug 57733, fixed in Mesa 9.1 according to
355 : // https://bugs.freedesktop.org/show_bug.cgi?id=57733#c3
356 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
357 : aFailureId = "FEATURE_FAILURE_MESA_3";
358 : }
359 0 : else if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA)
360 : {
361 0 : if (mIsIntel && version(mMajorVersion, mMinorVersion) < version(8,1)) {
362 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
363 0 : aFailureId = "FEATURE_FAILURE_MESA_4";
364 0 : aSuggestedDriverVersion.AssignLiteral("Mesa 8.1");
365 : }
366 : }
367 :
368 0 : } else if (mIsNVIDIA) {
369 0 : if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) {
370 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
371 0 : aFailureId = "FEATURE_FAILURE_OLD_NV";
372 0 : aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21");
373 : }
374 0 : } else if (mIsFGLRX) {
375 : // FGLRX does not report a driver version number, so we have the OpenGL version instead.
376 : // by requiring OpenGL 3, we effectively require recent drivers.
377 0 : if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) {
378 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
379 0 : aFailureId = "FEATURE_FAILURE_OLD_FGLRX";
380 0 : aSuggestedDriverVersion.AssignLiteral("<Something recent>");
381 : }
382 : // Bug 724640: FGLRX + Linux 2.6.32 is a crashy combo
383 0 : bool unknownOS = mOS.IsEmpty() || mOSRelease.IsEmpty();
384 0 : bool badOS = mOS.Find("Linux", true) != -1 &&
385 0 : mOSRelease.Find("2.6.32") != -1;
386 0 : if (unknownOS || badOS) {
387 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
388 : aFailureId = "FEATURE_FAILURE_OLD_OS";
389 : }
390 : } else {
391 : // like on windows, let's block unknown vendors. Think of virtual machines.
392 : // Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed.
393 0 : *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
394 : }
395 : }
396 : }
397 :
398 0 : return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os);
399 : }
400 :
401 :
402 : NS_IMETHODIMP
403 0 : GfxInfo::GetD2DEnabled(bool *aEnabled)
404 : {
405 0 : return NS_ERROR_FAILURE;
406 : }
407 :
408 : NS_IMETHODIMP
409 0 : GfxInfo::GetDWriteEnabled(bool *aEnabled)
410 : {
411 0 : return NS_ERROR_FAILURE;
412 : }
413 :
414 : NS_IMETHODIMP
415 0 : GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
416 : {
417 0 : return NS_ERROR_FAILURE;
418 : }
419 :
420 : NS_IMETHODIMP
421 0 : GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
422 : {
423 0 : return NS_ERROR_FAILURE;
424 : }
425 :
426 : NS_IMETHODIMP
427 0 : GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
428 : {
429 0 : GetData();
430 0 : AppendASCIItoUTF16(mAdapterDescription, aAdapterDescription);
431 0 : return NS_OK;
432 : }
433 :
434 : NS_IMETHODIMP
435 0 : GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
436 : {
437 0 : return NS_ERROR_FAILURE;
438 : }
439 :
440 : NS_IMETHODIMP
441 0 : GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
442 : {
443 0 : aAdapterRAM.Truncate();
444 0 : return NS_OK;
445 : }
446 :
447 : NS_IMETHODIMP
448 0 : GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
449 : {
450 0 : return NS_ERROR_FAILURE;
451 : }
452 :
453 : NS_IMETHODIMP
454 0 : GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
455 : {
456 0 : aAdapterDriver.Truncate();
457 0 : return NS_OK;
458 : }
459 :
460 : NS_IMETHODIMP
461 0 : GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
462 : {
463 0 : return NS_ERROR_FAILURE;
464 : }
465 :
466 : NS_IMETHODIMP
467 0 : GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
468 : {
469 0 : GetData();
470 0 : CopyASCIItoUTF16(mVersion, aAdapterDriverVersion);
471 0 : return NS_OK;
472 : }
473 :
474 : NS_IMETHODIMP
475 0 : GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
476 : {
477 0 : return NS_ERROR_FAILURE;
478 : }
479 :
480 : NS_IMETHODIMP
481 0 : GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
482 : {
483 0 : aAdapterDriverDate.Truncate();
484 0 : return NS_OK;
485 : }
486 :
487 : NS_IMETHODIMP
488 0 : GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
489 : {
490 0 : return NS_ERROR_FAILURE;
491 : }
492 :
493 : NS_IMETHODIMP
494 0 : GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
495 : {
496 0 : GetData();
497 0 : CopyUTF8toUTF16(mVendor, aAdapterVendorID);
498 0 : return NS_OK;
499 : }
500 :
501 : NS_IMETHODIMP
502 0 : GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
503 : {
504 0 : return NS_ERROR_FAILURE;
505 : }
506 :
507 : NS_IMETHODIMP
508 0 : GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
509 : {
510 0 : GetData();
511 0 : CopyUTF8toUTF16(mRenderer, aAdapterDeviceID);
512 0 : return NS_OK;
513 : }
514 :
515 : NS_IMETHODIMP
516 0 : GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
517 : {
518 0 : return NS_ERROR_FAILURE;
519 : }
520 :
521 : NS_IMETHODIMP
522 0 : GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
523 : {
524 0 : return NS_ERROR_FAILURE;
525 : }
526 :
527 : NS_IMETHODIMP
528 0 : GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
529 : {
530 0 : return NS_ERROR_FAILURE;
531 : }
532 :
533 : NS_IMETHODIMP
534 0 : GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
535 : {
536 0 : return NS_ERROR_FAILURE;
537 : }
538 :
539 : #ifdef DEBUG
540 :
541 : // Implement nsIGfxInfoDebug
542 : // We don't support spoofing anything on Linux
543 :
544 0 : NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID)
545 : {
546 0 : CopyUTF16toUTF8(aVendorID, mVendor);
547 0 : return NS_OK;
548 : }
549 :
550 0 : NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID)
551 : {
552 0 : CopyUTF16toUTF8(aDeviceID, mRenderer);
553 0 : return NS_OK;
554 : }
555 :
556 0 : NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion)
557 : {
558 0 : CopyUTF16toUTF8(aDriverVersion, mVersion);
559 0 : return NS_OK;
560 : }
561 :
562 0 : NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t aVersion)
563 : {
564 : // We don't support OS versioning on Linux. There's just "Linux".
565 0 : return NS_OK;
566 : }
567 :
568 : #endif
569 :
570 : } // end namespace widget
571 : } // end namespace mozilla
|