mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 600620 - 1/2 - Expose feature status block reason so that it can be used by about:support - r=vladimir, a=blocking2.0-b7
This commit is contained in:
parent
7cb3c79799
commit
b5bc302c89
@ -322,15 +322,15 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
|||||||
if (gfxInfo) {
|
if (gfxInfo) {
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) {
|
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) {
|
||||||
if (status == nsIGfxInfo::FEATURE_BLOCKED ||
|
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
|
||||||
status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
|
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
|
||||||
{
|
{
|
||||||
useOpenGL = PR_FALSE;
|
useOpenGL = PR_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_ANGLE, &status))) {
|
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_ANGLE, &status))) {
|
||||||
if (status == nsIGfxInfo::FEATURE_BLOCKED ||
|
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
|
||||||
status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
|
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
|
||||||
{
|
{
|
||||||
useANGLE = PR_FALSE;
|
useANGLE = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,7 @@ LayerManagerD3D9::Initialize()
|
|||||||
if (gfxInfo) {
|
if (gfxInfo) {
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) {
|
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) {
|
||||||
if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
|
if (status != nsIGfxInfo::FEATURE_NO_INFO)
|
||||||
status != nsIGfxInfo::FEATURE_AVAILABLE)
|
|
||||||
{
|
{
|
||||||
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
|
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
@ -154,8 +154,7 @@ LayerManagerOGL::Initialize(GLContext *aExistingContext)
|
|||||||
if (gfxInfo) {
|
if (gfxInfo) {
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) {
|
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) {
|
||||||
if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
|
if (status != nsIGfxInfo::FEATURE_NO_INFO) {
|
||||||
status != nsIGfxInfo::FEATURE_AVAILABLE) {
|
|
||||||
NS_WARNING("OpenGL-accelerated layers are not supported on this system.");
|
NS_WARNING("OpenGL-accelerated layers are not supported on this system.");
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -285,11 +285,11 @@ gfxWindowsPlatform::UpdateRenderMode()
|
|||||||
if (gfxInfo) {
|
if (gfxInfo) {
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT2D, &status))) {
|
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT2D, &status))) {
|
||||||
if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
|
if (status != nsIGfxInfo::FEATURE_NO_INFO) {
|
||||||
status != nsIGfxInfo::FEATURE_AVAILABLE)
|
|
||||||
{
|
|
||||||
d2dDisabled = PR_TRUE;
|
d2dDisabled = PR_TRUE;
|
||||||
if (status == nsIGfxInfo::FEATURE_BLOCKED) {
|
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
|
||||||
|
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
|
||||||
|
{
|
||||||
d2dBlocked = PR_TRUE;
|
d2dBlocked = PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,20 +93,27 @@ interface nsIGfxInfo : nsISupports
|
|||||||
/*
|
/*
|
||||||
* A set of return values from GetFeatureStatus
|
* A set of return values from GetFeatureStatus
|
||||||
*/
|
*/
|
||||||
/* We don't have any information about this feature on this hardware */
|
/* We don't explicitly block or discourage the feature. Which means we'll try getting it from the
|
||||||
const long FEATURE_STATUS_UNKNOWN = 0;
|
* hardware, and see what happens. */
|
||||||
/* This feature is available and can be used */
|
const long FEATURE_NO_INFO = 1;
|
||||||
const long FEATURE_AVAILABLE = 1;
|
/* This feature is blocked on this driver version. Updating driver will typically unblock it. */
|
||||||
/* This feature is not available */
|
const long FEATURE_BLOCKED_DRIVER_VERSION = 2;
|
||||||
const long FEATURE_NOT_AVAILABLE = 2;
|
/* This feature is blocked on this device, regardless of driver version.
|
||||||
/* This feature is available, but is blocked due to a blocklist entry */
|
* Typically means we hit too many driver crashes without a good reason to hope for them to
|
||||||
const long FEATURE_BLOCKED = 3;
|
* get fixed soon. */
|
||||||
|
const long FEATURE_BLOCKED_DEVICE = 3;
|
||||||
/* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
|
/* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
|
||||||
const long FEATURE_NOT_SUGGESTED = 4;
|
const long FEATURE_DISCOURAGED = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ask about a feature, and return the status of that feature
|
* Ask about a feature, and return the status of that feature
|
||||||
*/
|
*/
|
||||||
long getFeatureStatus(in long aFeature);
|
long getFeatureStatus(in long aFeature);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ask about a feature, return the minimum driver version required for it if its status is
|
||||||
|
* FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
|
||||||
|
*/
|
||||||
|
DOMString getFeatureSuggestedDriverVersion(in long aFeature);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "gfxWindowsPlatform.h"
|
#include "gfxWindowsPlatform.h"
|
||||||
#include "GfxInfo.h"
|
#include "GfxInfo.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
#include "mozilla/FunctionTimer.h"
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
|
#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
|
||||||
@ -314,6 +315,7 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
|||||||
}
|
}
|
||||||
nsresult err;
|
nsresult err;
|
||||||
*aAdapterDeviceID = device.ToInteger(&err, 16);
|
*aAdapterDeviceID = device.ToInteger(&err, 16);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,7 +497,7 @@ static const GfxDriverInfo driverInfo[] = {
|
|||||||
*/
|
*/
|
||||||
{ allWindowsVersions,
|
{ allWindowsVersions,
|
||||||
vendorIntel, deviceFamilyIntelBlockDirect2D,
|
vendorIntel, deviceFamilyIntelBlockDirect2D,
|
||||||
nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED,
|
nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
|
||||||
DRIVER_LESS_THAN, allDriverVersions },
|
DRIVER_LESS_THAN, allDriverVersions },
|
||||||
|
|
||||||
/* implement the blocklist from bug 594877
|
/* implement the blocklist from bug 594877
|
||||||
@ -505,7 +507,7 @@ static const GfxDriverInfo driverInfo[] = {
|
|||||||
#define IMPLEMENT_INTEL_DRIVER_BLOCKLIST(winVer, devFamily, driverVer) \
|
#define IMPLEMENT_INTEL_DRIVER_BLOCKLIST(winVer, devFamily, driverVer) \
|
||||||
{ winVer, \
|
{ winVer, \
|
||||||
vendorIntel, devFamily, \
|
vendorIntel, devFamily, \
|
||||||
allFeatures, nsIGfxInfo::FEATURE_BLOCKED, \
|
allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, \
|
||||||
DRIVER_LESS_THAN, driverVer },
|
DRIVER_LESS_THAN, driverVer },
|
||||||
|
|
||||||
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindowsXP, deviceFamilyIntelGMA500, V(6,14,11,1018))
|
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindowsXP, deviceFamilyIntelGMA500, V(6,14,11,1018))
|
||||||
@ -529,14 +531,14 @@ static const GfxDriverInfo driverInfo[] = {
|
|||||||
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX3000, V(8,15,10,1930))
|
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX3000, V(8,15,10,1930))
|
||||||
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX4500HD, V(8,15,10,2202))
|
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX4500HD, V(8,15,10,2202))
|
||||||
|
|
||||||
/* OpenGL on any Intel hardware is not suggested */
|
/* OpenGL on any Intel hardware is discouraged */
|
||||||
{ allWindowsVersions,
|
{ allWindowsVersions,
|
||||||
vendorIntel, allDevices,
|
vendorIntel, allDevices,
|
||||||
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
|
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_DISCOURAGED,
|
||||||
DRIVER_LESS_THAN, allDriverVersions },
|
DRIVER_LESS_THAN, allDriverVersions },
|
||||||
{ allWindowsVersions,
|
{ allWindowsVersions,
|
||||||
vendorIntel, allDevices,
|
vendorIntel, allDevices,
|
||||||
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
|
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED,
|
||||||
DRIVER_LESS_THAN, allDriverVersions },
|
DRIVER_LESS_THAN, allDriverVersions },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -567,10 +569,13 @@ ParseDriverVersion(nsAString& aVersion, PRUint64 *aNumericVersion)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
nsresult
|
||||||
GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
|
GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion)
|
||||||
{
|
{
|
||||||
PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
|
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
|
||||||
|
aSuggestedDriverVersion.SetIsVoid(PR_TRUE);
|
||||||
|
|
||||||
|
PRInt32 status = nsIGfxInfo::FEATURE_NO_INFO;
|
||||||
|
|
||||||
PRUint32 adapterVendor = 0;
|
PRUint32 adapterVendor = 0;
|
||||||
PRUint32 adapterDeviceID = 0;
|
PRUint32 adapterDeviceID = 0;
|
||||||
@ -587,6 +592,8 @@ GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRUint64 suggestedDriverVersion = 0;
|
||||||
|
|
||||||
const GfxDriverInfo *info = &driverInfo[0];
|
const GfxDriverInfo *info = &driverInfo[0];
|
||||||
while (info->windowsVersion) {
|
while (info->windowsVersion) {
|
||||||
|
|
||||||
@ -622,6 +629,7 @@ GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
|
|||||||
switch (info->op) {
|
switch (info->op) {
|
||||||
case DRIVER_LESS_THAN:
|
case DRIVER_LESS_THAN:
|
||||||
match = driverVersion < info->version;
|
match = driverVersion < info->version;
|
||||||
|
suggestedDriverVersion = info->version;
|
||||||
break;
|
break;
|
||||||
case DRIVER_LESS_THAN_OR_EQUAL:
|
case DRIVER_LESS_THAN_OR_EQUAL:
|
||||||
match = driverVersion <= info->version;
|
match = driverVersion <= info->version;
|
||||||
@ -665,6 +673,28 @@ GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*aStatus = status;
|
*aStatus = status;
|
||||||
|
|
||||||
|
if (status == FEATURE_BLOCKED_DRIVER_VERSION && suggestedDriverVersion) {
|
||||||
|
aSuggestedDriverVersion.AppendPrintf("%lld.%lld.%lld.%lld",
|
||||||
|
(suggestedDriverVersion & 0xffff000000000000) >> 48,
|
||||||
|
(suggestedDriverVersion & 0x0000ffff00000000) >> 32,
|
||||||
|
(suggestedDriverVersion & 0x00000000ffff0000) >> 16,
|
||||||
|
(suggestedDriverVersion & 0x000000000000ffff));
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
|
||||||
|
{
|
||||||
|
nsString s;
|
||||||
|
return GetFeatureStatusImpl(aFeature, aStatus, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
GfxInfo::GetFeatureSuggestedDriverVersion(PRInt32 aFeature, nsAString& aSuggestedDriverVersion)
|
||||||
|
{
|
||||||
|
PRInt32 i;
|
||||||
|
return GetFeatureStatusImpl(aFeature, &i, aSuggestedDriverVersion);
|
||||||
|
}
|
||||||
|
@ -62,6 +62,8 @@ private:
|
|||||||
nsString mDriverVersion;
|
nsString mDriverVersion;
|
||||||
nsString mDriverDate;
|
nsString mDriverDate;
|
||||||
nsString mDeviceKey;
|
nsString mDeviceKey;
|
||||||
|
|
||||||
|
nsresult GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace widget
|
} // namespace widget
|
||||||
|
Loading…
Reference in New Issue
Block a user