Bug 1563854 - Restrict Nvidia blocklist entry to the proprietary driver. r=aosmond a=RyanVM
authorJan Andre Ikenmeyer <jan@ikenmeyer.eu>
Tue, 16 Jul 2019 03:56:49 +0200
changeset 537268 3b9d6043de6a954f0ae0111477c1cf3d6af4d9a0
parent 537267 cd54e617eab9a0066d5617eb2be0b7b56524e27d
child 537269 94b2c630c42c5720b9cdd4cc0c390408c927d69c
push id2118
push userarchaeopteryx@coole-files.de
push dateThu, 01 Aug 2019 11:01:26 +0000
treeherdermozilla-release@e815b40e9e70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond, RyanVM
bugs1563854
milestone68.0.2
Bug 1563854 - Restrict Nvidia blocklist entry to the proprietary driver. r=aosmond a=RyanVM Differential Revision: https://phabricator.services.mozilla.com//D38155
widget/GfxDriverInfo.cpp
widget/GfxDriverInfo.h
widget/GfxInfoX11.cpp
--- a/widget/GfxDriverInfo.cpp
+++ b/widget/GfxDriverInfo.cpp
@@ -409,14 +409,15 @@ const nsAString& GfxDriverInfo::GetDrive
 
   switch (id) {
     DECLARE_DRIVER_VENDOR_ID(DriverVendorAll, "");
     DECLARE_DRIVER_VENDOR_ID(DriverMesaAll, "mesa/all");
     DECLARE_DRIVER_VENDOR_ID(DriverMesaLLVMPipe, "mesa/llvmpipe");
     DECLARE_DRIVER_VENDOR_ID(DriverMesaSoftPipe, "mesa/softpipe");
     DECLARE_DRIVER_VENDOR_ID(DriverMesaSWRast, "mesa/swrast");
     DECLARE_DRIVER_VENDOR_ID(DriverMesaUnknown, "mesa/unknown");
+    DECLARE_DRIVER_VENDOR_ID(DriverNonMesaAll, "non-mesa/all");
     // Suppress a warning.
     DECLARE_DRIVER_VENDOR_ID(DriverVendorMax, "");
   }
 
   return *sDriverVendors[id];
 }
--- a/widget/GfxDriverInfo.h
+++ b/widget/GfxDriverInfo.h
@@ -140,16 +140,18 @@ enum DriverVendor {
   // Note that the following list of Mesa drivers is not comprehensive; we pull
   // the DRI driver at runtime. These drivers are provided for convenience when
   // populating the local blocklist.
   DriverMesaLLVMPipe,
   DriverMesaSoftPipe,
   DriverMesaSWRast,
   // A generic ID to be provided when we can't determine the DRI driver on Mesa.
   DriverMesaUnknown,
+  // Wildcard for all non-Mesa drivers.
+  DriverNonMesaAll,
 
   DriverVendorMax
 };
 
 /* Array of devices to match, or an empty array for all devices */
 typedef nsTArray<nsString> GfxDeviceFamily;
 
 struct GfxDriverInfo {
--- a/widget/GfxInfoX11.cpp
+++ b/widget/GfxInfoX11.cpp
@@ -50,18 +50,18 @@ void GfxInfo::AddCrashReportAnnotations(
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterVendorID,
                                      mVendorId);
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterDeviceID,
                                      mDeviceId);
   CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::AdapterDriverVendor, mDriverVendor);
   CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::AdapterDriverVersion, mDriverVersion);
-  CrashReporter::AnnotateCrashReport(
-      CrashReporter::Annotation::IsWayland, mIsWayland);
+  CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::IsWayland,
+                                     mIsWayland);
 }
 
 void GfxInfo::GetData() {
   // to understand this function, see bug 639842. We retrieve the OpenGL driver
   // information in a separate process to protect against bad drivers.
 
   // if glxtest_pipe == -1, that means that we already read the information
   if (glxtest_pipe == -1) return;
@@ -307,17 +307,17 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
         GfxDriverInfo::allDevices, GfxDriverInfo::allFeatures,
         nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
         V(10, 0, 0, 0), "FEATURE_FAILURE_OLD_MESA", "Mesa 10.0");
 
     // NVIDIA baseline (ported from old blocklist)
     APPEND_TO_DRIVER_BLOCKLIST(
         OperatingSystem::Linux,
         (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA),
-        (nsAString&)GfxDriverInfo::GetDriverVendor(DriverVendorAll),
+        (nsAString&)GfxDriverInfo::GetDriverVendor(DriverNonMesaAll),
         GfxDriverInfo::allDevices, GfxDriverInfo::allFeatures,
         nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
         V(257, 21, 0, 0), "FEATURE_FAILURE_OLD_NVIDIA", "NVIDIA 257.21");
 
     // fglrx baseline (chosen arbitrarily as 2013-07-22 release).
     APPEND_TO_DRIVER_BLOCKLIST(
         OperatingSystem::Linux,
         (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorATI),
@@ -361,16 +361,21 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
 
 bool GfxInfo::DoesDriverVendorMatch(const nsAString& aBlocklistVendor,
                                     const nsAString& aDriverVendor) {
   if (mIsMesa &&
       aBlocklistVendor.Equals(GfxDriverInfo::GetDriverVendor(DriverMesaAll),
                               nsCaseInsensitiveStringComparator())) {
     return true;
   }
+  if (!mIsMesa &&
+      aBlocklistVendor.Equals(GfxDriverInfo::GetDriverVendor(DriverNonMesaAll),
+                              nsCaseInsensitiveStringComparator())) {
+    return true;
+  }
   return GfxInfoBase::DoesDriverVendorMatch(aBlocklistVendor, aDriverVendor);
 }
 
 nsresult GfxInfo::GetFeatureStatusImpl(
     int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion,
     const nsTArray<GfxDriverInfo>& aDriverInfo, nsACString& aFailureId,
     OperatingSystem* aOS /* = nullptr */)