Bug 706739: don't evaluate static blocklist or special cases when evaluating downloaded blocklist r=joe

A bug was introduced in 668004 which caused features to be preffed off while
evaluating the downloaded blocklist, even if they weren't in the list. This
shouldn't actually have any impact on the end user experience, but is definitely
not optimal.
This commit is contained in:
Doug Sherk 2011-12-14 21:03:08 -08:00
parent 674cb87172
commit 0d1edb8efe
4 changed files with 201 additions and 200 deletions

View File

@ -301,36 +301,36 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
const nsTArray<GfxDriverInfo>& aDriverInfo,
OperatingSystem* aOS /* = nsnull */)
{
PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
NS_ENSURE_ARG_POINTER(aStatus);
aSuggestedDriverVersion.SetIsVoid(true);
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
OperatingSystem os = DRIVER_OS_ANDROID;
if (aFeature == FEATURE_OPENGL_LAYERS) {
if (!mSetCrashReportAnnotations) {
AddOpenGLCrashReportAnnotations();
mSetCrashReportAnnotations = true;
}
/* The following code is an old way to whitelist devices when we're ready.
* It is staying here for reference. The best way to do this now is to add
* an entry in the list above. There is a dummy entry which will whitelist a
* device when uncommented and device/vendor IDs are inserted. It is
* preferred that we stop whitelisting and instead go to blocklisting, where
* everything is assumed to be okay as long as it's not in the blocklist. */
// nsAutoString str;
// /* Whitelist Galaxy S phones */
// if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str)) {
// if (str != NS_LITERAL_STRING("smdkc110")) {
// status = FEATURE_BLOCKED_DEVICE;
// }
// }
}
*aStatus = status;
if (aOS)
*aOS = os;
// Don't evaluate special cases when evaluating the downlaoded blocklist.
if (!aDriverInfo.Length()) {
if (aFeature == FEATURE_OPENGL_LAYERS) {
if (!mSetCrashReportAnnotations) {
AddOpenGLCrashReportAnnotations();
mSetCrashReportAnnotations = true;
}
/* The following code is an old way to whitelist devices when we're ready.
* It is staying here for reference. The best way to do this now is to add
* an entry in the list above. There is a dummy entry which will whitelist a
* device when uncommented and device/vendor IDs are inserted. It is
* preferred that we stop whitelisting and instead go to blocklisting, where
* everything is assumed to be okay as long as it's not in the blocklist. */
// nsAutoString str;
// /* Whitelist Galaxy S phones */
// if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str)) {
// if (str != NS_LITERAL_STRING("smdkc110")) {
// status = FEATURE_BLOCKED_DEVICE;
// }
// }
}
}
return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}

View File

@ -387,74 +387,72 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
OperatingSystem* aOS /* = nsnull */)
{
NS_ENSURE_ARG_POINTER(aStatus);
aSuggestedDriverVersion.SetIsVoid(true);
PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
OperatingSystem os = OSXVersionToOperatingSystem(nsToolkit::OSXVersion());
// Many WebGL issues on 10.5, especially:
// * bug 631258: WebGL shader paints using textures belonging to other processes on Mac OS 10.5
// * bug 618848: Post process shaders and texture mapping crash OS X 10.5
if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL &&
!nsToolkit::OnSnowLeopardOrLater())
{
status = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
}
// The code around the following has been moved into the global blocklist.
#if 0
// CGL reports a list of renderers, some renderers are slow (e.g. software)
// and AFAIK we can't decide which one will be used among them, so let's implement this by returning NO_INFO
// if any not-known-to-be-bad renderer is found.
// The assumption that we make here is that the system will spontaneously use the best/fastest renderer in the list.
// Note that the presence of software renderer fallbacks means that slow software rendering may be automatically
// used, which seems to be the case in bug 611292 where the user had a Intel GMA 945 card (non programmable hardware).
// Therefore we need to explicitly blacklist non-OpenGL2 hardware, which could result in a software renderer
// being used.
for (PRUint32 i = 0; i < ArrayLength(mRendererIDs); ++i) {
switch (mRendererIDs[i]) {
case kCGLRendererATIRage128ID: // non-programmable
case kCGLRendererATIRadeonID: // non-programmable
case kCGLRendererATIRageProID: // non-programmable
case kCGLRendererATIRadeon8500ID: // no OpenGL 2 support, http://en.wikipedia.org/wiki/Radeon_R200
case kCGLRendererATIRadeon9700ID: // no OpenGL 2 support, http://en.wikipedia.org/wiki/Radeon_R200
case kCGLRendererATIRadeonX1000ID: // can't render to non-power-of-two texture backed framebuffers
case kCGLRendererIntel900ID: // non-programmable
case kCGLRendererGeForce2MXID: // non-programmable
case kCGLRendererGeForce3ID: // no OpenGL 2 support,
// http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
case kCGLRendererGeForceFXID: // incomplete OpenGL 2 support with software fallbacks,
// http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
case kCGLRendererVTBladeXP2ID: // Trident DX8 chip, assuming it's not GL2 capable
case kCGLRendererMesa3DFXID: // non-programmable
case kCGLRendererGenericFloatID: // software renderer
case kCGLRendererGenericID: // software renderer
case kCGLRendererAppleSWID: // software renderer
break;
default:
if (mRendererIDs[i])
foundGoodDevice = true;
}
}
#endif
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"))) {
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
return NS_OK;
}
}
if (aOS)
*aOS = os;
*aStatus = status;
// Don't evaluate special cases when we're evaluating the downloaded blocklist.
if (!aDriverInfo.Length()) {
// Many WebGL issues on 10.5, especially:
// * bug 631258: WebGL shader paints using textures belonging to other processes on Mac OS 10.5
// * bug 618848: Post process shaders and texture mapping crash OS X 10.5
if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL &&
!nsToolkit::OnSnowLeopardOrLater()) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
return NS_OK;
}
// The code around the following has been moved into the global blocklist.
#if 0
// CGL reports a list of renderers, some renderers are slow (e.g. software)
// and AFAIK we can't decide which one will be used among them, so let's implement this by returning NO_INFO
// if any not-known-to-be-bad renderer is found.
// The assumption that we make here is that the system will spontaneously use the best/fastest renderer in the list.
// Note that the presence of software renderer fallbacks means that slow software rendering may be automatically
// used, which seems to be the case in bug 611292 where the user had a Intel GMA 945 card (non programmable hardware).
// Therefore we need to explicitly blacklist non-OpenGL2 hardware, which could result in a software renderer
// being used.
for (PRUint32 i = 0; i < ArrayLength(mRendererIDs); ++i) {
switch (mRendererIDs[i]) {
case kCGLRendererATIRage128ID: // non-programmable
case kCGLRendererATIRadeonID: // non-programmable
case kCGLRendererATIRageProID: // non-programmable
case kCGLRendererATIRadeon8500ID: // no OpenGL 2 support, http://en.wikipedia.org/wiki/Radeon_R200
case kCGLRendererATIRadeon9700ID: // no OpenGL 2 support, http://en.wikipedia.org/wiki/Radeon_R200
case kCGLRendererATIRadeonX1000ID: // can't render to non-power-of-two texture backed framebuffers
case kCGLRendererIntel900ID: // non-programmable
case kCGLRendererGeForce2MXID: // non-programmable
case kCGLRendererGeForce3ID: // no OpenGL 2 support,
// http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
case kCGLRendererGeForceFXID: // incomplete OpenGL 2 support with software fallbacks,
// http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units
case kCGLRendererVTBladeXP2ID: // Trident DX8 chip, assuming it's not GL2 capable
case kCGLRendererMesa3DFXID: // non-programmable
case kCGLRendererGenericFloatID: // software renderer
case kCGLRendererGenericID: // software renderer
case kCGLRendererAppleSWID: // software renderer
break;
default:
if (mRendererIDs[i])
foundGoodDevice = true;
}
}
#endif
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"))) {
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
return NS_OK;
}
}
}
return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}

View File

@ -940,90 +940,90 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
const nsTArray<GfxDriverInfo>& aDriverInfo,
OperatingSystem* aOS /* = nsnull */)
{
NS_ENSURE_ARG_POINTER(aStatus);
aSuggestedDriverVersion.SetIsVoid(true);
PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
nsAutoString adapterVendorID;
nsAutoString adapterDeviceID;
nsAutoString adapterDriverVersionString;
if (NS_FAILED(GetAdapterVendorID(adapterVendorID)) ||
NS_FAILED(GetAdapterDeviceID(adapterDeviceID)) ||
NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString)))
{
return NS_ERROR_FAILURE;
}
if (adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorIntel) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorAMD) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorATI) &&
// FIXME - these special hex values are currently used in xpcshell tests introduced by
// bug 625160 patch 8/8. Maybe these tests need to be adjusted now that we're only whitelisting
// intel/ati/nvidia.
!adapterVendorID.LowerCaseEqualsLiteral("0xabcd") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xdcba") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xabab") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xdcdc"))
{
*aStatus = FEATURE_BLOCKED_DEVICE;
return NS_OK;
}
PRUint64 driverVersion;
if (!ParseDriverVersion(adapterDriverVersionString, &driverVersion)) {
return NS_ERROR_FAILURE;
}
// special-case the WinXP test slaves: they have out-of-date drivers, but we still want to
// whitelist them, actually we do know that this combination of device and driver version
// works well.
if (mWindowsVersion == gfxWindowsPlatform::kWindowsXP &&
adapterVendorID == GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterDeviceID.LowerCaseEqualsLiteral("0x0861") && // GeForce 9400
driverVersion == V(6,14,11,7756))
{
*aStatus = FEATURE_NO_INFO;
return NS_OK;
}
if (aFeature == FEATURE_DIRECT3D_9_LAYERS &&
mWindowsVersion < gfxWindowsPlatform::kWindowsXP)
{
*aStatus = FEATURE_BLOCKED_OS_VERSION;
return NS_OK;
}
// ANGLE currently uses D3D10 <-> D3D9 interop, which crashes on Optimus
// machines.
if (aFeature == FEATURE_WEBGL_ANGLE &&
gfxWindowsPlatform::IsOptimus())
{
*aStatus = FEATURE_BLOCKED_DEVICE;
return NS_OK;
}
OperatingSystem os = WindowsVersionToOperatingSystem(mWindowsVersion);
// Windows Server 2003 should be just like Windows XP for present purpose, but still has a different version number.
// OTOH Windows Server 2008 R1 and R2 already have the same version numbers as Vista and Seven respectively
if (os == DRIVER_OS_WINDOWS_SERVER_2003)
os = DRIVER_OS_WINDOWS_XP;
if (mHasDriverVersionMismatch) {
if (aFeature == nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS ||
aFeature == nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS ||
aFeature == nsIGfxInfo::FEATURE_DIRECT2D)
{
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
return NS_OK;
}
}
*aStatus = status;
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
if (aOS)
*aOS = os;
// Don't evaluate special cases if we're checking the downloaded blocklist.
if (!aDriverInfo.Length()) {
nsAutoString adapterVendorID;
nsAutoString adapterDeviceID;
nsAutoString adapterDriverVersionString;
if (NS_FAILED(GetAdapterVendorID(adapterVendorID)) ||
NS_FAILED(GetAdapterDeviceID(adapterDeviceID)) ||
NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString)))
{
return NS_ERROR_FAILURE;
}
if (adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorIntel) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorAMD) &&
adapterVendorID != GfxDriverInfo::GetDeviceVendor(VendorATI) &&
// FIXME - these special hex values are currently used in xpcshell tests introduced by
// bug 625160 patch 8/8. Maybe these tests need to be adjusted now that we're only whitelisting
// intel/ati/nvidia.
!adapterVendorID.LowerCaseEqualsLiteral("0xabcd") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xdcba") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xabab") &&
!adapterVendorID.LowerCaseEqualsLiteral("0xdcdc"))
{
*aStatus = FEATURE_BLOCKED_DEVICE;
return NS_OK;
}
PRUint64 driverVersion;
if (!ParseDriverVersion(adapterDriverVersionString, &driverVersion)) {
return NS_ERROR_FAILURE;
}
// special-case the WinXP test slaves: they have out-of-date drivers, but we still want to
// whitelist them, actually we do know that this combination of device and driver version
// works well.
if (mWindowsVersion == gfxWindowsPlatform::kWindowsXP &&
adapterVendorID == GfxDriverInfo::GetDeviceVendor(VendorNVIDIA) &&
adapterDeviceID.LowerCaseEqualsLiteral("0x0861") && // GeForce 9400
driverVersion == V(6,14,11,7756))
{
*aStatus = FEATURE_NO_INFO;
return NS_OK;
}
if (aFeature == FEATURE_DIRECT3D_9_LAYERS &&
mWindowsVersion < gfxWindowsPlatform::kWindowsXP)
{
*aStatus = FEATURE_BLOCKED_OS_VERSION;
return NS_OK;
}
// ANGLE currently uses D3D10 <-> D3D9 interop, which crashes on Optimus
// machines.
if (aFeature == FEATURE_WEBGL_ANGLE &&
gfxWindowsPlatform::IsOptimus())
{
*aStatus = FEATURE_BLOCKED_DEVICE;
return NS_OK;
}
// Windows Server 2003 should be just like Windows XP for present purpose, but still has a different version number.
// OTOH Windows Server 2008 R1 and R2 already have the same version numbers as Vista and Seven respectively
if (os == DRIVER_OS_WINDOWS_SERVER_2003)
os = DRIVER_OS_WINDOWS_XP;
if (mHasDriverVersionMismatch) {
if (aFeature == nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS ||
aFeature == nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS ||
aFeature == nsIGfxInfo::FEATURE_DIRECT2D)
{
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
return NS_OK;
}
}
}
return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}

View File

@ -264,23 +264,28 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
OperatingSystem* aOS /* = nsnull */)
{
GetData();
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
aSuggestedDriverVersion.SetIsVoid(true);
NS_ENSURE_ARG_POINTER(aStatus);
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
aSuggestedDriverVersion.SetIsVoid(true);
OperatingSystem os = DRIVER_OS_LINUX;
if (aOS)
*aOS = os;
#ifdef MOZ_PLATFORM_MAEMO
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
// on Maemo, the glxtest probe doesn't build, and we don't really need GfxInfo anyway
return NS_OK;
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
// on Maemo, the glxtest probe doesn't build, and we don't really need GfxInfo anyway
return NS_OK;
#endif
OperatingSystem os = DRIVER_OS_LINUX;
// Don't evaluate any special cases if we're checking the downloaded blocklist.
if (!aDriverInfo.Length()) {
GetData();
// Disable OpenGL layers when we don't have texture_from_pixmap because it regresses performance.
if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && !mHasTextureFromPixmap) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("<Anything with EXT_texture_from_pixmap support>");
return NS_OK;
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("<Anything with EXT_texture_from_pixmap support>");
return NS_OK;
}
// whitelist the linux test slaves' current configuration.
@ -292,34 +297,32 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
!strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") &&
!strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42"))
{
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
return NS_OK;
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
return NS_OK;
}
if (mIsMesa) {
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3");
}
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3");
}
} else if (mIsNVIDIA) {
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21");
}
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21");
}
} else if (mIsFGLRX) {
// FGLRX does not report a driver version number, so we have the OpenGL version instead.
// by requiring OpenGL 3, we effectively require recent drivers.
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
}
// FGLRX does not report a driver version number, so we have the OpenGL version instead.
// by requiring OpenGL 3, we effectively require recent drivers.
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
}
} else {
// like on windows, let's block unknown vendors. Think of virtual machines.
// Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
// like on windows, let's block unknown vendors. Think of virtual machines.
// Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
}
if (aOS)
*aOS = os;
}
return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}