Bug 705959: move some special cases into global blocklists r=joe

Some of the special cases in GfxInfo classes were only necessary because there
was no generalized blocklist. These have been moved into the generalized
blocklist for each GfxInfo.
This commit is contained in:
Doug Sherk 2011-12-14 21:03:06 -08:00
Родитель 778e94f157
Коммит 674cb87172
4 изменённых файлов: 45 добавлений и 46 удалений

Просмотреть файл

@ -278,10 +278,19 @@ GfxInfo::AddOpenGLCrashReportAnnotations()
const nsTArray<GfxDriverInfo>&
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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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");

Просмотреть файл

@ -88,6 +88,8 @@ enum DeviceFamily {
IntelGMAX3000,
IntelGMAX4500HD,
NvidiaBlockD3D9Layers,
RadeonX1000,
Geforce7300GT,
DeviceFamilyMax
};