Bug 711656: potentially fixed devices not being caught by blocklist, r=joe

This doesn't necessarily fix the bug, but I think the problem was that the device IDs were in upper case but we store them statically in lower case, all the while using case-sensitive comparators. This patch switches all comparators that I could find to use case-insensitive instead, hopefully solving this.
This commit is contained in:
Doug Sherk 2012-02-21 14:49:06 -05:00
parent ec5a7c5b3d
commit 3b89d87219
3 changed files with 10 additions and 9 deletions

View File

@ -450,7 +450,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {
// Blacklist all ATI cards on OSX, except for
// 0x6760 and 0x9488
if (mAdapterVendorID == GfxDriverInfo::GetDeviceVendor(VendorATI) &&
if (mAdapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorATI), nsCaseInsensitiveStringComparator()) &&
(mAdapterDeviceID.LowerCaseEqualsLiteral("0x6760") ||
mAdapterDeviceID.LowerCaseEqualsLiteral("0x9488"))) {
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;

View File

@ -963,10 +963,10 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
return NS_ERROR_FAILURE;
}
if (adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorIntel) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorAMD) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorATI) &&
if (!adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorIntel), nsCaseInsensitiveStringComparator()) &&
!adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), nsCaseInsensitiveStringComparator()) &&
!adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorAMD), nsCaseInsensitiveStringComparator()) &&
!adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorATI), nsCaseInsensitiveStringComparator()) &&
// FIXME - these special hex values are currently used in xpcshell tests introduced by
// bug 625160 patch 8/8. Maybe these tests need to be adjusted now that we're only whitelisting
// intel/ati/nvidia.
@ -988,7 +988,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
// whitelist them, actually we do know that this combination of device and driver version
// works well.
if (mWindowsVersion == gfxWindowsPlatform::kWindowsXP &&
adapterVendorID == GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), nsCaseInsensitiveStringComparator()) &&
adapterDeviceID.LowerCaseEqualsLiteral("0x0861") && // GeForce 9400
driverVersion == V(6,14,11,7756))
{

View File

@ -47,6 +47,7 @@
#include "nsCOMArray.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "mozilla/Services.h"
#include "mozilla/Observer.h"
#include "nsIObserver.h"
@ -643,15 +644,15 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& info,
continue;
}
if (info[i].mAdapterVendor != GfxDriverInfo::GetDeviceVendor(VendorAll) &&
info[i].mAdapterVendor != adapterVendorID) {
if (!info[i].mAdapterVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorAll), nsCaseInsensitiveStringComparator()) &&
!info[i].mAdapterVendor.Equals(adapterVendorID, nsCaseInsensitiveStringComparator())) {
continue;
}
if (info[i].mDevices != GfxDriverInfo::allDevices && info[i].mDevices->Length()) {
bool deviceMatches = false;
for (PRUint32 j = 0; j < info[i].mDevices->Length(); j++) {
if ((*info[i].mDevices)[j] == adapterDeviceID) {
if ((*info[i].mDevices)[j].Equals(adapterDeviceID, nsCaseInsensitiveStringComparator())) {
deviceMatches = true;
break;
}