mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 591057 - Identify active GPU in about:support and crash reports - r=jrmuizel
This commit is contained in:
parent
024236d717
commit
f81fe059d2
@ -247,6 +247,15 @@ function populateGraphicsSection() {
|
||||
pushInfoRow(trGraphics, "driverDate", gfxInfo.adapterDriverDate);
|
||||
|
||||
#ifdef XP_WIN
|
||||
pushInfoRow(trGraphics, "adapterDescription2", gfxInfo.adapterDescription2);
|
||||
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);
|
||||
pushInfoRow(trGraphics, "driverDate2", gfxInfo.adapterDriverDate2);
|
||||
pushInfoRow(trGraphics, "isGPU2Active", gfxInfo.isGPU2Active);
|
||||
|
||||
var version = Cc["@mozilla.org/system-info;1"]
|
||||
.getService(Ci.nsIPropertyBag2)
|
||||
.getProperty("version");
|
||||
|
@ -31,4 +31,12 @@ adapterDrivers = Adapter Drivers
|
||||
adapterRAM = Adapter RAM
|
||||
driverVersion = Driver Version
|
||||
driverDate = Driver Date
|
||||
adapterDescription2 = Adapter Description (GPU #2)
|
||||
adapterVendorID2 = Vendor ID (GPU #2)
|
||||
adapterDeviceID2 = Device ID (GPU #2)
|
||||
adapterDrivers2 = Adapter Drivers (GPU #2)
|
||||
adapterRAM2 = Adapter RAM (GPU #2)
|
||||
driverVersion2 = Driver Version (GPU #2)
|
||||
driverDate2 = Driver Date (GPU #2)
|
||||
isGPU2Active = GPU #2 Active
|
||||
webglRenderer = WebGL Renderer
|
||||
|
@ -51,27 +51,38 @@ interface nsIGfxInfo : nsISupports
|
||||
readonly attribute boolean AzureEnabled;
|
||||
readonly attribute DOMString DWriteVersion;
|
||||
readonly attribute DOMString cleartypeParameters;
|
||||
|
||||
|
||||
// XXX: Switch to a list of devices, rather than explicitly numbering them.
|
||||
|
||||
/**
|
||||
* The name of the display adapter.
|
||||
*/
|
||||
readonly attribute DOMString adapterDescription;
|
||||
readonly attribute DOMString adapterDescription2;
|
||||
|
||||
readonly attribute DOMString adapterDriver;
|
||||
readonly attribute DOMString adapterDriver2;
|
||||
|
||||
/* These types are inspired by DXGI_ADAPTER_DESC */
|
||||
readonly attribute unsigned long adapterVendorID;
|
||||
readonly attribute unsigned long adapterVendorID2;
|
||||
|
||||
readonly attribute unsigned long adapterDeviceID;
|
||||
|
||||
readonly attribute unsigned long adapterDeviceID2;
|
||||
|
||||
/**
|
||||
* The amount of RAM in MB in the display adapter.
|
||||
*/
|
||||
readonly attribute DOMString adapterRAM;
|
||||
readonly attribute DOMString adapterRAM2;
|
||||
|
||||
readonly attribute DOMString adapterDriverVersion;
|
||||
readonly attribute DOMString adapterDriverVersion2;
|
||||
|
||||
readonly attribute DOMString adapterDriverDate;
|
||||
readonly attribute DOMString adapterDriverDate2;
|
||||
|
||||
readonly attribute boolean isGPU2Active;
|
||||
|
||||
void getFailures(
|
||||
[optional] out unsigned long failureCount,
|
||||
|
@ -111,6 +111,13 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
@ -119,6 +126,13 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
@ -127,6 +141,13 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
@ -135,6 +156,13 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
@ -143,6 +171,13 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
@ -151,6 +186,13 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
@ -159,6 +201,20 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
GfxInfo::AddCrashReportAnnotations()
|
||||
{
|
||||
|
@ -64,6 +64,14 @@ public:
|
||||
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(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);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
@ -64,6 +64,14 @@ public:
|
||||
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(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);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
@ -134,6 +134,13 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
@ -142,6 +149,13 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
@ -150,6 +164,13 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
@ -158,6 +179,13 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
@ -166,6 +194,13 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
@ -174,6 +209,13 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
@ -182,6 +224,20 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
GfxInfo::AddCrashReportAnnotations()
|
||||
{
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <setupapi.h>
|
||||
#include "d3d9.h"
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "GfxInfo.h"
|
||||
#include "GfxInfoWebGL.h"
|
||||
@ -77,7 +78,11 @@ static const PRUint32 vendorATI = 0x1002;
|
||||
GfxInfo::GfxInfo()
|
||||
: mAdapterVendorID(0),
|
||||
mAdapterDeviceID(0),
|
||||
mWindowsVersion(0)
|
||||
mAdapterVendorID2(0),
|
||||
mAdapterDeviceID2(0),
|
||||
mWindowsVersion(0),
|
||||
mHasDualGPU(PR_FALSE),
|
||||
mIsGPU2Active(PR_FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
@ -199,7 +204,42 @@ GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* XXX: GfxInfo doesn't handle multiple GPUs. We should try to do that. Bug #591057 */
|
||||
typedef IDirect3D9* (WINAPI*Direct3DCreate9Func) (
|
||||
UINT SDKVersion
|
||||
);
|
||||
|
||||
// XXX: Blacklisting logic doesn't use the result of this for now. Bug #628129.
|
||||
void
|
||||
GfxInfo::IdentifyActiveDevice()
|
||||
{
|
||||
|
||||
HMODULE d3d9 = LoadLibraryW(L"d3d9.dll");
|
||||
if (!d3d9) {
|
||||
NS_WARNING("Couldn't load d3d9.dll");
|
||||
return;
|
||||
}
|
||||
|
||||
Direct3DCreate9Func d3d9Create = (Direct3DCreate9Func)
|
||||
GetProcAddress(d3d9, "Direct3DCreate9");
|
||||
if (!d3d9Create) {
|
||||
NS_WARNING("Couldn't get Direct3DCreate9 function");
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<IDirect3D9> d3d9Object = dont_AddRef(d3d9Create(D3D_SDK_VERSION));;
|
||||
if (!d3d9Object) {
|
||||
NS_WARNING("Couldn't create d3d9object");
|
||||
return;
|
||||
}
|
||||
|
||||
D3DADAPTER_IDENTIFIER9 ident;
|
||||
HRESULT result = d3d9Object->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &ident);
|
||||
|
||||
if ((result == D3D_OK) &&
|
||||
(mAdapterVendorID2 == ident.VendorId) && (mAdapterDeviceID2 = ident.DeviceId)) {
|
||||
mIsGPU2Active = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static nsresult GetKeyValue(const WCHAR* keyLocation, const WCHAR* keyName, nsAString& destString, int type)
|
||||
{
|
||||
@ -409,7 +449,40 @@ GfxInfo::Init()
|
||||
result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverDate = value;
|
||||
RegCloseKey(key);
|
||||
RegCloseKey(key);
|
||||
|
||||
// Check for second adapter:
|
||||
//
|
||||
// A second adapter will have the same driver key as the first adapter except for
|
||||
// the last character, where '1' will be swapped for '0' or vice-versa.
|
||||
// We know driverKey.Length() > 0 since driverKeyPre is a prefix of driverKey.
|
||||
if (driverKey[driverKey.Length()-1] == '0') {
|
||||
driverKey.SetCharAt('1', driverKey.Length()-1);
|
||||
} else {
|
||||
driverKey.SetCharAt('0', driverKey.Length()-1);
|
||||
}
|
||||
result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.BeginReading(), 0, KEY_QUERY_VALUE, &key);
|
||||
if (result == ERROR_SUCCESS) {
|
||||
mHasDualGPU = PR_TRUE;
|
||||
mDeviceKey2 = driverKey;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"DriverVersion", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverVersion2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverDate2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"Device Description", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDeviceString2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"MatchingDeviceId", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDeviceID2 = value;
|
||||
RegCloseKey(key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -422,6 +495,47 @@ GfxInfo::Init()
|
||||
FreeLibrary(setupapi);
|
||||
}
|
||||
|
||||
nsAutoString vendor(mDeviceID);
|
||||
ToUpperCase(vendor);
|
||||
PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterVendorID = vendor.ToInteger(&err, 16);
|
||||
|
||||
vendor = mDeviceID2;
|
||||
ToUpperCase(vendor);
|
||||
start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
mAdapterVendorID2 = vendor.ToInteger(&err, 16);
|
||||
|
||||
nsAutoString device(mDeviceID);
|
||||
ToUpperCase(device);
|
||||
start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
mAdapterDeviceID = device.ToInteger(&err, 16);
|
||||
|
||||
device = mDeviceID2;
|
||||
ToUpperCase(device);
|
||||
start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
mAdapterDeviceID2 = device.ToInteger(&err, 16);
|
||||
|
||||
if (mHasDualGPU) {
|
||||
IdentifyActiveDevice();
|
||||
}
|
||||
|
||||
const char *spoofedDriverVersionString = PR_GetEnv("MOZ_GFX_SPOOF_DRIVER_VERSION");
|
||||
if (spoofedDriverVersionString) {
|
||||
mDriverVersion.AssignASCII(spoofedDriverVersionString);
|
||||
@ -430,16 +544,6 @@ GfxInfo::Init()
|
||||
const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_VENDOR_ID");
|
||||
if (spoofedVendor) {
|
||||
PR_sscanf(spoofedVendor, "%x", &mAdapterVendorID);
|
||||
} else {
|
||||
nsAutoString vendor(mDeviceID);
|
||||
ToUpperCase(vendor);
|
||||
PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterVendorID = vendor.ToInteger(&err, 16);
|
||||
}
|
||||
|
||||
mHasDriverVersionMismatch = PR_FALSE;
|
||||
@ -468,16 +572,6 @@ GfxInfo::Init()
|
||||
const char *spoofedDevice = PR_GetEnv("MOZ_GFX_SPOOF_DEVICE_ID");
|
||||
if (spoofedDevice) {
|
||||
PR_sscanf(spoofedDevice, "%x", &mAdapterDeviceID);
|
||||
} else {
|
||||
nsAutoString device(mDeviceID);
|
||||
ToUpperCase(device);
|
||||
PRInt32 start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterDeviceID = device.ToInteger(&err, 16);
|
||||
}
|
||||
|
||||
const char *spoofedWindowsVersion = PR_GetEnv("MOZ_GFX_SPOOF_WINDOWS_VERSION");
|
||||
@ -500,6 +594,14 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
aAdapterDescription = mDeviceString2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
@ -509,6 +611,15 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"HardwareInformation.MemorySize", aAdapterRAM, REG_DWORD)))
|
||||
aAdapterRAM = L"Unknown";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
@ -518,6 +629,15 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"InstalledDisplayDrivers", aAdapterDriver, REG_MULTI_SZ)))
|
||||
aAdapterDriver = L"Unknown";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
@ -534,6 +654,22 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
aAdapterDriverVersion = mDriverVersion2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
aAdapterDriverDate = mDriverDate2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
@ -542,6 +678,14 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
*aAdapterVendorID = mAdapterVendorID2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
@ -550,6 +694,22 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
*aAdapterDeviceID = mAdapterDeviceID2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
*aIsGPU2Active = mIsGPU2Active;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if defined(MOZ_CRASHREPORTER)
|
||||
/* Cisco's VPN software can cause corruption of the floating point state.
|
||||
* Make a note of this in our crash reports so that some weird crashes
|
||||
@ -607,6 +767,19 @@ GfxInfo::AddCrashReportAnnotations()
|
||||
}
|
||||
note.Append("\n");
|
||||
|
||||
if (mHasDualGPU) {
|
||||
PRUint32 deviceID2, vendorID2;
|
||||
nsAutoString adapterDriverVersionString2;
|
||||
|
||||
note.Append("Has dual GPUs. GPU #2: ");
|
||||
GetAdapterDeviceID2(&deviceID2);
|
||||
GetAdapterVendorID2(&vendorID2);
|
||||
GetAdapterDriverVersion2(adapterDriverVersionString2);
|
||||
note.AppendPrintf("AdapterVendorID2: %04x, ", vendorID2);
|
||||
note.AppendPrintf("AdapterDeviceID2: %04x, ", deviceID2);
|
||||
note.AppendPrintf("AdapterDriverVersion2: ");
|
||||
note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
|
||||
}
|
||||
CrashReporter::AppendAppNotesToCrashReport(note);
|
||||
|
||||
#endif
|
||||
|
@ -68,6 +68,14 @@ public:
|
||||
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(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);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
@ -86,6 +94,7 @@ protected:
|
||||
private:
|
||||
|
||||
void AddCrashReportAnnotations();
|
||||
void IdentifyActiveDevice();
|
||||
nsString mDeviceString;
|
||||
nsString mDeviceID;
|
||||
nsString mDriverVersion;
|
||||
@ -94,7 +103,16 @@ private:
|
||||
nsString mDeviceKeyDebug;
|
||||
PRUint32 mAdapterVendorID;
|
||||
PRUint32 mAdapterDeviceID;
|
||||
nsString mDeviceString2;
|
||||
nsString mDriverVersion2;
|
||||
nsString mDeviceID2;
|
||||
nsString mDriverDate2;
|
||||
nsString mDeviceKey2;
|
||||
PRUint32 mAdapterVendorID2;
|
||||
PRUint32 mAdapterDeviceID2;
|
||||
PRUint32 mWindowsVersion;
|
||||
PRBool mHasDualGPU;
|
||||
PRBool mIsGPU2Active;
|
||||
PRBool mHasDriverVersionMismatch;
|
||||
};
|
||||
|
||||
|
@ -343,6 +343,13 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
@ -351,6 +358,13 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
@ -359,6 +373,13 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
@ -368,6 +389,13 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
@ -376,6 +404,13 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
@ -384,6 +419,13 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
@ -392,6 +434,20 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace widget
|
||||
} // end namespace mozilla
|
||||
|
@ -63,6 +63,14 @@ public:
|
||||
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(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);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
Loading…
Reference in New Issue
Block a user