diff --git a/widget/src/android/GfxInfo.cpp b/widget/src/android/GfxInfo.cpp index aedd323d4e45..2738a9b1c1f5 100644 --- a/widget/src/android/GfxInfo.cpp +++ b/widget/src/android/GfxInfo.cpp @@ -278,10 +278,19 @@ GfxInfo::AddOpenGLCrashReportAnnotations() const nsTArray& GfxInfo::GetGfxDriverInfo() { - // Nothing here yet. - //if (!mDriverInfo->Length()) { - // - //} + if (!mDriverInfo->Length()) { + /* The following entry, when uncommented, will allow us to whitelist a + * specific device. See the long comment in GetFeatureStatusImpl for more + * info. */ + // APPEND_TO_DRIVER_BLOCKLIST( DRIVER_OS_ALL, + // my_vendor_id, my_device_id, + // nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NO_INFO, + // DRIVER_LESS_THAN, GfxDriverInfo::allDevices ); + APPEND_TO_DRIVER_BLOCKLIST2( DRIVER_OS_ALL, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices, + nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, + DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions ); + } return *mDriverInfo; } @@ -304,7 +313,12 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, mSetCrashReportAnnotations = true; } - /* XXX: Use this code when we're ready to whitelist devices. */ + /* The following code is an old way to whitelist devices when we're ready. + * It is staying here for reference. The best way to do this now is to add + * an entry in the list above. There is a dummy entry which will whitelist a + * device when uncommented and device/vendor IDs are inserted. It is + * preferred that we stop whitelisting and instead go to blocklisting, where + * everything is assumed to be okay as long as it's not in the blocklist. */ // nsAutoString str; // /* Whitelist Galaxy S phones */ // if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str)) { @@ -312,8 +326,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, // status = FEATURE_BLOCKED_DEVICE; // } // } - - status = FEATURE_BLOCKED_DEVICE; } *aStatus = status; diff --git a/widget/src/cocoa/GfxInfo.mm b/widget/src/cocoa/GfxInfo.mm index 65835bbf835b..b791bba176df 100644 --- a/widget/src/cocoa/GfxInfo.mm +++ b/widget/src/cocoa/GfxInfo.mm @@ -112,21 +112,6 @@ GfxInfo::GetDeviceInfo() } } -// TODO dRdR FIXME -static bool -IsATIRadeonX1000(nsAString& aVendorID, nsAString& aDeviceID) -{ - if (aVendorID.LowerCaseEqualsLiteral("0x1002")) { - // this list is from the ATIRadeonX1000.kext Info.plist - const char * devices[] = {"0x7187", "0x7210", "0x71de", "0x7146", "0x7142", "0x7109", "0x71c5", "0x71c0", "0x7240", "0x7249", "0x7291"}; - for (size_t i = 0; i < ArrayLength(devices); i++) { - if (aDeviceID.LowerCaseEqualsASCII(devices[i])) - return true; - } - } - return false; -} - nsresult GfxInfo::Init() { @@ -369,6 +354,12 @@ GfxInfo::GetGfxDriverInfo() IMPLEMENT_MAC_DRIVER_BLOCKLIST(DRIVER_OS_ALL, (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBGL_MSAA, nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION); + IMPLEMENT_MAC_DRIVER_BLOCKLIST(DRIVER_OS_ALL, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(RadeonX1000), + nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_BLOCKED_DEVICE); + IMPLEMENT_MAC_DRIVER_BLOCKLIST(DRIVER_OS_ALL, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(Geforce7300GT), + nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_BLOCKED_DEVICE); } return *mDriverInfo; } @@ -412,13 +403,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, status = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; } - if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS) { - bool foundGoodDevice = false; - - if (!IsATIRadeonX1000(mAdapterVendorID, mAdapterDeviceID)) { - foundGoodDevice = true; - } - + // The code around the following has been moved into the global blocklist. #if 0 // CGL reports a list of renderers, some renderers are slow (e.g. software) // and AFAIK we can't decide which one will be used among them, so let's implement this by returning NO_INFO @@ -455,23 +440,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, } } #endif - if (!foundGoodDevice) - status = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - } - - if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL) { - // same comment as above for FEATURE_OPENGL_LAYERS. - bool foundGoodDevice = true; - - // Blacklist the Geforce 7300 GT because of bug 678053 - if (mAdapterVendorID.LowerCaseEqualsLiteral("0x10de") && - mAdapterDeviceID.LowerCaseEqualsLiteral("0x0393")) { - foundGoodDevice = false; - } - - if (!foundGoodDevice) - status = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - } if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) { // Blacklist all ATI cards on OSX, except for diff --git a/widget/src/xpwidgets/GfxDriverInfo.cpp b/widget/src/xpwidgets/GfxDriverInfo.cpp index 063f39985b8d..7c42dfb7dee0 100644 --- a/widget/src/xpwidgets/GfxDriverInfo.cpp +++ b/widget/src/xpwidgets/GfxDriverInfo.cpp @@ -215,6 +215,23 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id) APPEND_DEVICE(0x03d2); /* C61 [GeForce 6100 nForce 400 (TM)] */ APPEND_DEVICE(0x03d5); /* C61 [GeForce 6100 nForce 420 (TM)] */ break; + case RadeonX1000: + // This list is from the ATIRadeonX1000.kext Info.plist + APPEND_DEVICE(0x7187); + APPEND_DEVICE(0x7210); + APPEND_DEVICE(0x71de); + APPEND_DEVICE(0x7146); + APPEND_DEVICE(0x7142); + APPEND_DEVICE(0x7109); + APPEND_DEVICE(0x71c5); + APPEND_DEVICE(0x71c0); + APPEND_DEVICE(0x7240); + APPEND_DEVICE(0x7249); + APPEND_DEVICE(0x7291); + break; + case Geforce7300GT: + APPEND_DEVICE(0x0393); + break; // This should never happen, but we get a warning if we don't handle this. case DeviceFamilyMax: NS_WARNING("Invalid DeviceFamily id"); diff --git a/widget/src/xpwidgets/GfxDriverInfo.h b/widget/src/xpwidgets/GfxDriverInfo.h index e8d1ddebd495..69105e61b690 100644 --- a/widget/src/xpwidgets/GfxDriverInfo.h +++ b/widget/src/xpwidgets/GfxDriverInfo.h @@ -88,6 +88,8 @@ enum DeviceFamily { IntelGMAX3000, IntelGMAX4500HD, NvidiaBlockD3D9Layers, + RadeonX1000, + Geforce7300GT, DeviceFamilyMax };