From 0d00af6e738f26bb079307a0e99f590c3b303e32 Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sat, 15 Feb 2020 08:55:35 +0100 Subject: [PATCH] Bugfix for AImageReader crash on Android10/arm64 #445 --- build/bromite_patches_list.txt | 2 +- ...acklist-for-AImageReader-on-ARM-CPUs.patch | 33 +++++++ ...o-M78-Enable-AImageReader-by-default.patch | 85 ------------------- 3 files changed, 34 insertions(+), 86 deletions(-) create mode 100644 build/patches/Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch delete mode 100644 build/patches/Revert-Merge-to-M78-Enable-AImageReader-by-default.patch diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 1534530c..13ca1e44 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -115,7 +115,7 @@ Disable-search-ready-omnibox-by-default.patch disable-AdsBlockedInfoBar.patch Bromite-AdBlockUpdaterService.patch Add-option-to-configure-the-ad-blocker-filters-URL.patch -Revert-Merge-to-M78-Enable-AImageReader-by-default.patch +Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch Replace-DoH-probe-domain-with-RIPE-domain.patch Increase-number-of-autocomplete-matches-from-5-to-10.patch Disable-HEAD-requests-for-single-word-Omnibar-searches.patch diff --git a/build/patches/Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch b/build/patches/Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch new file mode 100644 index 00000000..7853701b --- /dev/null +++ b/build/patches/Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch @@ -0,0 +1,33 @@ +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Sat, 15 Feb 2020 08:20:40 +0100 +Subject: Restore GPU bug blacklist for AImageReader on ARM CPUs + +--- + gpu/config/gpu_driver_bug_list.json | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json +--- a/gpu/config/gpu_driver_bug_list.json ++++ b/gpu/config/gpu_driver_bug_list.json +@@ -2891,6 +2891,18 @@ + "reset_base_mipmap_level_before_texstorage" + ] + }, ++ { ++ "id":275, ++ "cr_bugs": [838725], ++ "description": "Disable AImageReader on ARM GPUs as its buggy.", ++ "os": { ++ "type": "android" ++ }, ++ "gl_vendor": "ARM.*", ++ "features": [ ++ "disable_aimagereader" ++ ] ++ }, + { + "id": 277, + "description": "Direct composition path is buggy on certain AMD devices/drivers", +-- +2.17.1 + diff --git a/build/patches/Revert-Merge-to-M78-Enable-AImageReader-by-default.patch b/build/patches/Revert-Merge-to-M78-Enable-AImageReader-by-default.patch deleted file mode 100644 index 03a7362c..00000000 --- a/build/patches/Revert-Merge-to-M78-Enable-AImageReader-by-default.patch +++ /dev/null @@ -1,85 +0,0 @@ -From: csagan5 <32685696+csagan5@users.noreply.github.com> -Date: Mon, 14 Oct 2019 20:27:33 +0200 -Subject: Revert "[Merge to M78] Enable AImageReader by default." - -This reverts commit 60c3d4531b180b911767fb3ea7c3553d7f408c25. - -Automatically disable hardware acceleration for Android Q on arm64 ---- - chrome/browser/android/chrome_startup_flags.cc | 2 ++ - gpu/config/gpu_finch_features.cc | 2 +- - gpu/ipc/service/gpu_init.cc | 8 ++------ - media/base/media_switches.cc | 2 +- - 4 files changed, 6 insertions(+), 8 deletions(-) - -diff --git a/chrome/browser/android/chrome_startup_flags.cc b/chrome/browser/android/chrome_startup_flags.cc ---- a/chrome/browser/android/chrome_startup_flags.cc -+++ b/chrome/browser/android/chrome_startup_flags.cc -@@ -6,6 +6,7 @@ - - #include "chrome/browser/android/chrome_startup_flags.h" - -+#include "base/android/build_info.h" - #include "base/android/jni_android.h" - #include "base/android/jni_string.h" - #include "base/android/scoped_java_ref.h" -@@ -16,6 +17,7 @@ - #include "chrome/common/chrome_switches.h" - #include "components/browser_sync/browser_sync_switches.h" - #include "components/dom_distiller/core/dom_distiller_switches.h" -+#include "content/public/common/content_switches.h" - #include "media/base/media_switches.h" - - namespace { -diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc ---- a/gpu/config/gpu_finch_features.cc -+++ b/gpu/config/gpu_finch_features.cc -@@ -31,7 +31,7 @@ bool FieldIsInBlacklist(const char* current_value, std::string blacklist_str) { - #if defined(OS_ANDROID) - // Use android AImageReader when playing videos with MediaPlayer. - const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer", -- base::FEATURE_ENABLED_BY_DEFAULT}; -+ base::FEATURE_DISABLED_BY_DEFAULT}; - - // Use android SurfaceControl API for managing display compositor's buffer queue - // and using overlays on Android. -diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc ---- a/gpu/ipc/service/gpu_init.cc -+++ b/gpu/ipc/service/gpu_init.cc -@@ -491,9 +491,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, - - #if defined(OS_ANDROID) - // Disable AImageReader if the workaround is enabled. -- if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) { -- base::android::AndroidImageReader::DisableSupport(); -- } -+ base::android::AndroidImageReader::DisableSupport(); - #endif - #if defined(USE_OZONE) - gpu_feature_info_.supported_buffer_formats_for_allocation_and_texturing = -@@ -522,9 +520,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line, - default_offscreen_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); - - // Disable AImageReader if the workaround is enabled. -- if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) { -- base::android::AndroidImageReader::DisableSupport(); -- } -+ base::android::AndroidImageReader::DisableSupport(); - - UMA_HISTOGRAM_ENUMERATION("GPU.GLImplementation", gl::GetGLImplementation()); - } -diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc ---- a/media/base/media_switches.cc -+++ b/media/base/media_switches.cc -@@ -487,7 +487,7 @@ const base::Feature kMediaDrmPreprovisioningAtStartup{ - - // Enables the Android Image Reader path for Video decoding(for AVDA and MCVD) - const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput", -- base::FEATURE_ENABLED_BY_DEFAULT}; -+ base::FEATURE_DISABLED_BY_DEFAULT}; - - // Prevents using SurfaceLayer for videos. This is meant to be used by embedders - // that cannot support SurfaceLayer at the moment. --- -2.17.1 -