Commit 813cf2f9 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1683653 - Disable OMTP for users with less than 2 GB of virtual memory. r=jrmuizel, a=RyanVM

Also disable for users with 64-bit Firefox with 1-2 cores, and less than
2 GB of physical memory. It was already disabled for 32-bit Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D101052
parent b00bac4b
......@@ -479,6 +479,8 @@ void gfxPlatform::OnMemoryPressure(layers::MemoryPressureReason aWhy) {
gfxPlatform::gfxPlatform()
: mHasVariationFontSupport(false),
mTotalPhysicalMemory(~0),
mTotalVirtualMemory(~0),
mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo),
mApzSupportCollector(this, &gfxPlatform::GetApzSupportInfo),
mTilesInfoCollector(this, &gfxPlatform::GetTilesSupportInfo),
......@@ -499,7 +501,16 @@ gfxPlatform::gfxPlatform()
InitBackendPrefs(GetBackendPrefs());
mTotalSystemMemory = PR_GetPhysicalMemorySize();
#ifdef XP_WIN
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
if (GlobalMemoryStatusEx(&status)) {
mTotalPhysicalMemory = status.ullTotalPhys;
mTotalVirtualMemory = status.ullTotalVirtual;
}
#else
mTotalPhysicalMemory = PR_GetPhysicalMemorySize();
#endif
VRManager::ManagerInit();
}
......@@ -2911,18 +2922,20 @@ void gfxPlatform::InitOMTPConfig() {
Preferences::GetBool("layers.omtp.enabled", false,
PrefValueKind::Default));
if (sizeof(void*) <= sizeof(uint32_t)) {
int32_t cpuCores = PR_GetNumberOfProcessors();
const uint64_t kMinSystemMemory = 2147483648; // 2 GB
if (cpuCores <= 2) {
omtp.ForceDisable(FeatureStatus::Broken,
"OMTP is not supported on 32-bit with <= 2 cores",
"FEATURE_FAILURE_OMTP_32BIT_CORES"_ns);
} else if (mTotalSystemMemory < kMinSystemMemory) {
omtp.ForceDisable(FeatureStatus::Broken,
"OMTP is not supported on 32-bit with < 2 GB RAM",
"FEATURE_FAILURE_OMTP_32BIT_MEM"_ns);
}
int32_t cpuCores = PR_GetNumberOfProcessors();
const uint64_t kMinSystemMemory = 2147483648; // 2 GB
if (cpuCores <= 2) {
omtp.ForceDisable(FeatureStatus::Broken,
"OMTP is not supported with <= 2 cores",
"FEATURE_FAILURE_OMTP_FEW_CORES"_ns);
} else if (mTotalPhysicalMemory < kMinSystemMemory) {
omtp.ForceDisable(FeatureStatus::Broken,
"OMTP is not supported with < 2 GB RAM",
"FEATURE_FAILURE_OMTP_LOW_PMEM"_ns);
} else if (mTotalVirtualMemory < kMinSystemMemory) {
omtp.ForceDisable(FeatureStatus::Broken,
"OMTP is not supported with < 2 GB VMEM",
"FEATURE_FAILURE_OMTP_LOW_VMEM"_ns);
}
if (mContentBackend == BackendType::CAIRO) {
......
......@@ -927,7 +927,8 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
// max number of entries in word cache
int32_t mWordCacheMaxEntries;
uint64_t mTotalSystemMemory;
uint64_t mTotalPhysicalMemory;
uint64_t mTotalVirtualMemory;
// Hardware vsync source. Only valid on parent process
RefPtr<mozilla::gfx::VsyncSource> mVsyncSource;
......
......@@ -15,7 +15,7 @@ fuzzy-if(OSX==1010,0-1,0-24) fuzzy-if(d2d,0-16,0-999) fuzzy-if(skiaContent,0-14,
== boxshadow-fileupload.html boxshadow-fileupload-ref.html
fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-98,0-152) fuzzy-if(skiaContent,0-13,0-28) fuzzy-if(webrender,19-19,47-47) == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
fuzzy-if(skiaContent,0-1,0-17) random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
fuzzy-if(skiaContent,0-1,0-18) random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
fuzzy-if(skiaContent,0-1,0-17) == boxshadow-mixed-2.html boxshadow-mixed-2-ref.html
random-if(d2d) fuzzy-if(skiaContent,0-1,0-212) fuzzy-if(webrender,0-127,0-3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
fuzzy-if(skiaContent,0-1,0-50) == chrome://reftest/content/box-shadow/boxshadow-dynamic.xhtml chrome://reftest/content/box-shadow/boxshadow-dynamic-ref.xhtml
......
# basic tests for webkit-text-stroke
# fuzzy is needed here for platform dependent backends
# These fail on Linux without webrender due to lack of antialiasing of the HTML text stroke
fuzzy(0-64,0-52) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-776) == webkit-text-stroke-property-001.html webkit-text-stroke-property-001-ref.html
fuzzy(0-4,0-24) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-4,0-27) fuzzy-if(geckoview&&webrender,0-4,0-1476) == webkit-text-stroke-property-002.html webkit-text-stroke-property-002-ref.html
fuzzy(0-48,0-28) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-528) == webkit-text-stroke-property-003.html webkit-text-stroke-property-003-ref.html
fuzzy(0-64,0-33) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-575) fuzzy-if(geckoview&&webrender&&device,0-64,0-599) fuzzy-if(geckoview&&webrender&&emulator,96-96,58-58) == webkit-text-stroke-property-004.html webkit-text-stroke-property-004-ref.html
fuzzy(0-64,0-47) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-860) == webkit-text-stroke-property-005.html webkit-text-stroke-property-005-ref.html
fuzzy(0-71,0-10) fails-if(gtkWidget&&!webrender) == webkit-text-stroke-property-006.html webkit-text-stroke-property-006-ref.html
fuzzy(0-64,0-52) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-776) == webkit-text-stroke-property-001.html webkit-text-stroke-property-001-ref.html
fuzzy(0-4,0-24) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-4,0-27) fuzzy-if(geckoview&&webrender,0-4,0-1476) == webkit-text-stroke-property-002.html webkit-text-stroke-property-002-ref.html
fuzzy(0-48,0-28) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-528) == webkit-text-stroke-property-003.html webkit-text-stroke-property-003-ref.html
fuzzy(0-64,0-33) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-575) fuzzy-if(geckoview&&webrender&&device,0-64,0-599) fuzzy-if(geckoview&&webrender&&emulator,96-96,58-58) == webkit-text-stroke-property-004.html webkit-text-stroke-property-004-ref.html
fuzzy(0-64,0-47) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) fuzzy-if(webrender,0-64,0-860) == webkit-text-stroke-property-005.html webkit-text-stroke-property-005-ref.html
fuzzy(0-71,0-10) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!webrender) fails-if(gtkWidget&&!webrender) == webkit-text-stroke-property-006.html webkit-text-stroke-property-006-ref.html
[background-position-001.xht]
expected:
if (os == "win") and not webrender: FAIL
if (os == "win") and (bits != 32) and not webrender: FAIL
if (os == "mac") and not webrender: FAIL
[background-position-002.xht]
expected:
if (os == "win") and not webrender: FAIL
if (os == "win") and (bits != 32) and not webrender: FAIL
if (os == "mac") and not webrender: FAIL
[content-visibility-012.html]
expected:
if (os == "win") and not webrender: FAIL
if (os == "win") and (bits != 32) and not webrender: FAIL
[content-visibility-014.html]
expected:
if (os == "win") and not webrender: FAIL
if (os == "win") and (bits != 32) and not webrender: FAIL
......@@ -3,6 +3,7 @@
if os == "android" and not e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=1520847
expected:
if webrender and (os == 'android'): FAIL
if (os == "win"): FAIL
if webrender and (os == "win"): FAIL
if not webrender and (os == "win") and (bits != 32): FAIL
fuzzy:
if (os == "mac") and webrender: maxDifference=0-1;totalPixels=0-1054
[will-change-transform-zero-size-child-overflow-visible.html]
expected:
if (os == "win") and not webrender: FAIL
if (os == "win") and (bits != 32) and not webrender: FAIL
[pathlength-001.svg]
expected:
if (os == "linux") and not webrender: PASS
if (os == "win") and (bits == 32) and not webrender: PASS
FAIL
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment