From 1a6c2d2a33c0dd2e05fe430fe8ac0cb032040eba Mon Sep 17 00:00:00 2001 From: jk Date: Sun, 18 Oct 2020 08:44:33 -0500 Subject: upgpkg: ungoogled-chromium 86.0.4240.75-1 upstream release --- .SRCINFO | 32 ++--- PKGBUILD | 48 ++++--- ...-enable-accelerated-video-decode-on-Linux.patch | 43 +++++++ ...valid-end-iterator-usage-in-CookieMonster.patch | 78 ++++++++++++ intel-vp9-quirk.patch | 12 -- ...location-limit-compatible-with-FFmpeg-4.3.patch | 43 ------- ...l-back-to-the-i965-driver-if-we-re-on-iHD.patch | 139 +++++++++++++++++++++ remove-dead-reloc-in-nonalloc-LD-flags.patch | 37 ++++++ wayland-egl.patch | 36 ++++++ 9 files changed, 373 insertions(+), 95 deletions(-) create mode 100644 check-for-enable-accelerated-video-decode-on-Linux.patch create mode 100644 fix-invalid-end-iterator-usage-in-CookieMonster.patch delete mode 100644 intel-vp9-quirk.patch delete mode 100644 media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch create mode 100644 only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch create mode 100644 remove-dead-reloc-in-nonalloc-LD-flags.patch diff --git a/.SRCINFO b/.SRCINFO index b34cbfa..a0e000b 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = ungoogled-chromium pkgdesc = A lightweight approach to removing Google web service dependency - pkgver = 85.0.4183.121 + pkgver = 86.0.4240.75 pkgrel = 1 url = https://github.com/Eloston/ungoogled-chromium install = chromium.install @@ -17,7 +17,7 @@ pkgbase = ungoogled-chromium makedepends = libpipewire02 makedepends = clang makedepends = lld - makedepends = gn-m85 + makedepends = gn makedepends = java-runtime-headless makedepends = python2-setuptools depends = gtk3 @@ -58,25 +58,27 @@ pkgbase = ungoogled-chromium optdepends = kwallet: for storing passwords in KWallet on KDE desktops provides = chromium conflicts = chromium - source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-85.0.4183.121.tar.xz - source = ungoogled-chromium-85.0.4183.121-1.tar.gz::https://github.com/Eloston/ungoogled-chromium/archive/85.0.4183.121-1.tar.gz + source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-86.0.4240.75.tar.xz + source = ungoogled-chromium-86.0.4240.80-1.tar.gz::https://github.com/Eloston/ungoogled-chromium/archive/86.0.4240.80-1.tar.gz source = chromium-launcher-6.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v6.tar.gz source = chromium-drirc-disable-10bpc-color-configs.conf - source = https://github.com/stha09/chromium-patches/releases/download/chromium-85-patchset-2/chromium-85-patchset-2.tar.xz - source = media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch - source = intel-vp9-quirk.patch + source = https://github.com/stha09/chromium-patches/releases/download/chromium-86-patchset-6/chromium-86-patchset-6.tar.xz + source = fix-invalid-end-iterator-usage-in-CookieMonster.patch + source = only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch + source = remove-dead-reloc-in-nonalloc-LD-flags.patch + source = check-for-enable-accelerated-video-decode-on-Linux.patch source = wayland-egl.patch - source = nvidia-vdpau.patch source = chromium-skia-harmony.patch - sha256sums = e018547e54566410fb365d9f3dae10037c30fca5debe6ba8baceef3ad3b03d28 - sha256sums = 038fdbecb3a93535a60f02482eff29782e41deb2b171d2eb4511d56e7f103c95 + sha256sums = dd7a41eda5f984e44474d7e6fb25b5df88c1c924a1a3966189f037f7d325bcb5 + sha256sums = 9bc0946f661942b182b12fdec024b12b337aa895f3c39a321916bafe297e97a1 sha256sums = 04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1 sha256sums = babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb - sha256sums = 2194fe22b9e5ccdc4a86da4e3572214f670c561486671f57c90636fd3cbfa43e - sha256sums = 0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c - sha256sums = a25fc6fccb84fd0a58a799661cd9c4ffeb2731fa49268f43aa7108f1542c5af6 - sha256sums = 34d08ea93cb4762cb33c7cffe931358008af32265fc720f2762f0179c3973574 - sha256sums = 8095bf73afbca7c2b07306c5b4dd8f79b66e1053fa4e58b07f71ef938be603f1 + sha256sums = 6f9ab35fa2c9e6e34ec454b829b7b87adaebc10cacecd1ac1daa67035ee44aba + sha256sums = 69d8b7a439db1af4713245ddf5f44ca647283ba833a8733e848033ebdaf03cdc + sha256sums = 7514c6c81a64a5457b66494a366fbb39005563eecc48d1a39033dd06aec4e300 + sha256sums = 7cace84d7494190e7882d3e637820646ec8d64808f0a2128c515bd44991a3790 + sha256sums = 03d03a39b2afa40083eb8ccb9616a51619f71da92348effc8ee289cbda10128b + sha256sums = bf86923eaee5529ab9fb6148bd6c33a73c8746ab1b4ade0cd3b761109bc55826 sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1 pkgname = ungoogled-chromium diff --git a/PKGBUILD b/PKGBUILD index e06a11b..08b5ea8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,16 +9,16 @@ # Contributor: Daniel J Griffiths pkgname=ungoogled-chromium -pkgver=85.0.4183.121 +pkgver=86.0.4240.75 pkgrel=1 _launcher_ver=6 -_gcc_patchset=2 +_gcc_patchset=6 _pkgname=$(echo $pkgname | cut -d\- -f1-2) _pkgver=$(echo $pkgver | cut -d\. -f1-4) # ungoogled chromium variables -_uc_ver=$pkgver-1 +_uc_ver=86.0.4240.80-1 _uc_usr=Eloston -_uc_sum='038fdbecb3a93535a60f02482eff29782e41deb2b171d2eb4511d56e7f103c95' +_uc_sum='9bc0946f661942b182b12fdec024b12b337aa895f3c39a321916bafe297e97a1' _uc_url="$_pkgname-$_uc_ver.tar.gz::https://github.com/$_uc_usr/ungoogled-chromium/archive/$_uc_ver.tar.gz" pkgdesc="A lightweight approach to removing Google web service dependency" arch=('x86_64') @@ -28,7 +28,7 @@ depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt' 'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'json-glib' 'desktop-file-utils' 'hicolor-icon-theme') makedepends=('python' 'python2' 'gperf' 'mesa' 'ninja' 'nodejs' 'git' 'libva' - 'libpipewire02' 'clang' 'lld' 'gn-m85' 'java-runtime-headless' + 'libpipewire02' 'clang' 'lld' 'gn' 'java-runtime-headless' 'python2-setuptools') optdepends=('pepper-flash: support for Flash content' 'libpipewire02: WebRTC desktop sharing under Wayland' @@ -44,20 +44,22 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz chromium-drirc-disable-10bpc-color-configs.conf https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz - media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch - intel-vp9-quirk.patch + fix-invalid-end-iterator-usage-in-CookieMonster.patch + only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch + remove-dead-reloc-in-nonalloc-LD-flags.patch + check-for-enable-accelerated-video-decode-on-Linux.patch wayland-egl.patch - nvidia-vdpau.patch chromium-skia-harmony.patch) -sha256sums=('e018547e54566410fb365d9f3dae10037c30fca5debe6ba8baceef3ad3b03d28' +sha256sums=('dd7a41eda5f984e44474d7e6fb25b5df88c1c924a1a3966189f037f7d325bcb5' $_uc_sum '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' 'babda4f5c1179825797496898d77334ac067149cac03d797ab27ac69671a7feb' - '2194fe22b9e5ccdc4a86da4e3572214f670c561486671f57c90636fd3cbfa43e' - '0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c' - 'a25fc6fccb84fd0a58a799661cd9c4ffeb2731fa49268f43aa7108f1542c5af6' - '34d08ea93cb4762cb33c7cffe931358008af32265fc720f2762f0179c3973574' - '8095bf73afbca7c2b07306c5b4dd8f79b66e1053fa4e58b07f71ef938be603f1' + '6f9ab35fa2c9e6e34ec454b829b7b87adaebc10cacecd1ac1daa67035ee44aba' + '69d8b7a439db1af4713245ddf5f44ca647283ba833a8733e848033ebdaf03cdc' + '7514c6c81a64a5457b66494a366fbb39005563eecc48d1a39033dd06aec4e300' + '7cace84d7494190e7882d3e637820646ec8d64808f0a2128c515bd44991a3790' + '03d03a39b2afa40083eb8ccb9616a51619f71da92348effc8ee289cbda10128b' + 'bf86923eaee5529ab9fb6148bd6c33a73c8746ab1b4ade0cd3b761109bc55826' '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1') # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py @@ -99,25 +101,21 @@ prepare() { third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ third_party/libxml/chromium/*.cc - # https://crbug.com/1095962 - patch -Np1 -i ../media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch + # Upstream fixes + patch -Np1 -i ../fix-invalid-end-iterator-usage-in-CookieMonster.patch + patch -Np1 -i ../only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch + #patch -Np1 -i ../remove-dead-reloc-in-nonalloc-LD-flags.patch + patch -Np1 -i ../check-for-enable-accelerated-video-decode-on-Linux.patch # Fixes for building with libstdc++ instead of libc++ - patch -Np1 -i ../patches/chromium-85-NearbyShareEncryptedMetadataKey-include.patch - patch -Np1 -i ../patches/chromium-85-sim_hash-include.patch + patch -Np1 -i ../patches/chromium-86-nearby-include.patch # https://crbug.com/skia/6663#c10 patch -Np0 -i ../chromium-skia-harmony.patch - # Intel KabyLake/GeminiLake VP9 quirk - patch -Np1 -i ../intel-vp9-quirk.patch - # Wayland/EGL regression (crbug #1071528 #1071550) patch -Np1 -i ../wayland-egl.patch - # NVIDIA vdpau-wrapper - patch -Np1 -i ../nvidia-vdpau.patch - # Ungoogled Chromium changes _ungoogled_repo="$srcdir/$_pkgname-$_uc_ver" _utils="${_ungoogled_repo}/utils" @@ -204,7 +202,7 @@ build() { CXXFLAGS+=' -Wno-unknown-warning-option' msg2 'Configuring Chromium' - gn-m85 gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2 + gn gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2 msg2 'Building Chromium' ninja -C out/Release chrome chrome_sandbox chromedriver } diff --git a/check-for-enable-accelerated-video-decode-on-Linux.patch b/check-for-enable-accelerated-video-decode-on-Linux.patch new file mode 100644 index 0000000..a0d5468 --- /dev/null +++ b/check-for-enable-accelerated-video-decode-on-Linux.patch @@ -0,0 +1,43 @@ +From 54deb9811ca9bd2327def5c05ba6987b8c7a0897 Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras +Date: Tue, 29 Sep 2020 01:02:22 +0000 +Subject: [PATCH] Check for enable-accelerated-video-decode on Linux + +Video decoding was being accelerated on Linux even though the newly +added "enable-accelerated-video-decode" flag was not specified. The +chrome://gpu page was misleadingly showing this feature as disabled: + + > Video Decode: Software only. Hardware acceleration disabled + +This change adds a check for --enable-accelerated-video-decode when +considering if video decoding should be activated. (Only on Linux.) + +Extra context: https://crbug.com/1097029#c18 (and also comment 20). + +Bug: 1066176, 1097029 +Change-Id: I534115f5f6ceed0ee3511fcf5c2d0f1dd04b9b7e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431434 +Reviewed-by: John Abd-El-Malek +Reviewed-by: Dale Curtis +Commit-Queue: Ted Meyer +Cr-Commit-Position: refs/heads/master@{#811480} +--- + content/renderer/render_thread_impl.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc +index f13c94ddab7..0352f127171 100644 +--- a/content/renderer/render_thread_impl.cc ++++ b/content/renderer/render_thread_impl.cc +@@ -1121,7 +1121,11 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() { + kGpuStreamPriorityMedia); + + const bool enable_video_accelerator = ++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++ cmd_line->HasSwitch(switches::kEnableAcceleratedVideoDecode) && ++#else + !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) && ++#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) + (gpu_channel_host->gpu_feature_info() + .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] == + gpu::kGpuFeatureStatusEnabled); diff --git a/fix-invalid-end-iterator-usage-in-CookieMonster.patch b/fix-invalid-end-iterator-usage-in-CookieMonster.patch new file mode 100644 index 0000000..62abe8d --- /dev/null +++ b/fix-invalid-end-iterator-usage-in-CookieMonster.patch @@ -0,0 +1,78 @@ +From 53478caee862624fc6d73516f8d64253854b146f Mon Sep 17 00:00:00 2001 +From: Piotr Tworek +Date: Mon, 31 Aug 2020 21:03:58 +0000 +Subject: [PATCH] Fix invalid "end" iterator usage in CookieMonster. + +Commit 229623d76e8baf714c8569c9f4efc5de266cef8b has introduced the following +code in cookie_monster.cc. + +// If this is the first cookie in |cookies_| with this key, increment the +// |num_keys_| counter. +bool different_prev = + inserted == cookies_.begin() || std::prev(inserted)->first != key; +bool different_next = + inserted == cookies_.end() || std::next(inserted)->first != key; +if (different_prev && different_next) + ++num_keys_; + +The "inserted" iterator is something that has been returned from +std::multimap::insert. At first glance it looks reasonable. The code +tries to determine if there are already similar elements with the same +key in the map. Unfortunately the expression calculating the value of +different_next can potentially use the end iterator to the map. The +"inserted == cookies_.end()" part of the expression will always evaluate +to false since the newly inserted element has to be in the map and +cookies_.end() points to the first element outside the map. If the +inserted happens to be the last element in the map the second part of +the expression will grab the end iterator by calling std::next(inserted) +and then will try to use it leading to invalid memory access. + +Given the fact that cookies_ is a std::multimap we should not even need +to calculate the value of different_next. It should always be true. + + "If the container has elements with equivalent key, inserts at the + upper bound of that range.(since C++11)" + +See: https://en.cppreference.com/w/cpp/container/multimap/insert + +Bug: 1120240 +Change-Id: I8928c294ac4daf72349a2331b31b017c1d015da0 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368872 +Reviewed-by: Maksim Orlovich +Commit-Queue: Piotr Tworek +Cr-Commit-Position: refs/heads/master@{#803260} +--- + net/cookies/cookie_monster.cc | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc +index 265deed0e52..140b61a81dc 100644 +--- a/net/cookies/cookie_monster.cc ++++ b/net/cookies/cookie_monster.cc +@@ -1151,9 +1151,14 @@ CookieMonster::CookieMap::iterator CookieMonster::InternalInsertCookie( + // |num_keys_| counter. + bool different_prev = + inserted == cookies_.begin() || std::prev(inserted)->first != key; +- bool different_next = +- inserted == cookies_.end() || std::next(inserted)->first != key; +- if (different_prev && different_next) ++ // According to std::multiqueue documentation: ++ // "If the container has elements with equivalent key, inserts at the upper ++ // bound of that range. (since C++11)" ++ // This means that "inserted" iterator either points to the last element in ++ // the map, or the element succeeding it has to have different key. ++ DCHECK(std::next(inserted) == cookies_.end() || ++ std::next(inserted)->first != key); ++ if (different_prev) + ++num_keys_; + + return inserted; +@@ -1381,7 +1386,7 @@ void CookieMonster::InternalDeleteCookie(CookieMap::iterator it, + bool different_prev = + it == cookies_.begin() || std::prev(it)->first != it->first; + bool different_next = +- it == cookies_.end() || std::next(it)->first != it->first; ++ std::next(it) == cookies_.end() || std::next(it)->first != it->first; + if (different_prev && different_next) + --num_keys_; + diff --git a/intel-vp9-quirk.patch b/intel-vp9-quirk.patch deleted file mode 100644 index d39e0e2..0000000 --- a/intel-vp9-quirk.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-07-13 11:40:37.000000000 -0700 -+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-07-14 23:59:45.986297984 -0700 -@@ -1175,6 +1175,9 @@ - // allocations. - // TODO(crbug.com/911754): Enable for VP9 Profile 2. - if (IsGeminiLakeOrLater() && -+#if defined(OS_LINUX) -+ false && -+#endif - (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY || - (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX))) { - // Add one to the reference frames for the one being currently egressed, and diff --git a/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch b/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch deleted file mode 100644 index d9319a3..0000000 --- a/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7f4c7ff6b0f0e74338c885b0d5e5ef80fed597c3 Mon Sep 17 00:00:00 2001 -From: Dan Sanders -Date: Tue, 11 Aug 2020 20:38:03 +0000 -Subject: [PATCH] [media] Set allocation limit compatible with FFmpeg 4.3 - -Previously we set the limit to zero, meaning no limit, but FFmpeg 4.3 -will not allocate at all with that setting. - -Changed to std::numeric_limits::max(). - -Bug: 1095962 -Change-Id: I96820c21f794f2814e955ee75ff22dfd31804c29 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349405 -Reviewed-by: Dale Curtis -Commit-Queue: Dan Sanders -Cr-Commit-Position: refs/heads/master@{#796966} ---- - media/base/media.cc | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/media/base/media.cc b/media/base/media.cc -index c282ee49a03..11e99c238ba 100644 ---- a/media/base/media.cc -+++ b/media/base/media.cc -@@ -4,6 +4,9 @@ - - #include "media/base/media.h" - -+#include -+#include -+ - #include "base/allocator/buildflags.h" - #include "base/command_line.h" - #include "base/macros.h" -@@ -41,7 +44,7 @@ class MediaInitializer { - - #if BUILDFLAG(USE_ALLOCATOR_SHIM) - // Remove allocation limit from ffmpeg, so calls go down to shim layer. -- av_max_alloc(0); -+ av_max_alloc(std::numeric_limits::max()); - #endif // BUILDFLAG(USE_ALLOCATOR_SHIM) - - #endif // BUILDFLAG(ENABLE_FFMPEG) diff --git a/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch b/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch new file mode 100644 index 0000000..ed811bc --- /dev/null +++ b/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch @@ -0,0 +1,139 @@ +From fbd756ab55f9351165f923b0411c31dd71319c78 Mon Sep 17 00:00:00 2001 +From: Ted Meyer +Date: Wed, 16 Sep 2020 17:42:03 +0000 +Subject: [PATCH] Only fall back to the i965 driver if we're on iHD + +I got my hands on an old AMD laptop, and the gallium driver worked very +well and was saving power even at 720p, so there's no reason to block +that for now. + +Bug: 1116703 +Change-Id: Ib15bc2b93f33e99adad7569dd825e167b503a0ea +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409967 +Commit-Queue: Ted Meyer +Reviewed-by: Andres Calderon Jaramillo +Cr-Commit-Position: refs/heads/master@{#807550} +--- + media/gpu/vaapi/vaapi_wrapper.cc | 73 ++++++++++++++++++++------------ + 1 file changed, 47 insertions(+), 26 deletions(-) + +diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc +index 2ad0b997e56..e30d1dfb73b 100644 +--- a/media/gpu/vaapi/vaapi_wrapper.cc ++++ b/media/gpu/vaapi/vaapi_wrapper.cc +@@ -409,6 +409,8 @@ class VADisplayState { + + // Implementation of Initialize() called only once. + bool InitializeOnce() EXCLUSIVE_LOCKS_REQUIRED(va_lock_); ++ bool InitializeVaDisplay_Locked() EXCLUSIVE_LOCKS_REQUIRED(va_lock_); ++ bool InitializeVaDriver_Locked() EXCLUSIVE_LOCKS_REQUIRED(va_lock_); + + int refcount_ GUARDED_BY(va_lock_); + +@@ -472,11 +474,7 @@ bool VADisplayState::Initialize() { + return success; + } + +-bool VADisplayState::InitializeOnce() { +- static_assert( +- VA_MAJOR_VERSION >= 2 || (VA_MAJOR_VERSION == 1 && VA_MINOR_VERSION >= 1), +- "Requires VA-API >= 1.1.0"); +- ++bool VADisplayState::InitializeVaDisplay_Locked() { + switch (gl::GetGLImplementation()) { + case gl::kGLImplementationEGLGLES2: + va_display_ = vaGetDisplayDRM(drm_fd_.get()); +@@ -519,25 +517,10 @@ bool VADisplayState::InitializeOnce() { + return false; + } + +- // Set VA logging level and driver name, unless already set. +- constexpr char libva_log_level_env[] = "LIBVA_MESSAGING_LEVEL"; +- std::unique_ptr env(base::Environment::Create()); +- if (!env->HasVar(libva_log_level_env)) +- env->SetVar(libva_log_level_env, "1"); +- +-#if defined(USE_X11) +- if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE) { +- DCHECK(!features::IsUsingOzonePlatform()); +- constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME"; +- // TODO(crbug/1116703) The libva intel-media driver has a known segfault in +- // vaPutSurface, so until this is fixed, fall back to the i965 driver. There +- // is discussion of the issue here: +- // https://github.com/intel/media-driver/issues/818 +- if (!env->HasVar(libva_driver_impl_env)) +- env->SetVar(libva_driver_impl_env, "i965"); +- } +-#endif // USE_X11 ++ return true; ++} + ++bool VADisplayState::InitializeVaDriver_Locked() { + // The VAAPI version. + int major_version, minor_version; + VAStatus va_res = vaInitialize(va_display_, &major_version, &minor_version); +@@ -545,9 +528,6 @@ bool VADisplayState::InitializeOnce() { + LOG(ERROR) << "vaInitialize failed: " << vaErrorStr(va_res); + return false; + } +- +- va_initialized_ = true; +- + const std::string va_vendor_string = vaQueryVendorString(va_display_); + DLOG_IF(WARNING, va_vendor_string.empty()) + << "Vendor string empty or error reading."; +@@ -555,6 +535,8 @@ bool VADisplayState::InitializeOnce() { + << va_vendor_string; + implementation_type_ = VendorStringToImplementationType(va_vendor_string); + ++ va_initialized_ = true; ++ + // The VAAPI version is determined from what is loaded on the system by + // calling vaInitialize(). Since the libva is now ABI-compatible, relax the + // version check which helps in upgrading the libva, without breaking any +@@ -571,6 +553,45 @@ bool VADisplayState::InitializeOnce() { + return true; + } + ++bool VADisplayState::InitializeOnce() { ++ static_assert( ++ VA_MAJOR_VERSION >= 2 || (VA_MAJOR_VERSION == 1 && VA_MINOR_VERSION >= 1), ++ "Requires VA-API >= 1.1.0"); ++ ++ // Set VA logging level, unless already set. ++ constexpr char libva_log_level_env[] = "LIBVA_MESSAGING_LEVEL"; ++ std::unique_ptr env(base::Environment::Create()); ++ if (!env->HasVar(libva_log_level_env)) ++ env->SetVar(libva_log_level_env, "1"); ++ ++ if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked()) ++ return false; ++ ++#if defined(USE_X11) ++ if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE && ++ implementation_type_ == VAImplementation::kIntelIHD) { ++ DCHECK(!features::IsUsingOzonePlatform()); ++ constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME"; ++ // TODO(crbug/1116703) The libva intel-media driver has a known segfault in ++ // vaPutSurface, so until this is fixed, fall back to the i965 driver. There ++ // is discussion of the issue here: ++ // https://github.com/intel/media-driver/issues/818 ++ if (!env->HasVar(libva_driver_impl_env)) ++ env->SetVar(libva_driver_impl_env, "i965"); ++ ++ // Re-initialize with the new driver. ++ va_display_ = nullptr; ++ va_initialized_ = false; ++ implementation_type_ = VAImplementation::kInvalid; ++ ++ if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked()) ++ return false; ++ } ++#endif // USE_X11 ++ ++ return true; ++} ++ + VAStatus VADisplayState::Deinitialize() { + base::AutoLock auto_lock(va_lock_); + VAStatus va_res = VA_STATUS_SUCCESS; diff --git a/remove-dead-reloc-in-nonalloc-LD-flags.patch b/remove-dead-reloc-in-nonalloc-LD-flags.patch new file mode 100644 index 0000000..1adf339 --- /dev/null +++ b/remove-dead-reloc-in-nonalloc-LD-flags.patch @@ -0,0 +1,37 @@ +From 74b0cb5b86f7d7f8f7c1172d85b09096bef147b7 Mon Sep 17 00:00:00 2001 +From: Daniel Nicoara +Date: Thu, 24 Sep 2020 02:34:24 +0000 +Subject: [PATCH] Remove dead-reloc-in-nonalloc LD flags + +Breakpad change landed. Revert workaround. + +Bug: 1105559 +Test: components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/andrd --binary=out/andrd/lib.unstripped/libcontent_shell_content_view.so --symbols-dir=/tmp/foo --platform=android +Change-Id: I519534002898a97b15a57b9b87ac78ef3f216dee +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427349 +Commit-Queue: Nico Weber +Reviewed-by: Nico Weber +Cr-Commit-Position: refs/heads/master@{#810066} +--- + build/config/compiler/BUILD.gn | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index aa9eca20bd2..42839cfba3f 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -396,14 +396,6 @@ config("compiler") { + "-Wl,--as-needed", + ] + } +- if (use_lld && !is_chromeos_device) { +- # TODO(thakis): Fix dump_syms to not need this and then remove it, +- # https://crbug.com/1105559 +- ldflags += [ +- "-Wl,-z,dead-reloc-in-nonalloc=*=0", +- "-Wl,-z,dead-reloc-in-nonalloc=.debug_ranges=1", +- ] +- } + } + + # Linux-specific compiler flags setup. diff --git a/wayland-egl.patch b/wayland-egl.patch index 58a0798..34e274e 100644 --- a/wayland-egl.patch +++ b/wayland-egl.patch @@ -1,3 +1,39 @@ +--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-10-07 09:38:47.000000000 -0700 ++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-10-08 14:09:34.550174093 -0700 +@@ -698,7 +698,6 @@ + // The X11/ANGLE implementation can use |vaapi_wrapper_| to copy from an + // internal libva buffer into an X Pixmap without having to use a processing + // wrapper. +-#if !defined(USE_X11) + // If we aren't in BufferAllocationMode::kNone, we have to allocate a + // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's + // internal decoded frame. +@@ -708,6 +707,7 @@ + VaapiWrapper::kVideoProcess, VAProfileNone, + base::Bind(&ReportVaapiErrorToUMA, + "Media.VaapiVideoDecodeAccelerator.Vpp.VAAPIError")); ++#if !defined(USE_X11) + RETURN_AND_NOTIFY_ON_FAILURE(vpp_vaapi_wrapper_, + "Failed to initialize VppVaapiWrapper", + PLATFORM_FAILURE, ); +@@ -715,11 +715,15 @@ + RETURN_AND_NOTIFY_ON_FAILURE( + vpp_vaapi_wrapper_->CreateContext(gfx::Size()), + "Failed to create Context", PLATFORM_FAILURE, ); ++#else ++ if (vpp_vaapi_wrapper_) ++ vpp_vaapi_wrapper_->CreateContext(gfx::Size()); ++#endif // !defined(USE_X11) + } +- vaapi_wrapper_for_picture = vpp_vaapi_wrapper_; ++ vaapi_wrapper_for_picture = (vpp_vaapi_wrapper_)? ++ vpp_vaapi_wrapper_:vaapi_wrapper_for_picture; + } + +-#endif // !defined(USE_X11) + + for (size_t i = 0; i < buffers.size(); ++i) { + // TODO(b/139460315): Create with buffers[i] once the AMD driver issue is --- a/ui/gl/gl_image_native_pixmap.cc 2020-05-18 11:40:06.000000000 -0700 +++ b/ui/gl/gl_image_native_pixmap.cc 2020-05-22 02:07:16.007770442 -0700 @@ -288,6 +288,8 @@ -- cgit v1.2.3