Backed out changeset eae66c448e16 (bug 1777927) for causing failures at test_gfxBlacklist_Version.js. CLOSED TREE

This commit is contained in:
Butkovits Atila 2022-07-12 04:37:54 +03:00
Родитель bf8e6bd398
Коммит 071d1fd9a9
7 изменённых файлов: 30 добавлений и 41 удалений

Просмотреть файл

@ -2351,11 +2351,9 @@ void gfxPlatform::InitAcceleration() {
// explicit.
MOZ_ASSERT(NS_IsMainThread(), "can only initialize prefs on the main thread");
#ifndef MOZ_WIDGET_GTK
nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
nsCString discardFailureId;
int32_t status;
#endif
if (XRE_IsParentProcess()) {
gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
@ -2380,30 +2378,28 @@ void gfxPlatform::InitAcceleration() {
#endif
}
if (StaticPrefs::media_hardware_video_decoding_enabled_AtStartup()) {
#ifdef MOZ_WIDGET_GTK
sLayersSupportsHardwareVideoDecoding =
gfxPlatformGtk::GetPlatform()->InitVAAPIConfig(
StaticPrefs::
media_hardware_video_decoding_force_enabled_AtStartup() ||
StaticPrefs::media_ffmpeg_vaapi_enabled());
#else
if (
# ifdef XP_WIN
Preferences::GetBool("media.wmf.dxva.enabled", true) &&
# endif
NS_SUCCEEDED(gfxInfo->GetFeatureStatus(
nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, discardFailureId,
&status))) {
if (status == nsIGfxInfo::FEATURE_STATUS_OK ||
StaticPrefs::
media_hardware_video_decoding_force_enabled_AtStartup()) {
sLayersSupportsHardwareVideoDecoding = true;
}
}
if (Preferences::GetBool("media.hardware-video-decoding.enabled", false) &&
#ifdef XP_WIN
Preferences::GetBool("media.wmf.dxva.enabled", true) &&
#endif
NS_SUCCEEDED(
gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
discardFailureId, &status))) {
if (status == nsIGfxInfo::FEATURE_STATUS_OK ||
#ifdef MOZ_WAYLAND
StaticPrefs::media_ffmpeg_vaapi_enabled() ||
#endif
StaticPrefs::media_hardware_video_decoding_force_enabled_AtStartup()) {
sLayersSupportsHardwareVideoDecoding = true;
}
}
#ifdef MOZ_WAYLAND
sLayersSupportsHardwareVideoDecoding =
gfxPlatformGtk::GetPlatform()->InitVAAPIConfig(
sLayersSupportsHardwareVideoDecoding);
#endif
sLayersAccelerationPrefsInitialized = true;
if (XRE_IsParentProcess()) {

Просмотреть файл

@ -225,16 +225,12 @@ void gfxPlatformGtk::InitDmabufConfig() {
#endif
}
bool gfxPlatformGtk::InitVAAPIConfig(bool aForceEnabledByUser) {
bool gfxPlatformGtk::InitVAAPIConfig(bool aEnabledByPlatform) {
FeatureState& feature =
gfxConfig::GetFeature(Feature::HARDWARE_VIDEO_DECODING);
#ifdef MOZ_WAYLAND
feature.EnableByDefault();
if (aForceEnabledByUser) {
feature.UserForceEnable("Force enabled by pref");
}
nsCString failureId;
int32_t status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
@ -242,14 +238,16 @@ bool gfxPlatformGtk::InitVAAPIConfig(bool aForceEnabledByUser) {
nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, failureId, &status))) {
feature.Disable(FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken",
"FEATURE_FAILURE_NO_GFX_INFO"_ns);
} else if (status == nsIGfxInfo::FEATURE_BLOCKED_PLATFORM_TEST) {
feature.ForceDisable(FeatureStatus::Unavailable,
"Force disabled by gfxInfo", failureId);
} else if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
feature.Disable(FeatureStatus::Blocklisted, "Blocklisted by gfxInfo",
failureId);
}
if (status != nsIGfxInfo::FEATURE_STATUS_OK && aEnabledByPlatform) {
feature.UserForceEnable("Force enabled by pref");
}
if (!aEnabledByPlatform) {
feature.Disable(FeatureStatus::Blocked, "Blocked by platform", failureId);
}
if (!gfxVars::UseEGL()) {
feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL",
"FEATURE_FAILURE_REQUIRES_EGL"_ns);

Просмотреть файл

@ -68,7 +68,7 @@ class gfxPlatformGtk final : public gfxPlatform {
protected:
void InitX11EGLConfig();
void InitDmabufConfig();
bool InitVAAPIConfig(bool aForceEnabledByUser);
bool InitVAAPIConfig(bool aEnabledByPlatform);
void InitPlatformGPUProcessPrefs() override;
void InitWebRenderConfig() override;
bool CheckVariationFontSupport() override;

Просмотреть файл

@ -9385,11 +9385,6 @@
value: false
mirror: always
- name: media.hardware-video-decoding.enabled
type: bool
value: true
mirror: once
- name: media.hardware-video-decoding.force-enabled
type: bool
value: false

Просмотреть файл

@ -256,6 +256,8 @@ pref("media.volume_scale", "1.0");
// opened as top-level documents, as opposed to inside a media element.
pref("media.play-stand-alone", true);
pref("media.hardware-video-decoding.enabled", true);
#ifdef MOZ_WMF
pref("media.wmf.dxva.enabled", true);
pref("media.wmf.play-stand-alone", true);

Просмотреть файл

@ -1008,7 +1008,7 @@ nsresult GfxInfo::GetFeatureStatusImpl(
if (aFeature == nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING &&
!mIsVAAPISupported) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_PLATFORM_TEST;
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_VIDEO_DECODING_TEST_FAILED";
return NS_OK;
}

Просмотреть файл

@ -207,8 +207,6 @@ interface nsIGfxInfo : nsISupports
const long FEATURE_ALLOW_ALWAYS = 9;
/* This feature is safe to be on this device due to the allowlist, depending on qualified/experiment status. */
const long FEATURE_ALLOW_QUALIFIED = 10;
/* This feature failed in a startup test, e.g. due to a crashing driver. */
const long FEATURE_BLOCKED_PLATFORM_TEST = 11;
/**
* Ask about a feature, and return the status of that feature.