зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1677293 - Enable Software WebRender on Linux nightly for small/medium screens. r=jrmuizel
This patch enables Software WebRender for all Linux users. If their configuration is also allowlisted for (accelerated) WebRender, then they will default to that over Software WebRender. Differential Revision: https://phabricator.services.mozilla.com/D97156
This commit is contained in:
Родитель
1839bfca69
Коммит
1a739849ce
|
@ -30,6 +30,7 @@ void gfxConfigManager::Init() {
|
|||
EmplaceUserPref("gfx.webrender.compositor", mWrCompositorEnabled);
|
||||
mWrForceEnabled = gfxPlatform::WebRenderPrefEnabled();
|
||||
mWrForceDisabled = StaticPrefs::gfx_webrender_force_disabled_AtStartup();
|
||||
mWrSoftwareForceEnabled = StaticPrefs::gfx_webrender_software_AtStartup();
|
||||
mWrCompositorForceEnabled =
|
||||
StaticPrefs::gfx_webrender_compositor_force_enabled_AtStartup();
|
||||
mGPUProcessAllowSoftware =
|
||||
|
@ -113,8 +114,21 @@ void gfxConfigManager::ConfigureWebRenderSoftware() {
|
|||
|
||||
mFeatureWrSoftware->EnableByDefault();
|
||||
|
||||
if (StaticPrefs::gfx_webrender_software_AtStartup()) {
|
||||
// Note that for testing in CI, software WebRender uses gfx.webrender.software
|
||||
// to force enable WebRender Software. As a result, we need to prefer that
|
||||
// over the MOZ_WEBRENDER envvar which is used to otherwise force on WebRender
|
||||
// (hardware). See bug 1656811.
|
||||
if (mWrSoftwareForceEnabled) {
|
||||
mFeatureWrSoftware->UserForceEnable("Force enabled by pref");
|
||||
} else if (mWrEnvForceEnabled) {
|
||||
mFeatureWrSoftware->UserDisable(
|
||||
"User force-enabled full WR",
|
||||
"FEATURE_FAILURE_USER_FORCE_ENABLED_FULL_WR"_ns);
|
||||
} else if (mWrForceDisabled || mWrEnvForceDisabled) {
|
||||
// If the user set the pref to force-disable, let's do that. This
|
||||
// will override all the other enabling prefs
|
||||
mFeatureWrSoftware->UserDisable("User force-disabled WR",
|
||||
"FEATURE_FAILURE_USER_FORCE_DISABLED"_ns);
|
||||
}
|
||||
|
||||
nsCString failureId;
|
||||
|
@ -130,6 +144,10 @@ void gfxConfigManager::ConfigureWebRenderSoftware() {
|
|||
switch (status) {
|
||||
case nsIGfxInfo::FEATURE_ALLOW_ALWAYS:
|
||||
case nsIGfxInfo::FEATURE_ALLOW_QUALIFIED:
|
||||
if (gfxPlatform::IsHeadless()) {
|
||||
mFeatureWrSoftware->Disable(FeatureStatus::Blocked,
|
||||
"Headless not yet supported", failureId);
|
||||
}
|
||||
break;
|
||||
case nsIGfxInfo::FEATURE_DENIED:
|
||||
mFeatureWrSoftware->Disable(FeatureStatus::Denied, "Not on allowlist",
|
||||
|
|
|
@ -29,6 +29,7 @@ class gfxConfigManager {
|
|||
mFeatureGPUProcess(nullptr),
|
||||
mWrForceEnabled(false),
|
||||
mWrForceDisabled(false),
|
||||
mWrSoftwareForceEnabled(false),
|
||||
mWrCompositorForceEnabled(false),
|
||||
mWrForceAngle(false),
|
||||
mWrForceAngleNoGPUProcess(false),
|
||||
|
@ -75,6 +76,7 @@ class gfxConfigManager {
|
|||
Maybe<bool> mWrCompositorEnabled;
|
||||
bool mWrForceEnabled;
|
||||
bool mWrForceDisabled;
|
||||
bool mWrSoftwareForceEnabled;
|
||||
bool mWrCompositorForceEnabled;
|
||||
bool mWrForceAngle;
|
||||
bool mWrForceAngleNoGPUProcess;
|
||||
|
|
|
@ -777,3 +777,106 @@ TEST_F(GfxConfigManager, WebRenderSofwareAndNotQualified) {
|
|||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderForceDisabledEnvvar) {
|
||||
mWrEnvForceDisabled = true;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderSoftwareAllowedForceDisabledEnvvar) {
|
||||
mWrEnvForceDisabled = true;
|
||||
mMockGfxInfo->mStatusWrSoftware = nsIGfxInfo::FEATURE_ALLOW_ALWAYS;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderForceSoftwareForceDisabledEnvvar) {
|
||||
mWrEnvForceDisabled = true;
|
||||
mWrSoftwareForceEnabled = true;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderForceEnabledEnvvar) {
|
||||
mWrEnvForceEnabled = true;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_FALSE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderSoftwareAllowedForceEnabledEnvvar) {
|
||||
mWrEnvForceEnabled = true;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
mMockGfxInfo->mStatusWrSoftware = nsIGfxInfo::FEATURE_ALLOW_ALWAYS;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_FALSE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderForceSoftwareForceEnabledEnvvar) {
|
||||
mWrEnvForceEnabled = true;
|
||||
mWrSoftwareForceEnabled = true;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_FALSE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
|
|
@ -722,6 +722,18 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
|
|||
V(18, 0, 0, 0), "FEATURE_ROLLOUT_NIGHTLY_ATI_MESA", "Mesa 18.0.0.0");
|
||||
#endif
|
||||
|
||||
////////////////////////////////////
|
||||
// FEATURE_WEBRENDER_SOFTWARE - ALLOWLIST
|
||||
#ifdef NIGHTLY_BUILD
|
||||
APPEND_TO_DRIVER_BLOCKLIST_EXT(
|
||||
OperatingSystem::Linux, ScreenSizeStatus::SmallAndMedium,
|
||||
BatteryStatus::All, DesktopEnvironment::All, WindowProtocol::All,
|
||||
DriverVendor::All, DeviceFamily::All,
|
||||
nsIGfxInfo::FEATURE_WEBRENDER_SOFTWARE,
|
||||
nsIGfxInfo::FEATURE_ALLOW_ALWAYS, DRIVER_COMPARISON_IGNORED,
|
||||
V(0, 0, 0, 0), "FEATURE_ROLLOUT_NIGHTLY_SW_WR_SMALL_MEDIUM_SCRN", "");
|
||||
#endif
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
APPEND_TO_DRIVER_BLOCKLIST_EXT(
|
||||
|
|
Загрузка…
Ссылка в новой задаче