2011-01-20 01:21:07 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-01-20 01:21:07 +00:00
|
|
|
|
|
|
|
#include "GfxDriverInfo.h"
|
2013-03-17 07:55:16 +00:00
|
|
|
|
2011-01-20 01:33:51 +00:00
|
|
|
#include "nsIGfxInfo.h"
|
2013-03-17 07:55:16 +00:00
|
|
|
#include "nsTArray.h"
|
2011-01-20 01:21:07 +00:00
|
|
|
|
2011-01-20 01:33:51 +00:00
|
|
|
using namespace mozilla::widget;
|
2011-01-20 01:21:07 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t GfxDriverInfo::allFeatures = 0;
|
|
|
|
uint64_t GfxDriverInfo::allDriverVersions = ~(uint64_t(0));
|
2012-07-30 14:20:58 +00:00
|
|
|
GfxDeviceFamily* const GfxDriverInfo::allDevices = nullptr;
|
2011-11-03 14:50:40 +00:00
|
|
|
|
2011-12-15 05:03:01 +00:00
|
|
|
GfxDeviceFamily* GfxDriverInfo::mDeviceFamilies[DeviceFamilyMax];
|
|
|
|
nsAString* GfxDriverInfo::mDeviceVendors[DeviceVendorMax];
|
2011-01-20 01:21:07 +00:00
|
|
|
|
2011-01-20 01:33:51 +00:00
|
|
|
GfxDriverInfo::GfxDriverInfo()
|
|
|
|
: mOperatingSystem(DRIVER_OS_UNKNOWN),
|
2012-11-01 21:13:10 +00:00
|
|
|
mOperatingSystemVersion(0),
|
2011-12-15 05:03:01 +00:00
|
|
|
mAdapterVendor(GfxDriverInfo::GetDeviceVendor(VendorAll)),
|
2011-01-20 01:33:51 +00:00
|
|
|
mDevices(allDevices),
|
|
|
|
mDeleteDevices(false),
|
|
|
|
mFeature(allFeatures),
|
2014-07-01 21:44:09 +00:00
|
|
|
mFeatureStatus(nsIGfxInfo::FEATURE_STATUS_OK),
|
2012-05-04 19:33:59 +00:00
|
|
|
mComparisonOp(DRIVER_COMPARISON_IGNORED),
|
2011-01-20 01:33:51 +00:00
|
|
|
mDriverVersion(0),
|
2011-01-29 02:12:25 +00:00
|
|
|
mDriverVersionMax(0),
|
2015-03-21 19:37:00 +00:00
|
|
|
mSuggestedVersion(nullptr),
|
|
|
|
mGpu2(false)
|
2011-01-20 01:33:51 +00:00
|
|
|
{}
|
|
|
|
|
2011-12-15 05:03:01 +00:00
|
|
|
GfxDriverInfo::GfxDriverInfo(OperatingSystem os, nsAString& vendor,
|
|
|
|
GfxDeviceFamily* devices,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t feature, int32_t featureStatus,
|
2011-01-20 01:33:51 +00:00
|
|
|
VersionComparisonOp op,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t driverVersion,
|
2012-07-30 14:20:58 +00:00
|
|
|
const char *suggestedVersion /* = nullptr */,
|
2015-03-21 19:37:00 +00:00
|
|
|
bool ownDevices /* = false */,
|
|
|
|
bool gpu2 /* = false */)
|
2011-01-20 01:33:51 +00:00
|
|
|
: mOperatingSystem(os),
|
2012-11-01 21:13:10 +00:00
|
|
|
mOperatingSystemVersion(0),
|
2011-01-20 01:33:51 +00:00
|
|
|
mAdapterVendor(vendor),
|
|
|
|
mDevices(devices),
|
|
|
|
mDeleteDevices(ownDevices),
|
|
|
|
mFeature(feature),
|
|
|
|
mFeatureStatus(featureStatus),
|
|
|
|
mComparisonOp(op),
|
|
|
|
mDriverVersion(driverVersion),
|
2011-01-29 02:12:25 +00:00
|
|
|
mDriverVersionMax(0),
|
2015-03-21 19:37:00 +00:00
|
|
|
mSuggestedVersion(suggestedVersion),
|
|
|
|
mGpu2(gpu2)
|
2011-01-20 01:33:51 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
GfxDriverInfo::GfxDriverInfo(const GfxDriverInfo& aOrig)
|
|
|
|
: mOperatingSystem(aOrig.mOperatingSystem),
|
2012-11-01 21:13:10 +00:00
|
|
|
mOperatingSystemVersion(aOrig.mOperatingSystemVersion),
|
2011-01-20 01:33:51 +00:00
|
|
|
mAdapterVendor(aOrig.mAdapterVendor),
|
|
|
|
mFeature(aOrig.mFeature),
|
|
|
|
mFeatureStatus(aOrig.mFeatureStatus),
|
|
|
|
mComparisonOp(aOrig.mComparisonOp),
|
|
|
|
mDriverVersion(aOrig.mDriverVersion),
|
2011-01-29 02:12:25 +00:00
|
|
|
mDriverVersionMax(aOrig.mDriverVersionMax),
|
2015-03-21 19:37:00 +00:00
|
|
|
mSuggestedVersion(aOrig.mSuggestedVersion),
|
|
|
|
mGpu2(aOrig.mGpu2)
|
2011-01-20 01:33:51 +00:00
|
|
|
{
|
2011-12-15 05:03:01 +00:00
|
|
|
// If we're managing the lifetime of the device family, we have to make a
|
|
|
|
// copy of the original's device family.
|
|
|
|
if (aOrig.mDeleteDevices && aOrig.mDevices) {
|
|
|
|
mDevices = new GfxDeviceFamily;
|
|
|
|
*mDevices = *aOrig.mDevices;
|
2011-01-20 01:33:51 +00:00
|
|
|
} else {
|
|
|
|
mDevices = aOrig.mDevices;
|
|
|
|
}
|
|
|
|
|
|
|
|
mDeleteDevices = aOrig.mDeleteDevices;
|
|
|
|
}
|
|
|
|
|
|
|
|
GfxDriverInfo::~GfxDriverInfo()
|
|
|
|
{
|
|
|
|
if (mDeleteDevices)
|
2011-12-15 05:03:01 +00:00
|
|
|
delete mDevices;
|
2011-01-20 01:33:51 +00:00
|
|
|
}
|
2011-12-15 05:02:59 +00:00
|
|
|
|
2011-12-15 05:03:01 +00:00
|
|
|
// Macros for appending a device to the DeviceFamily.
|
|
|
|
#define APPEND_DEVICE(device) APPEND_DEVICE2(#device)
|
|
|
|
#define APPEND_DEVICE2(device) deviceFamily->AppendElement(NS_LITERAL_STRING(device))
|
|
|
|
|
|
|
|
const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id)
|
2011-12-15 05:02:59 +00:00
|
|
|
{
|
2011-12-15 05:03:01 +00:00
|
|
|
// The code here is too sensitive to fall through to the default case if the
|
|
|
|
// code is invalid.
|
|
|
|
NS_ASSERTION(id >= 0 && id < DeviceFamilyMax, "DeviceFamily id is out of range");
|
|
|
|
|
|
|
|
// If it already exists, we must have processed it once, so return it now.
|
|
|
|
if (mDeviceFamilies[id])
|
|
|
|
return mDeviceFamilies[id];
|
|
|
|
|
|
|
|
mDeviceFamilies[id] = new GfxDeviceFamily;
|
|
|
|
GfxDeviceFamily* deviceFamily = mDeviceFamilies[id];
|
|
|
|
|
2011-12-15 05:02:59 +00:00
|
|
|
switch (id) {
|
2011-12-15 05:03:01 +00:00
|
|
|
case IntelGMA500:
|
|
|
|
APPEND_DEVICE(0x8108); /* IntelGMA500_1 */
|
|
|
|
APPEND_DEVICE(0x8109); /* IntelGMA500_2 */
|
|
|
|
break;
|
|
|
|
case IntelGMA900:
|
|
|
|
APPEND_DEVICE(0x2582); /* IntelGMA900_1 */
|
|
|
|
APPEND_DEVICE(0x2782); /* IntelGMA900_2 */
|
|
|
|
APPEND_DEVICE(0x2592); /* IntelGMA900_3 */
|
|
|
|
APPEND_DEVICE(0x2792); /* IntelGMA900_4 */
|
|
|
|
break;
|
|
|
|
case IntelGMA950:
|
|
|
|
APPEND_DEVICE(0x2772); /* Intel945G_1 */
|
|
|
|
APPEND_DEVICE(0x2776); /* Intel945G_2 */
|
|
|
|
APPEND_DEVICE(0x27a2); /* Intel945_1 */
|
|
|
|
APPEND_DEVICE(0x27a6); /* Intel945_2 */
|
|
|
|
APPEND_DEVICE(0x27ae); /* Intel945_3 */
|
|
|
|
break;
|
|
|
|
case IntelGMA3150:
|
|
|
|
APPEND_DEVICE(0xa001); /* IntelGMA3150_Nettop_1 */
|
|
|
|
APPEND_DEVICE(0xa002); /* IntelGMA3150_Nettop_2 */
|
|
|
|
APPEND_DEVICE(0xa011); /* IntelGMA3150_Netbook_1 */
|
|
|
|
APPEND_DEVICE(0xa012); /* IntelGMA3150_Netbook_2 */
|
|
|
|
break;
|
|
|
|
case IntelGMAX3000:
|
|
|
|
APPEND_DEVICE(0x2972); /* Intel946GZ_1 */
|
|
|
|
APPEND_DEVICE(0x2973); /* Intel946GZ_2 */
|
|
|
|
APPEND_DEVICE(0x2982); /* IntelG35_1 */
|
|
|
|
APPEND_DEVICE(0x2983); /* IntelG35_2 */
|
|
|
|
APPEND_DEVICE(0x2992); /* IntelQ965_1 */
|
|
|
|
APPEND_DEVICE(0x2993); /* IntelQ965_2 */
|
|
|
|
APPEND_DEVICE(0x29a2); /* IntelG965_1 */
|
|
|
|
APPEND_DEVICE(0x29a3); /* IntelG965_2 */
|
|
|
|
APPEND_DEVICE(0x29b2); /* IntelQ35_1 */
|
|
|
|
APPEND_DEVICE(0x29b3); /* IntelQ35_2 */
|
|
|
|
APPEND_DEVICE(0x29c2); /* IntelG33_1 */
|
|
|
|
APPEND_DEVICE(0x29c3); /* IntelG33_2 */
|
|
|
|
APPEND_DEVICE(0x29d2); /* IntelQ33_1 */
|
|
|
|
APPEND_DEVICE(0x29d3); /* IntelQ33_2 */
|
|
|
|
APPEND_DEVICE(0x2a02); /* IntelGL960_1 */
|
|
|
|
APPEND_DEVICE(0x2a03); /* IntelGL960_2 */
|
|
|
|
APPEND_DEVICE(0x2a12); /* IntelGM965_1 */
|
|
|
|
APPEND_DEVICE(0x2a13); /* IntelGM965_2 */
|
|
|
|
break;
|
|
|
|
case IntelGMAX4500HD:
|
|
|
|
APPEND_DEVICE(0x2a42); /* IntelGMA4500MHD_1 */
|
|
|
|
APPEND_DEVICE(0x2a43); /* IntelGMA4500MHD_2 */
|
|
|
|
APPEND_DEVICE(0x2e42); /* IntelB43_1 */
|
|
|
|
APPEND_DEVICE(0x2e43); /* IntelB43_2 */
|
|
|
|
APPEND_DEVICE(0x2e92); /* IntelB43_3 */
|
|
|
|
APPEND_DEVICE(0x2e93); /* IntelB43_4 */
|
|
|
|
APPEND_DEVICE(0x2e32); /* IntelG41_1 */
|
|
|
|
APPEND_DEVICE(0x2e33); /* IntelG41_2 */
|
|
|
|
APPEND_DEVICE(0x2e22); /* IntelG45_1 */
|
|
|
|
APPEND_DEVICE(0x2e23); /* IntelG45_2 */
|
|
|
|
APPEND_DEVICE(0x2e12); /* IntelQ45_1 */
|
|
|
|
APPEND_DEVICE(0x2e13); /* IntelQ45_2 */
|
2015-07-21 22:04:48 +00:00
|
|
|
break;
|
|
|
|
case IntelHDGraphicsToIvyBridge:
|
2011-12-15 05:03:01 +00:00
|
|
|
APPEND_DEVICE(0x0042); /* IntelHDGraphics */
|
|
|
|
APPEND_DEVICE(0x0046); /* IntelMobileHDGraphics */
|
|
|
|
APPEND_DEVICE(0x0102); /* IntelSandyBridge_1 */
|
|
|
|
APPEND_DEVICE(0x0106); /* IntelSandyBridge_2 */
|
|
|
|
APPEND_DEVICE(0x0112); /* IntelSandyBridge_3 */
|
|
|
|
APPEND_DEVICE(0x0116); /* IntelSandyBridge_4 */
|
|
|
|
APPEND_DEVICE(0x0122); /* IntelSandyBridge_5 */
|
|
|
|
APPEND_DEVICE(0x0126); /* IntelSandyBridge_6 */
|
|
|
|
APPEND_DEVICE(0x010a); /* IntelSandyBridge_7 */
|
|
|
|
APPEND_DEVICE(0x0080); /* IntelIvyBridge */
|
|
|
|
break;
|
2014-08-01 05:59:36 +00:00
|
|
|
case IntelHD3000:
|
|
|
|
APPEND_DEVICE(0x0126);
|
|
|
|
break;
|
2013-03-12 19:40:29 +00:00
|
|
|
case IntelMobileHDGraphics:
|
|
|
|
APPEND_DEVICE(0x0046); /* IntelMobileHDGraphics */
|
|
|
|
break;
|
2011-12-15 05:03:01 +00:00
|
|
|
case NvidiaBlockD3D9Layers:
|
2011-12-15 05:02:59 +00:00
|
|
|
// Glitches whilst scrolling (see bugs 612007, 644787, 645872)
|
2011-12-15 05:03:01 +00:00
|
|
|
APPEND_DEVICE(0x00f3); /* NV43 [GeForce 6200 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0146); /* NV43 [Geforce Go 6600TE/6200TE (TM)] */
|
|
|
|
APPEND_DEVICE(0x014f); /* NV43 [GeForce 6200 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0161); /* NV44 [GeForce 6200 TurboCache (TM)] */
|
|
|
|
APPEND_DEVICE(0x0162); /* NV44 [GeForce 6200SE TurboCache (TM)] */
|
|
|
|
APPEND_DEVICE(0x0163); /* NV44 [GeForce 6200 LE (TM)] */
|
|
|
|
APPEND_DEVICE(0x0164); /* NV44 [GeForce Go 6200 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0167); /* NV43 [GeForce Go 6200/6400 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0168); /* NV43 [GeForce Go 6200/6400 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0169); /* NV44 [GeForce 6250 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0222); /* NV44 [GeForce 6200 A-LE (TM)] */
|
|
|
|
APPEND_DEVICE(0x0240); /* C51PV [GeForce 6150 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0241); /* C51 [GeForce 6150 LE (TM)] */
|
|
|
|
APPEND_DEVICE(0x0244); /* C51 [Geforce Go 6150 (TM)] */
|
|
|
|
APPEND_DEVICE(0x0245); /* C51 [Quadro NVS 210S/GeForce 6150LE (TM)] */
|
|
|
|
APPEND_DEVICE(0x0247); /* C51 [GeForce Go 6100 (TM)] */
|
|
|
|
APPEND_DEVICE(0x03d0); /* C61 [GeForce 6150SE nForce 430 (TM)] */
|
|
|
|
APPEND_DEVICE(0x03d1); /* C61 [GeForce 6100 nForce 405 (TM)] */
|
|
|
|
APPEND_DEVICE(0x03d2); /* C61 [GeForce 6100 nForce 400 (TM)] */
|
|
|
|
APPEND_DEVICE(0x03d5); /* C61 [GeForce 6100 nForce 420 (TM)] */
|
|
|
|
break;
|
2011-12-15 05:03:06 +00:00
|
|
|
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;
|
2014-08-13 04:25:13 +00:00
|
|
|
case Nvidia310M:
|
|
|
|
APPEND_DEVICE(0x0A70);
|
|
|
|
break;
|
2015-04-17 00:41:37 +00:00
|
|
|
case Nvidia8800GTS:
|
|
|
|
APPEND_DEVICE(0x0193);
|
|
|
|
break;
|
2015-03-21 19:37:00 +00:00
|
|
|
case Bug1137716:
|
|
|
|
APPEND_DEVICE(0x0a29);
|
|
|
|
APPEND_DEVICE(0x0a2b);
|
|
|
|
APPEND_DEVICE(0x0a2d);
|
|
|
|
APPEND_DEVICE(0x0a35);
|
|
|
|
APPEND_DEVICE(0x0a6c);
|
|
|
|
APPEND_DEVICE(0x0a70);
|
|
|
|
APPEND_DEVICE(0x0a72);
|
|
|
|
APPEND_DEVICE(0x0a7a);
|
|
|
|
APPEND_DEVICE(0x0caf);
|
2015-04-06 19:36:41 +00:00
|
|
|
APPEND_DEVICE(0x0dd2);
|
|
|
|
APPEND_DEVICE(0x0dd3);
|
2015-03-21 19:37:00 +00:00
|
|
|
// GF180M ids
|
|
|
|
APPEND_DEVICE(0x0de3);
|
|
|
|
APPEND_DEVICE(0x0de8);
|
|
|
|
APPEND_DEVICE(0x0de9);
|
|
|
|
APPEND_DEVICE(0x0dea);
|
|
|
|
APPEND_DEVICE(0x0deb);
|
|
|
|
APPEND_DEVICE(0x0dec);
|
|
|
|
APPEND_DEVICE(0x0ded);
|
|
|
|
APPEND_DEVICE(0x0dee);
|
|
|
|
APPEND_DEVICE(0x0def);
|
|
|
|
APPEND_DEVICE(0x0df0);
|
|
|
|
APPEND_DEVICE(0x0df1);
|
|
|
|
APPEND_DEVICE(0x0df2);
|
|
|
|
APPEND_DEVICE(0x0df3);
|
|
|
|
APPEND_DEVICE(0x0df4);
|
|
|
|
APPEND_DEVICE(0x0df5);
|
|
|
|
APPEND_DEVICE(0x0df6);
|
|
|
|
APPEND_DEVICE(0x0df7);
|
2015-04-06 19:36:41 +00:00
|
|
|
APPEND_DEVICE(0x1050);
|
|
|
|
APPEND_DEVICE(0x1051);
|
|
|
|
APPEND_DEVICE(0x1052);
|
|
|
|
APPEND_DEVICE(0x1054);
|
|
|
|
APPEND_DEVICE(0x1055);
|
2015-03-21 19:37:00 +00:00
|
|
|
break;
|
2015-03-25 23:58:48 +00:00
|
|
|
case Bug1116812:
|
|
|
|
APPEND_DEVICE(0x2e32);
|
|
|
|
APPEND_DEVICE(0x2a02);
|
|
|
|
break;
|
2015-04-29 21:49:49 +00:00
|
|
|
case Bug1155608:
|
|
|
|
APPEND_DEVICE(0x2e22); /* IntelG45_1 */
|
|
|
|
break;
|
2015-01-26 00:34:28 +00:00
|
|
|
case AMDRadeonHD5800:
|
|
|
|
APPEND_DEVICE(0x6899);
|
|
|
|
break;
|
2011-12-15 05:03:01 +00:00
|
|
|
// This should never happen, but we get a warning if we don't handle this.
|
|
|
|
case DeviceFamilyMax:
|
|
|
|
NS_WARNING("Invalid DeviceFamily id");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return deviceFamily;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Macro for assigning a device vendor id to a string.
|
|
|
|
#define DECLARE_VENDOR_ID(name, deviceId) \
|
|
|
|
case name: \
|
|
|
|
mDeviceVendors[id]->AssignLiteral(deviceId); \
|
|
|
|
break;
|
|
|
|
|
|
|
|
const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(id >= 0 && id < DeviceVendorMax, "DeviceVendor id is out of range");
|
|
|
|
|
|
|
|
if (mDeviceVendors[id])
|
|
|
|
return *mDeviceVendors[id];
|
|
|
|
|
|
|
|
mDeviceVendors[id] = new nsString();
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
DECLARE_VENDOR_ID(VendorAll, "");
|
|
|
|
DECLARE_VENDOR_ID(VendorIntel, "0x8086");
|
|
|
|
DECLARE_VENDOR_ID(VendorNVIDIA, "0x10de");
|
|
|
|
DECLARE_VENDOR_ID(VendorAMD, "0x1022");
|
|
|
|
DECLARE_VENDOR_ID(VendorATI, "0x1002");
|
2013-06-14 19:34:41 +00:00
|
|
|
DECLARE_VENDOR_ID(VendorMicrosoft, "0x1414");
|
2011-12-15 05:03:01 +00:00
|
|
|
// Suppress a warning.
|
|
|
|
DECLARE_VENDOR_ID(DeviceVendorMax, "");
|
2011-12-15 05:02:59 +00:00
|
|
|
}
|
|
|
|
|
2011-12-15 05:03:01 +00:00
|
|
|
return *mDeviceVendors[id];
|
2011-12-15 05:02:59 +00:00
|
|
|
}
|