Permalink
Browse files

back out 8c075fee9be4 / Bug 704710 on suspiscion that it is what caus…

…ed the blacklisting regression observed in bug 711656 and bug 715401 - a=akeybl
  • Loading branch information...
1 parent 906486b commit d7792ef2c2037f08e54d8dd5b7aa6af1860eea77 Benoit Jacob committed Mar 8, 2012
@@ -249,17 +249,17 @@ function populateGraphicsSection() {
if (gfxInfo) {
let trGraphics = [];
pushInfoRow(trGraphics, "adapterDescription", gfxInfo.adapterDescription);
- pushInfoRow(trGraphics, "adapterVendorID", gfxInfo.adapterVendorID);
- pushInfoRow(trGraphics, "adapterDeviceID", gfxInfo.adapterDeviceID);
+ pushInfoRow(trGraphics, "adapterVendorID", hexValueToString(gfxInfo.adapterVendorID));
+ pushInfoRow(trGraphics, "adapterDeviceID", hexValueToString(gfxInfo.adapterDeviceID));
pushInfoRow(trGraphics, "adapterRAM", gfxInfo.adapterRAM);
pushInfoRow(trGraphics, "adapterDrivers", gfxInfo.adapterDriver);
pushInfoRow(trGraphics, "driverVersion", gfxInfo.adapterDriverVersion);
pushInfoRow(trGraphics, "driverDate", gfxInfo.adapterDriverDate);
#ifdef XP_WIN
pushInfoRow(trGraphics, "adapterDescription2", gfxInfo.adapterDescription2);
- pushInfoRow(trGraphics, "adapterVendorID2", gfxInfo.adapterVendorID2);
- pushInfoRow(trGraphics, "adapterDeviceID2", gfxInfo.adapterDeviceID2);
+ pushInfoRow(trGraphics, "adapterVendorID2", hexValueToString(gfxInfo.adapterVendorID2));
+ pushInfoRow(trGraphics, "adapterDeviceID2", hexValueToString(gfxInfo.adapterDeviceID2));
pushInfoRow(trGraphics, "adapterRAM2", gfxInfo.adapterRAM2);
pushInfoRow(trGraphics, "adapterDrivers2", gfxInfo.adapterDriver2);
pushInfoRow(trGraphics, "driverVersion2", gfxInfo.adapterDriverVersion2);
@@ -64,11 +64,11 @@ interface nsIGfxInfo : nsISupports
readonly attribute DOMString adapterDriver2;
/* These types are inspired by DXGI_ADAPTER_DESC */
- readonly attribute DOMString adapterVendorID;
- readonly attribute DOMString adapterVendorID2;
+ readonly attribute unsigned long adapterVendorID;
+ readonly attribute unsigned long adapterVendorID2;
- readonly attribute DOMString adapterDeviceID;
- readonly attribute DOMString adapterDeviceID2;
+ readonly attribute unsigned long adapterDeviceID;
+ readonly attribute unsigned long adapterDeviceID2;
/**
* The amount of RAM in MB in the display adapter.
@@ -188,47 +188,47 @@ GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
return NS_ERROR_FAILURE;
}
-/* readonly attribute DOMString adapterVendorID; */
+/* readonly attribute unsigned long adapterVendorID; */
NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
+GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
{
nsAutoString str;
PRInt32 version; // the HARDWARE field isn't available on Android SDK < 8
if (!mozilla::AndroidBridge::Bridge()->GetStaticIntField("android/os/Build$VERSION", "SDK_INT", &version))
version = 0;
if (version >= 8 && mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str)) {
- aAdapterVendorID = str;
+ *aAdapterVendorID = HashString(str);
return NS_OK;
}
- aAdapterVendorID = NS_LITERAL_STRING("");
+ *aAdapterVendorID = 0;
return NS_OK;
}
-/* readonly attribute DOMString adapterVendorID2; */
+/* readonly attribute unsigned long adapterVendorID2; */
NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
+GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
{
return NS_ERROR_FAILURE;
}
-/* readonly attribute DOMString adapterDeviceID; */
+/* readonly attribute unsigned long adapterDeviceID; */
NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
+GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
{
nsAutoString str;
if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MODEL", str)) {
- aAdapterDeviceID = str;
+ *aAdapterDeviceID = HashString(str);
return NS_OK;
}
- aAdapterDeviceID = NS_LITERAL_STRING("");
+ *aAdapterDeviceID = 0;
return NS_OK;
}
-/* readonly attribute DOMString adapterDeviceID2; */
+/* readonly attribute unsigned long adapterDeviceID2; */
NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
+GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
{
return NS_ERROR_FAILURE;
}
@@ -244,30 +244,29 @@ void
GfxInfo::AddOpenGLCrashReportAnnotations()
{
#if defined(MOZ_CRASHREPORTER)
- nsAutoString adapterDescriptionString, deviceID, vendorID;
- nsCAutoString narrowDeviceID, narrowVendorID;
+ nsCAutoString deviceIDString, vendorIDString;
+ nsAutoString adapterDescriptionString;
+ PRUint32 deviceID, vendorID;
- GetAdapterDeviceID(deviceID);
- GetAdapterVendorID(vendorID);
+ GetAdapterDeviceID(&deviceID);
+ GetAdapterVendorID(&vendorID);
GetAdapterDescription(adapterDescriptionString);
- narrowDeviceID = NS_ConvertUTF16toUTF8(deviceID);
- narrowVendorID = NS_ConvertUTF16toUTF8(vendorID);
+ deviceIDString.AppendPrintf("%04x", deviceID);
+ vendorIDString.AppendPrintf("%04x", vendorID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"),
- narrowVendorID);
+ vendorIDString);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
- narrowDeviceID);
+ deviceIDString);
/* Add an App Note for now so that we get the data immediately. These
* can go away after we store the above in the socorro db */
nsCAutoString note;
/* AppendPrintf only supports 32 character strings, mrghh. */
- note.Append("AdapterVendorID: ");
- note.Append(narrowVendorID);
- note.Append(", AdapterDeviceID: ");
- note.Append(narrowDeviceID);
- note.Append(".\n");
+ note.AppendPrintf("AdapterVendorID: %04x, ", vendorID);
+ note.AppendPrintf("AdapterDeviceID: %04x.", deviceID);
+ note.Append("\n");
note.AppendPrintf("AdapterDescription: '%s'.", NS_ConvertUTF16toUTF8(adapterDescriptionString).get());
note.Append("\n");
@@ -41,7 +41,6 @@
#define __mozilla_widget_GfxInfo_h__
#include "GfxInfoBase.h"
-#include "GfxDriverInfo.h"
#include "nsString.h"
@@ -60,15 +59,15 @@ class GfxInfo : public GfxInfoBase
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
@@ -61,15 +61,15 @@ class GfxInfo : public GfxInfoBase
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
- NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
+ NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
@@ -101,8 +101,8 @@ class GfxInfo : public GfxInfoBase
nsString mDriverDate;
nsString mDeviceKey;
- nsString mAdapterVendorID;
- nsString mAdapterDeviceID;
+ PRUint32 mAdapterVendorID;
+ PRUint32 mAdapterDeviceID;
PRUint32 mRendererIDs[16];
@@ -68,6 +68,8 @@
using namespace mozilla::widget;
GfxInfo::GfxInfo()
+ : mAdapterVendorID(0),
+ mAdapterDeviceID(0)
{
}
@@ -102,25 +104,24 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
io_registry_entry_t dsp_port = CGDisplayIOServicePort(kCGDirectMainDisplay);
CFTypeRef vendor_id_ref = SearchPortForProperty(dsp_port, CFSTR("vendor-id"));
if (vendor_id_ref) {
- mAdapterVendorID.AppendPrintf("0x%4x", IntValueOfCFData((CFDataRef)vendor_id_ref));
+ mAdapterVendorID = IntValueOfCFData((CFDataRef)vendor_id_ref);
CFRelease(vendor_id_ref);
}
CFTypeRef device_id_ref = SearchPortForProperty(dsp_port, CFSTR("device-id"));
if (device_id_ref) {
- mAdapterDeviceID.AppendPrintf("0x%4x", IntValueOfCFData((CFDataRef)device_id_ref));
+ mAdapterDeviceID = IntValueOfCFData((CFDataRef)device_id_ref);
CFRelease(device_id_ref);
}
}
-// TODO dRdR FIXME
static bool
-IsATIRadeonX1000(nsAString& aVendorID, nsAString& aDeviceID)
+IsATIRadeonX1000(PRUint32 aVendorID, PRUint32 aDeviceID)
{
- if (aVendorID.LowerCaseEqualsLiteral("0x1002")) {
+ if (aVendorID == 0x1002) {
// this list is from the ATIRadeonX1000.kext Info.plist
- const char * devices[] = {"0x7187", "0x7210", "0x71de", "0x7146", "0x7142", "0x7109", "0x71c5", "0x71c0", "0x7240", "0x7249", "0x7291"};
+ PRUint32 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]))
+ if (aDeviceID == devices[i])
return true;
}
}
@@ -291,32 +292,32 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
return NS_ERROR_FAILURE;
}
-/* readonly attribute DOMString adapterVendorID; */
+/* readonly attribute unsigned long adapterVendorID; */
NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
+GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
{
- aAdapterVendorID = mAdapterVendorID;
+ *aAdapterVendorID = mAdapterVendorID;
return NS_OK;
}
-/* readonly attribute DOMString adapterVendorID2; */
+/* readonly attribute unsigned long adapterVendorID2; */
NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
+GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
{
return NS_ERROR_FAILURE;
}
-/* readonly attribute DOMString adapterDeviceID; */
+/* readonly attribute unsigned long adapterDeviceID; */
NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
+GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
{
- aAdapterDeviceID = mAdapterDeviceID;
+ *aAdapterDeviceID = mAdapterDeviceID;
return NS_OK;
}
-/* readonly attribute DOMString adapterDeviceID2; */
+/* readonly attribute unsigned long adapterDeviceID2; */
NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
+GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
{
return NS_ERROR_FAILURE;
}
@@ -332,26 +333,25 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
GfxInfo::AddCrashReportAnnotations()
{
#if defined(MOZ_CRASHREPORTER)
- nsString deviceID, vendorID;
- nsCAutoString narrowDeviceID, narrowVendorID;
+ nsCAutoString deviceIDString, vendorIDString;
+ PRUint32 deviceID, vendorID;
- GetAdapterDeviceID(deviceID);
- CopyUTF16toUTF8(deviceID, narrowDeviceID);
- GetAdapterVendorID(vendorID);
- CopyUTF16toUTF8(vendorID, narrowVendorID);
+ GetAdapterDeviceID(&deviceID);
+ GetAdapterVendorID(&vendorID);
+
+ deviceIDString.AppendPrintf("%04x", deviceID);
+ vendorIDString.AppendPrintf("%04x", vendorID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"),
- narrowVendorID);
+ vendorIDString);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
- narrowDeviceID);
+ deviceIDString);
/* Add an App Note for now so that we get the data immediately. These
* can go away after we store the above in the socorro db */
nsCAutoString note;
/* AppendPrintf only supports 32 character strings, mrghh. */
- note.Append("AdapterVendorID: ");
- note.Append(narrowVendorID);
- note.Append(", AdapterDeviceID: ");
- note.Append(narrowDeviceID);
+ note.AppendPrintf("AdapterVendorID: %04x, ", vendorID);
+ note.AppendPrintf("AdapterDeviceID: %04x", deviceID);
CrashReporter::AppendAppNotesToCrashReport(note);
#endif
}
@@ -367,7 +367,7 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
{
if (!mDriverInfo->Length()) {
IMPLEMENT_MAC_DRIVER_BLOCKLIST(DRIVER_OS_ALL,
- (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices,
+ GfxDriverInfo::vendorATI, GfxDriverInfo::allDevices,
nsIGfxInfo::FEATURE_WEBGL_MSAA, nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION);
}
return *mDriverInfo;
@@ -464,8 +464,7 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
bool foundGoodDevice = true;
// Blacklist the Geforce 7300 GT because of bug 678053
- if (mAdapterVendorID.LowerCaseEqualsLiteral("0x10de") &&
- mAdapterDeviceID.LowerCaseEqualsLiteral("0x0393")) {
+ if (mAdapterVendorID == 0x10de && mAdapterDeviceID == 0x0393) {
foundGoodDevice = false;
}
@@ -476,9 +475,8 @@ static PRUint32 IntValueOfCFData(CFDataRef d)
if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {
// Blacklist all ATI cards on OSX, except for
// 0x6760 and 0x9488
- if (mAdapterVendorID == GfxDriverInfo::GetDeviceVendor(VendorATI) &&
- (mAdapterDeviceID.LowerCaseEqualsLiteral("0x6760") ||
- mAdapterDeviceID.LowerCaseEqualsLiteral("0x9488"))) {
+ if (mAdapterVendorID == GfxDriverInfo::vendorATI &&
+ (mAdapterDeviceID == 0x6760 || mAdapterDeviceID == 0x9488)) {
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
return NS_OK;
}
Oops, something went wrong.

0 comments on commit d7792ef

Please sign in to comment.