From 61879d2c53a0473a24b4a9a69fcedd1af8f74fdf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 Jun 2022 11:19:41 +0200 Subject: Enabled VA-API by default (+ added VA-API fixes from upstream), Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) --- D147874.diff | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 D147874.diff (limited to 'D147874.diff') diff --git a/D147874.diff b/D147874.diff new file mode 100644 index 0000000..f0c57dd --- /dev/null +++ b/D147874.diff @@ -0,0 +1,64 @@ +diff -up firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp +--- firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp 2022-06-07 11:16:03.791419558 +0200 +@@ -233,13 +233,7 @@ void gfxPlatformGtk::InitDmabufConfig() + void gfxPlatformGtk::InitVAAPIConfig() { + FeatureState& feature = gfxConfig::GetFeature(Feature::VAAPI); + #ifdef MOZ_WAYLAND +- feature.DisableByDefault(FeatureStatus::Disabled, +- "VAAPI is disabled by default", +- "FEATURE_VAAPI_DISABLED"_ns); +- +- if (StaticPrefs::media_ffmpeg_vaapi_enabled()) { +- feature.UserForceEnable("Force enabled by pref"); +- } ++ feature.EnableByDefault(); + + nsCString failureId; + int32_t status; +@@ -253,6 +247,10 @@ void gfxPlatformGtk::InitVAAPIConfig() { + failureId); + } + ++ if (StaticPrefs::media_ffmpeg_vaapi_enabled()) { ++ feature.UserForceEnable("Force enabled by pref"); ++ } ++ + if (!gfxVars::UseEGL()) { + feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL", + "FEATURE_FAILURE_REQUIRES_EGL"_ns); +diff -up firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff firefox-101.0/widget/gtk/GfxInfo.cpp +--- firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff 2022-05-27 01:17:06.000000000 +0200 ++++ firefox-101.0/widget/gtk/GfxInfo.cpp 2022-06-07 09:52:54.416701418 +0200 +@@ -843,6 +843,31 @@ const nsTArray& GfxInfo:: + V(495, 44, 0, 0), "FEATURE_FAILURE_NO_GBM", "495.44.0"); + + //////////////////////////////////// ++ // FEATURE_VAAPI ++ APPEND_TO_DRIVER_BLOCKLIST_EXT( ++ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, ++ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll, ++ DeviceFamily::All, nsIGfxInfo::FEATURE_VAAPI, ++ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, ++ V(21, 0, 0, 0), "FEATURE_ROLLOUT_VAAPI_MESA", "Mesa 21.0.0.0"); ++ ++ // Disable on all NVIDIA hardware ++ APPEND_TO_DRIVER_BLOCKLIST_EXT( ++ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, ++ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All, ++ DeviceFamily::NvidiaAll, nsIGfxInfo::FEATURE_VAAPI, ++ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, ++ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_NVIDIA", ""); ++ ++ // Disable on all AMD devices not using Mesa. ++ APPEND_TO_DRIVER_BLOCKLIST_EXT( ++ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, ++ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::NonMesaAll, ++ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_VAAPI, ++ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, ++ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_AMD", ""); ++ ++ //////////////////////////////////// + // FEATURE_WEBRENDER_PARTIAL_PRESENT + APPEND_TO_DRIVER_BLOCKLIST_EXT( + OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -- cgit