LCOV - code coverage report
Current view: top level - widget - GfxInfoX11.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 175 279 62.7 %
Date: 2017-07-14 16:53:18 Functions: 20 33 60.6 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13