Bug 918386 - Add webidl for adapter subsys. Only relevant on Windows. r=vvukicevic.

This commit is contained in:
Milan Sreckovic 2014-07-09 14:21:49 -04:00
parent 07fcc8c2d5
commit c4fb4dad1c
11 changed files with 122 additions and 19 deletions

View File

@ -320,6 +320,22 @@ GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
EnsureInitialized();
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID2; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
EnsureInitialized();
return NS_ERROR_FAILURE;
}
/* readonly attribute boolean isGPU2Active; */
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
@ -336,6 +352,8 @@ GfxInfo::AddCrashReportAnnotations()
mGLStrings->Vendor());
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
mGLStrings->Renderer());
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"),
mGLStrings->Version());
/* 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 */

View File

@ -37,6 +37,7 @@ public:
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
@ -44,6 +45,7 @@ public:
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);

View File

@ -30,6 +30,7 @@ public:
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
@ -37,6 +38,7 @@ public:
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);

View File

@ -245,6 +245,20 @@ GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID2; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute boolean isGPU2Active; */
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
@ -256,18 +270,22 @@ void
GfxInfo::AddCrashReportAnnotations()
{
#if defined(MOZ_CRASHREPORTER)
nsString deviceID, vendorID;
nsAutoCString narrowDeviceID, narrowVendorID;
nsString deviceID, vendorID, driverVersion;
nsAutoCString narrowDeviceID, narrowVendorID, narrowDriverVersion;
GetAdapterDeviceID(deviceID);
CopyUTF16toUTF8(deviceID, narrowDeviceID);
GetAdapterVendorID(vendorID);
CopyUTF16toUTF8(vendorID, narrowVendorID);
GetAdapterDriverVersion(driverVersion);
CopyUTF16toUTF8(driverVersion, narrowDriverVersion);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"),
narrowVendorID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
narrowDeviceID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"),
narrowDriverVersion);
/* 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 */
nsAutoCString note;

View File

@ -140,6 +140,20 @@ GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID2; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute boolean isGPU2Active; */
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)

View File

@ -29,6 +29,7 @@ public:
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
@ -36,6 +37,7 @@ public:
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);

View File

@ -8,7 +8,7 @@
/* NOTE: this interface is completely undesigned, not stable and likely to change */
[scriptable, uuid(1194ba76-aeb5-48df-abfd-844740ce3696)]
[scriptable, uuid(27212e99-ed25-449b-b79f-32ecb88d251e)]
interface nsIGfxInfo : nsISupports
{
/*
@ -37,6 +37,9 @@ interface nsIGfxInfo : nsISupports
readonly attribute DOMString adapterDeviceID;
readonly attribute DOMString adapterDeviceID2;
readonly attribute DOMString adapterSubsysID;
readonly attribute DOMString adapterSubsysID2;
/**
* The amount of RAM in MB in the display adapter.
*/

View File

@ -392,7 +392,7 @@ GfxInfo::Init()
mAdapterVendorID.AppendPrintf("0x%04x", ParseIDFromDeviceID(mDeviceID, "VEN_", 4));
mAdapterDeviceID.AppendPrintf("0x%04x", ParseIDFromDeviceID(mDeviceID, "&DEV_", 4));
mAdapterSubsysID = ParseIDFromDeviceID(mDeviceID, "&SUBSYS_", 8);
mAdapterSubsysID.AppendPrintf("%08x", ParseIDFromDeviceID(mDeviceID, "&SUBSYS_", 8));
// We now check for second display adapter.
@ -496,7 +496,7 @@ GfxInfo::Init()
mDriverDate2 = driverDate2;
mAdapterVendorID2.AppendPrintf("0x%04x", adapterVendorID2);
mAdapterDeviceID2.AppendPrintf("0x%04x", adapterDeviceID2);
mAdapterSubsysID2 = ParseIDFromDeviceID(mDeviceID2, "&SUBSYS_", 8);
mAdapterSubsysID2.AppendPrintf("%08x", ParseIDFromDeviceID(mDeviceID2, "&SUBSYS_", 8));
break;
}
}
@ -684,6 +684,22 @@ GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
return NS_OK;
}
/* readonly attribute DOMString adapterSubsysID; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
aAdapterSubsysID = mAdapterSubsysID;
return NS_OK;
}
/* readonly attribute DOMString adapterSubsysID2; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
aAdapterSubsysID = mAdapterSubsysID2;
return NS_OK;
}
/* readonly attribute boolean isGPU2Active; */
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
@ -719,21 +735,27 @@ GfxInfo::AddCrashReportAnnotations()
CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("DriverVersionMismatch\n"));
}
nsString deviceID, vendorID;
nsCString narrowDeviceID, narrowVendorID;
nsAutoString adapterDriverVersionString;
nsString deviceID, vendorID, driverVersion, subsysID;
nsCString narrowDeviceID, narrowVendorID, narrowDriverVersion, narrowSubsysID;
GetAdapterDeviceID(deviceID);
CopyUTF16toUTF8(deviceID, narrowDeviceID);
GetAdapterVendorID(vendorID);
CopyUTF16toUTF8(vendorID, narrowVendorID);
GetAdapterDriverVersion(adapterDriverVersionString);
GetAdapterDriverVersion(driverVersion);
CopyUTF16toUTF8(driverVersion, narrowDriverVersion);
GetAdapterSubsysID(subsysID);
CopyUTF16toUTF8(subsysID, narrowSubsysID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"),
narrowVendorID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
narrowDeviceID);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"),
narrowDriverVersion);
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterSubsysID"),
narrowSubsysID);
/* 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 */
nsAutoCString note;
@ -742,9 +764,10 @@ GfxInfo::AddCrashReportAnnotations()
note.Append(narrowVendorID);
note.AppendLiteral(", AdapterDeviceID: ");
note.Append(narrowDeviceID);
note.AppendPrintf(", AdapterSubsysID: %08x, ", mAdapterSubsysID);
note.AppendLiteral("AdapterDriverVersion: ");
note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString));
note.AppendLiteral(", AdapterSubsysID: ");
note.Append(narrowSubsysID);
note.AppendLiteral(", AdapterDriverVersion: ");
note.Append(NS_LossyConvertUTF16toASCII(driverVersion));
if (vendorID == GfxDriverInfo::GetDeviceVendor(VendorAll)) {
/* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */
@ -757,9 +780,9 @@ GfxInfo::AddCrashReportAnnotations()
note.Append("\n");
if (mHasDualGPU) {
nsString deviceID2, vendorID2;
nsString deviceID2, vendorID2, subsysID2;
nsAutoString adapterDriverVersionString2;
nsCString narrowDeviceID2, narrowVendorID2;
nsCString narrowDeviceID2, narrowVendorID2, narrowSubsysID2;
note.AppendLiteral("Has dual GPUs. GPU #2: ");
GetAdapterDeviceID2(deviceID2);
@ -767,12 +790,15 @@ GfxInfo::AddCrashReportAnnotations()
GetAdapterVendorID2(vendorID2);
CopyUTF16toUTF8(vendorID2, narrowVendorID2);
GetAdapterDriverVersion2(adapterDriverVersionString2);
GetAdapterSubsysID(subsysID2);
CopyUTF16toUTF8(subsysID2, narrowSubsysID2);
note.AppendLiteral("AdapterVendorID2: ");
note.Append(narrowVendorID2);
note.AppendLiteral(", AdapterDeviceID2: ");
note.Append(narrowDeviceID2);
note.AppendPrintf(", AdapterSubsysID2: %08x, ", mAdapterSubsysID2);
note.AppendPrintf("AdapterDriverVersion2: ");
note.AppendLiteral(", AdapterSubsysID2: ");
note.Append(narrowSubsysID2);
note.AppendLiteral(", AdapterDriverVersion2: ");
note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
}
CrashReporter::AppendAppNotesToCrashReport(note);

View File

@ -28,6 +28,7 @@ public:
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
@ -35,6 +36,7 @@ public:
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
@ -72,7 +74,7 @@ private:
nsString mDeviceKeyDebug;
nsString mAdapterVendorID;
nsString mAdapterDeviceID;
uint32_t mAdapterSubsysID;
nsString mAdapterSubsysID;
nsString mDeviceString2;
nsString mDriverVersion2;
nsString mDeviceID2;
@ -80,7 +82,7 @@ private:
nsString mDeviceKey2;
nsString mAdapterVendorID2;
nsString mAdapterDeviceID2;
uint32_t mAdapterSubsysID2;
nsString mAdapterSubsysID2;
uint32_t mWindowsVersion;
bool mHasDualGPU;
bool mIsGPU2Active;

View File

@ -512,6 +512,20 @@ GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString adapterSubsysID2; */
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute boolean isGPU2Active; */
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)

View File

@ -27,6 +27,7 @@ public:
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
@ -34,6 +35,7 @@ public:
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);