Files
palemoon27/widget/GfxDriverInfo.cpp
T
roytam1 f579c98b65 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1195755: Don't assert recursion depth sanity on Mac, because there is none. r=me (e25096acc1)
- Bug 1217940 - remove BindingUtils.h from CycleCollectedJSRuntime.cpp; r=mccr8 (012fad0b80)
- Bug 1118285 - The browser.newtab.url preference is abused and should be removed. (ca573649c6)
- Bug 1209591 - allow loadURI consumers to expose whether an error page was immediately loaded as result of an error, r=smaug,mak (c033d86f07)
- Bug 1167132 - Part 14: [NetworkManager] Move network information into a separate interface (NetStats). r=ethan (87acc048cc)
- Bug 1167132 - Part 15: [NetworkManager] Move network information into a separate interface (NetworkInterfaceList). r=echen (a2a96e481e)
- Bug 1205240 - Add JSON Validation code in order to prevent invalid file. r=seanlin (8c7261ba8c)
- Bug 1215429 - Add import statement in order to access file object in chrome code of TVSimulatorService. r=seanlin (5ba9e78581)
- Bug 1217093 - Remove for-each from dom/. r=smaug (5af3efbd62)
- var-let (576b2489ec)
- Bug 1183440 - Replaces Promise.defer() with the Promise constructor in push tests. r=kitcambridge (16dfaa59b3)
- Bug 1191453 - Drop subscriptions for a site when the user revokes push permissions. r=mt,MattN (5edd10e5ad)
- Bug 1159641, Part 1 - Skip the permission check in `pushManager.getSubscription()`. r=mt (d399c496d7)
- Bug 1159641, Part 2 - Use tasks in the Push permissions test. r=mt (132484c355)
- Bug 1206302 - Use DOMException for Push errors. r=mt (5a675714fa)
- Bug 1193365 - Disable push debug. r=kitcambridge (1dc20e69b0)
- Bug 1219063, Part 1 - Use transactions for updating Push subscription permissions. r=mt (8c28453942)
- Bug 1219063, Part 2 - Remove obsolete "push" permission. r=mt (84a36931cd)
- Bug 1217065 - Unconditionally ack incoming updates. r=dragana,benbangert (e0bfa4454f)
- Bug 1212593 - Fix PushService behavior when we are switching between push servers. r=kcambridge (0afa39e743)
- Bug 1206163 - Retry failed register requests on reconnect. r=dragana (6ed1258b15)
- Bug 1218591 - Reset the WebSocket retry counter when the server replies. r=dragana (64e800db60)
- Bug 1210943 - Drop subscriptions unconditionally if the UAID changes. r=benbangert (52f538a7de)
- Bug 1214366 - Part 1: Don't preprocess PushServiceWebSocket.jsm. r=kitcambridge (a78b9fc838)
- Bug 1214366 - Part 3: Use getLastVisited equivalent in PushService.jsm. r=kitcambridge,rnewman (bc7004ad32)
- Bug 1210896, Part 1 - Use Console.jsm to log Push errors. r=mt (04335cc37f)
- Bug 1216683 - For the WebSocket version unregister should return true even if we are offline. r=kitcambridge (0f6e397a03)
- Bug 1210896, Part 2 - Use JS errors to reject internal Push promises. r=mt (3546b2f7c8)
- Bug 1223481 - Use the "potentially trustworthy origin" helper to validate Push server URLs. r=dragana (0c21f551f3)
- Bug 1223202 - Only send subscription change events if the Push permission is granted. r=mt (afeaf0dceb)
- Bug 1201128 - Don't send channel IDs in the Push handshake. r=nsm (dbbadb5c16)
- var-let (a35cb6aeca)
- Bug 1210211 - Part 1: Delay updating push quota. r=kitcambridge (53f5735ff0)
- Bug 1210211 - Part 2: Notify Push service of visible notifications. r=baku (9182bcb7d1)
- Bug 1170115 - Use clear-origin-data to remove Push records. r=allstars.chh (47f1070bab)
- Bug 1211418 - Part 1: Ensure Data Consistency after Collision of SMS Segment. r=echen. (f2d5221984)
- Bug 1211418 - Part 2: Add Test Coverage for the Collision of SMS Segment. r=echen. (06f7ba7308)
- Bug 1159132 - Part 1: Use dun apn only when config ro.tethering.dun_required is set. r=echen (bbb4fd2798)
- Bug 1159132 - Part 2: Set ro.tethering.dun_required when running dun test case. r=echen (11fe9344be)
- Bug 1187262 - Let the flag 'Services.io.offline' reference the state of tethering. r=jjong (ee22fd9358)
- Bug 1148671 - ipv6 and dual stack support on Lollipop. r=hchang (a9f7dc570e)
- Bug 1173671 - just warn if we fail to remove old default routes. r=echen (b4ab24da9f)
- Bug 1175817 - [NetworkManager] remove old default routes explicitly. r=echen,smaug (3f9a0b98ab)
- Bug 1174998 - Part 1: add setMtu() support in NetworkService. r=echen,smaug (9621036470)
- Bug 1174998 - Part 2: Set MTU for connected network interfaces. r=echen (397c898942)
- Bug 1197667 - [NetworkManager] Part 1: add missing implementation for 'allNetworkInfo'. r=echen (a49fd3498b)
- Bug 1197667 - [NetworkManager] Part 2: add test case for 'allNetworkInfo'. r=echen (942a52b0d4)
- Bug 1057091 - Add USB tethring command supporting IPv6 outgoing interface. r=hchang (9210eb5a1d)
- Bug 1177236 - Usage alert doesn't work when tethering is enabled. r=ethan (4bdd8ae226)
- Bug 1168938 - Memory safety bug in NetworkUtils::postTetherInterfaceList. r=fabrice (97485ac95c)
- Bug 1138757 - Part 1: Fix the logic of checking invalid port in CDMA WAP Push. r=echen (68dac00e52)
- Bug 1138757 - Part 2: Add Test Coverage for CDMA Wap Push. r=echen (9d54278aa9)
- Bug 1209891 - Do Not Reply Read-Report if a MMS Message Was Marked from Unread to Read Multiple Times. r=echen (421550db06)
- var-let (2ed380bb64)
- bug 1175005: performance regression. backout_f081c464c1e2 (28e1ee74b9)
- Bug 1207665 - Block Intel GMA 3150 for d3d11/d2d on all drivers. (bug 1207665 part 1, r=jrmuizel). r=jrmuizel (bb8eac6fa8)
- Bug 1188105: Parse bad driver versions. r=botond (8c856cac36)
- Bug 1075089 - Move popup menu frame offset to LookAndFeel and fix default offset for OS X. r=Enn (e1f7d0c418)
- Bug 1134385. Delete main thread assertion in CompositorVsyncDispatcher. r=kats (0945e91185)
- some profiler stuff (d3d68abdad)
- Bug 1156283 - Avoid shutdown observer race when shutting down gfx on Mac. r=roc (f66195546b)
2023-01-21 00:07:37 +08:00

315 lines
11 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "GfxDriverInfo.h"
#include "nsIGfxInfo.h"
#include "nsTArray.h"
using namespace mozilla::widget;
int32_t GfxDriverInfo::allFeatures = 0;
uint64_t GfxDriverInfo::allDriverVersions = ~(uint64_t(0));
GfxDeviceFamily* const GfxDriverInfo::allDevices = nullptr;
GfxDeviceFamily* GfxDriverInfo::mDeviceFamilies[DeviceFamilyMax];
nsAString* GfxDriverInfo::mDeviceVendors[DeviceVendorMax];
GfxDriverInfo::GfxDriverInfo()
: mOperatingSystem(DRIVER_OS_UNKNOWN),
mOperatingSystemVersion(0),
mAdapterVendor(GfxDriverInfo::GetDeviceVendor(VendorAll)),
mDevices(allDevices),
mDeleteDevices(false),
mFeature(allFeatures),
mFeatureStatus(nsIGfxInfo::FEATURE_STATUS_OK),
mComparisonOp(DRIVER_COMPARISON_IGNORED),
mDriverVersion(0),
mDriverVersionMax(0),
mSuggestedVersion(nullptr),
mGpu2(false)
{}
GfxDriverInfo::GfxDriverInfo(OperatingSystem os, nsAString& vendor,
GfxDeviceFamily* devices,
int32_t feature, int32_t featureStatus,
VersionComparisonOp op,
uint64_t driverVersion,
const char *suggestedVersion /* = nullptr */,
bool ownDevices /* = false */,
bool gpu2 /* = false */)
: mOperatingSystem(os),
mOperatingSystemVersion(0),
mAdapterVendor(vendor),
mDevices(devices),
mDeleteDevices(ownDevices),
mFeature(feature),
mFeatureStatus(featureStatus),
mComparisonOp(op),
mDriverVersion(driverVersion),
mDriverVersionMax(0),
mSuggestedVersion(suggestedVersion),
mGpu2(gpu2)
{}
GfxDriverInfo::GfxDriverInfo(const GfxDriverInfo& aOrig)
: mOperatingSystem(aOrig.mOperatingSystem),
mOperatingSystemVersion(aOrig.mOperatingSystemVersion),
mAdapterVendor(aOrig.mAdapterVendor),
mFeature(aOrig.mFeature),
mFeatureStatus(aOrig.mFeatureStatus),
mComparisonOp(aOrig.mComparisonOp),
mDriverVersion(aOrig.mDriverVersion),
mDriverVersionMax(aOrig.mDriverVersionMax),
mSuggestedVersion(aOrig.mSuggestedVersion),
mGpu2(aOrig.mGpu2)
{
// 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;
} else {
mDevices = aOrig.mDevices;
}
mDeleteDevices = aOrig.mDeleteDevices;
}
GfxDriverInfo::~GfxDriverInfo()
{
if (mDeleteDevices)
delete mDevices;
}
// 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)
{
// 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];
switch (id) {
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 */
break;
case IntelHDGraphicsToIvyBridge:
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;
case IntelHD3000:
APPEND_DEVICE(0x0126);
break;
case IntelMobileHDGraphics:
APPEND_DEVICE(0x0046); /* IntelMobileHDGraphics */
break;
case NvidiaBlockD3D9Layers:
// Glitches whilst scrolling (see bugs 612007, 644787, 645872)
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;
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;
case Nvidia310M:
APPEND_DEVICE(0x0A70);
break;
case Nvidia8800GTS:
APPEND_DEVICE(0x0193);
break;
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);
APPEND_DEVICE(0x0dd2);
APPEND_DEVICE(0x0dd3);
// 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);
APPEND_DEVICE(0x1050);
APPEND_DEVICE(0x1051);
APPEND_DEVICE(0x1052);
APPEND_DEVICE(0x1054);
APPEND_DEVICE(0x1055);
break;
case Bug1116812:
APPEND_DEVICE(0x2e32);
APPEND_DEVICE(0x2a02);
break;
case Bug1155608:
APPEND_DEVICE(0x2e22); /* IntelG45_1 */
break;
case Bug1207665:
APPEND_DEVICE(0xa001); /* Intel Media Accelerator 3150 */
APPEND_DEVICE(0xa002);
APPEND_DEVICE(0xa011);
APPEND_DEVICE(0xa012);
break;
case AMDRadeonHD5800:
APPEND_DEVICE(0x6899);
break;
// 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");
DECLARE_VENDOR_ID(VendorMicrosoft, "0x1414");
// Suppress a warning.
DECLARE_VENDOR_ID(DeviceVendorMax, "");
}
return *mDeviceVendors[id];
}