Date: Wednesday, October 21, 2020 @ 03:18:44 Author: foutrelis Revision: 398685
archrelease: copy trunk to extra-x86_64 Added: chromium/repos/extra-x86_64/PKGBUILD (from rev 398684, chromium/trunk/PKGBUILD) chromium/repos/extra-x86_64/check-for-enable-accelerated-video-decode-on-Linux.patch (from rev 398684, chromium/trunk/check-for-enable-accelerated-video-decode-on-Linux.patch) chromium/repos/extra-x86_64/chromium-skia-harmony.patch (from rev 398684, chromium/trunk/chromium-skia-harmony.patch) chromium/repos/extra-x86_64/chromium.install (from rev 398684, chromium/trunk/chromium.install) chromium/repos/extra-x86_64/fix-invalid-end-iterator-usage-in-CookieMonster.patch (from rev 398684, chromium/trunk/fix-invalid-end-iterator-usage-in-CookieMonster.patch) chromium/repos/extra-x86_64/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch (from rev 398684, chromium/trunk/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch) chromium/repos/extra-x86_64/remove-dead-reloc-in-nonalloc-LD-flags.patch (from rev 398684, chromium/trunk/remove-dead-reloc-in-nonalloc-LD-flags.patch) Deleted: chromium/repos/extra-x86_64/PKGBUILD chromium/repos/extra-x86_64/check-for-enable-accelerated-video-decode-on-Linux.patch chromium/repos/extra-x86_64/chromium-skia-harmony.patch chromium/repos/extra-x86_64/chromium.install chromium/repos/extra-x86_64/fix-invalid-end-iterator-usage-in-CookieMonster.patch chromium/repos/extra-x86_64/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch chromium/repos/extra-x86_64/remove-dead-reloc-in-nonalloc-LD-flags.patch ----------------------------------------------------------+ PKGBUILD | 502 ++++++------- check-for-enable-accelerated-video-decode-on-Linux.patch | 86 +- chromium-skia-harmony.patch | 28 chromium.install | 32 fix-invalid-end-iterator-usage-in-CookieMonster.patch | 156 ++-- only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch | 278 +++---- remove-dead-reloc-in-nonalloc-LD-flags.patch | 74 - 7 files changed, 578 insertions(+), 578 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2020-10-21 03:18:35 UTC (rev 398684) +++ PKGBUILD 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,251 +0,0 @@ -# Maintainer: Evangelos Foutras <evange...@foutrelis.com> -# Contributor: Pierre Schmitz <pie...@archlinux.de> -# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> -# Contributor: Daniel J Griffiths <ghost1...@archlinux.us> - -pkgname=chromium -pkgver=86.0.4240.75 -pkgrel=1 -_launcher_ver=6 -_gcc_patchset=6 -pkgdesc="A web browser built for speed, simplicity, and security" -arch=('x86_64') -url="https://www.chromium.org/Home" -license=('BSD') -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' 'java-runtime-headless' - 'python2-setuptools') -optdepends=('pepper-flash: support for Flash content' - 'libpipewire02: WebRTC desktop sharing under Wayland' - 'libva: hardware-accelerated video decode [experimental]' - 'kdialog: needed for file dialogs in KDE' - 'org.freedesktop.secrets: password storage backend on GNOME / Xfce' - 'kwallet: for storing passwords in KWallet on KDE desktops') -install=chromium.install -source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz - chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz - https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz - 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 - chromium-skia-harmony.patch) -sha256sums=('dd7a41eda5f984e44474d7e6fb25b5df88c1c924a1a3966189f037f7d325bcb5' - '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - '6f9ab35fa2c9e6e34ec454b829b7b87adaebc10cacecd1ac1daa67035ee44aba' - '69d8b7a439db1af4713245ddf5f44ca647283ba833a8733e848033ebdaf03cdc' - '7514c6c81a64a5457b66494a366fbb39005563eecc48d1a39033dd06aec4e300' - '7cace84d7494190e7882d3e637820646ec8d64808f0a2128c515bd44991a3790' - '03d03a39b2afa40083eb8ccb9616a51619f71da92348effc8ee289cbda10128b' - '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1') - -# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py -# Keys are the names in the above script; values are the dependencies in Arch -declare -gA _system_libs=( - [ffmpeg]=ffmpeg - [flac]=flac - [fontconfig]=fontconfig - [freetype]=freetype2 - [harfbuzz-ng]=harfbuzz - [icu]=icu - [libdrm]= - [libjpeg]=libjpeg - [libpng]=libpng - #[libvpx]=libvpx - [libwebp]=libwebp - [libxml]=libxml2 - [libxslt]=libxslt - [opus]=opus - [re2]=re2 - [snappy]=snappy - [zlib]=minizip -) -_unwanted_bundled_libs=( - $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/') -) -depends+=(${_system_libs[@]}) - -# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys) -# Note: These are for Arch Linux use ONLY. For your own distribution, please -# get your own set of keys. -_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM -_google_default_client_id=413772536636.apps.googleusercontent.com -_google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4 - -prepare() { - cd "$srcdir/$pkgname-$pkgver" - - # Allow building against system libraries in official builds - sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ - tools/generate_shim_headers/generate_shim_headers.py - - # https://crbug.com/893950 - sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \ - third_party/blink/renderer/core/xml/*.cc \ - third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ - third_party/libxml/chromium/*.cc - - # 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-86-nearby-include.patch - - # https://crbug.com/skia/6663#c10 - patch -Np0 -i ../chromium-skia-harmony.patch - - # Force script incompatible with Python 3 to use /usr/bin/python2 - sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py - - mkdir -p third_party/node/linux/node-linux-x64/bin - ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ - - # Remove bundled libraries for which we will use the system copies; this - # *should* do what the remove_bundled_libraries.py script does, with the - # added benefit of not having to list all the remaining libraries - local _lib - for _lib in ${_unwanted_bundled_libs[@]}; do - find "third_party/$_lib" -type f \ - \! -path "third_party/$_lib/chromium/*" \ - \! -path "third_party/$_lib/google/*" \ - \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \ - \! -regex '.*\.\(gn\|gni\|isolate\)' \ - -delete - done - - python2 build/linux/unbundle/replace_gn_files.py \ - --system-libraries "${!_system_libs[@]}" -} - -build() { - make -C chromium-launcher-$_launcher_ver - - cd "$srcdir/$pkgname-$pkgver" - - if check_buildoption ccache y; then - # Avoid falling back to preprocessor mode when sources contain time macros - export CCACHE_SLOPPINESS=time_macros - fi - - export CC=clang - export CXX=clang++ - export AR=ar - export NM=nm - - local _flags=( - 'custom_toolchain="//build/toolchain/linux/unbundle:default"' - 'host_toolchain="//build/toolchain/linux/unbundle:default"' - 'clang_use_chrome_plugins=false' - 'is_official_build=true' # implies is_cfi=true on x86_64 - 'treat_warnings_as_errors=false' - 'fieldtrial_testing_like_official_build=true' - 'ffmpeg_branding="Chrome"' - 'proprietary_codecs=true' - 'rtc_use_pipewire=true' - 'link_pulseaudio=true' - 'use_gnome_keyring=false' - 'use_sysroot=false' - 'use_custom_libcxx=false' - 'enable_hangout_services_extension=true' - 'enable_widevine=true' - 'use_vaapi=true' - 'enable_nacl=false' - "google_api_key=\"${_google_api_key}\"" - "google_default_client_id=\"${_google_default_client_id}\"" - "google_default_client_secret=\"${_google_default_client_secret}\"" - ) - - if [[ -n ${_system_libs[icu]+set} ]]; then - _flags+=('icu_use_data_file=false') - fi - - if check_option strip y; then - _flags+=('symbol_level=0') - fi - - # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn) - CFLAGS+=' -Wno-builtin-macro-redefined' - CXXFLAGS+=' -Wno-builtin-macro-redefined' - CPPFLAGS+=' -D__DATE__= -D__TIME__= -D__TIMESTAMP__=' - - # Do not warn about unknown warning options - CFLAGS+=' -Wno-unknown-warning-option' - CXXFLAGS+=' -Wno-unknown-warning-option' - - gn gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2 - ninja -C out/Release chrome chrome_sandbox chromedriver -} - -package() { - cd chromium-launcher-$_launcher_ver - make PREFIX=/usr DESTDIR="$pkgdir" install - install -Dm644 LICENSE \ - "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher" - - cd "$srcdir/$pkgname-$pkgver" - - install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium" - install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox" - ln -s /usr/lib/chromium/chromedriver "$pkgdir/usr/bin/chromedriver" - - install -Dm644 chrome/installer/linux/common/desktop.template \ - "$pkgdir/usr/share/applications/chromium.desktop" - install -Dm644 chrome/app/resources/manpage.1.in \ - "$pkgdir/usr/share/man/man1/chromium.1" - sed -i \ - -e 's/@@MENUNAME@@/Chromium/g' \ - -e 's/@@PACKAGE@@/chromium/g' \ - -e 's/@@USR_BIN_SYMLINK_NAME@@/chromium/g' \ - "$pkgdir/usr/share/applications/chromium.desktop" \ - "$pkgdir/usr/share/man/man1/chromium.1" - - install -Dm644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \ - "$pkgdir/usr/share/metainfo/chromium.appdata.xml" - sed -ni \ - -e 's/chromium-browser\.desktop/chromium.desktop/' \ - -e '/<update_contact>/d' \ - -e '/<p>/N;/<p>\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \ - -e '/^<?xml/,$p' \ - "$pkgdir/usr/share/metainfo/chromium.appdata.xml" - - local toplevel_files=( - chrome_100_percent.pak - chrome_200_percent.pak - resources.pak - v8_context_snapshot.bin - - # ANGLE - libEGL.so - libGLESv2.so - - chromedriver - ) - - if [[ -z ${_system_libs[icu]+set} ]]; then - toplevel_files+=(icudtl.dat) - fi - - cp "${toplevel_files[@]/#/out/Release/}" "$pkgdir/usr/lib/chromium/" - install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak - install -Dm755 -t "$pkgdir/usr/lib/chromium/swiftshader" out/Release/swiftshader/*.so - - for size in 24 48 64 128 256; do - install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \ - "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png" - done - - for size in 16 32; do - install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \ - "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png" - done - - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE" -} - -# vim:set ts=2 sw=2 et: Copied: chromium/repos/extra-x86_64/PKGBUILD (from rev 398684, chromium/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,251 @@ +# Maintainer: Evangelos Foutras <evange...@foutrelis.com> +# Contributor: Pierre Schmitz <pie...@archlinux.de> +# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> +# Contributor: Daniel J Griffiths <ghost1...@archlinux.us> + +pkgname=chromium +pkgver=86.0.4240.111 +pkgrel=1 +_launcher_ver=6 +_gcc_patchset=6 +pkgdesc="A web browser built for speed, simplicity, and security" +arch=('x86_64') +url="https://www.chromium.org/Home" +license=('BSD') +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' 'java-runtime-headless' + 'python2-setuptools') +optdepends=('pepper-flash: support for Flash content' + 'libpipewire02: WebRTC desktop sharing under Wayland' + 'libva: hardware-accelerated video decode [experimental]' + 'kdialog: needed for file dialogs in KDE' + 'org.freedesktop.secrets: password storage backend on GNOME / Xfce' + 'kwallet: for storing passwords in KWallet on KDE desktops') +install=chromium.install +source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz + chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz + https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz + 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 + chromium-skia-harmony.patch) +sha256sums=('f27bdb02ebf3c48abe054c73f1ae57e22a22535ea34f5edf8693ab8432a7c717' + '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' + '6f9ab35fa2c9e6e34ec454b829b7b87adaebc10cacecd1ac1daa67035ee44aba' + '69d8b7a439db1af4713245ddf5f44ca647283ba833a8733e848033ebdaf03cdc' + '7514c6c81a64a5457b66494a366fbb39005563eecc48d1a39033dd06aec4e300' + '7cace84d7494190e7882d3e637820646ec8d64808f0a2128c515bd44991a3790' + '03d03a39b2afa40083eb8ccb9616a51619f71da92348effc8ee289cbda10128b' + '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1') + +# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py +# Keys are the names in the above script; values are the dependencies in Arch +declare -gA _system_libs=( + [ffmpeg]=ffmpeg + [flac]=flac + [fontconfig]=fontconfig + [freetype]=freetype2 + [harfbuzz-ng]=harfbuzz + [icu]=icu + [libdrm]= + [libjpeg]=libjpeg + [libpng]=libpng + #[libvpx]=libvpx + [libwebp]=libwebp + [libxml]=libxml2 + [libxslt]=libxslt + [opus]=opus + [re2]=re2 + [snappy]=snappy + [zlib]=minizip +) +_unwanted_bundled_libs=( + $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/') +) +depends+=(${_system_libs[@]}) + +# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys) +# Note: These are for Arch Linux use ONLY. For your own distribution, please +# get your own set of keys. +_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM +_google_default_client_id=413772536636.apps.googleusercontent.com +_google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4 + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + # Allow building against system libraries in official builds + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ + tools/generate_shim_headers/generate_shim_headers.py + + # https://crbug.com/893950 + sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \ + third_party/blink/renderer/core/xml/*.cc \ + third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ + third_party/libxml/chromium/*.cc + + # 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-86-nearby-include.patch + + # https://crbug.com/skia/6663#c10 + patch -Np0 -i ../chromium-skia-harmony.patch + + # Force script incompatible with Python 3 to use /usr/bin/python2 + sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py + + mkdir -p third_party/node/linux/node-linux-x64/bin + ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ + + # Remove bundled libraries for which we will use the system copies; this + # *should* do what the remove_bundled_libraries.py script does, with the + # added benefit of not having to list all the remaining libraries + local _lib + for _lib in ${_unwanted_bundled_libs[@]}; do + find "third_party/$_lib" -type f \ + \! -path "third_party/$_lib/chromium/*" \ + \! -path "third_party/$_lib/google/*" \ + \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \ + \! -regex '.*\.\(gn\|gni\|isolate\)' \ + -delete + done + + python2 build/linux/unbundle/replace_gn_files.py \ + --system-libraries "${!_system_libs[@]}" +} + +build() { + make -C chromium-launcher-$_launcher_ver + + cd "$srcdir/$pkgname-$pkgver" + + if check_buildoption ccache y; then + # Avoid falling back to preprocessor mode when sources contain time macros + export CCACHE_SLOPPINESS=time_macros + fi + + export CC=clang + export CXX=clang++ + export AR=ar + export NM=nm + + local _flags=( + 'custom_toolchain="//build/toolchain/linux/unbundle:default"' + 'host_toolchain="//build/toolchain/linux/unbundle:default"' + 'clang_use_chrome_plugins=false' + 'is_official_build=true' # implies is_cfi=true on x86_64 + 'treat_warnings_as_errors=false' + 'fieldtrial_testing_like_official_build=true' + 'ffmpeg_branding="Chrome"' + 'proprietary_codecs=true' + 'rtc_use_pipewire=true' + 'link_pulseaudio=true' + 'use_gnome_keyring=false' + 'use_sysroot=false' + 'use_custom_libcxx=false' + 'enable_hangout_services_extension=true' + 'enable_widevine=true' + 'use_vaapi=true' + 'enable_nacl=false' + "google_api_key=\"${_google_api_key}\"" + "google_default_client_id=\"${_google_default_client_id}\"" + "google_default_client_secret=\"${_google_default_client_secret}\"" + ) + + if [[ -n ${_system_libs[icu]+set} ]]; then + _flags+=('icu_use_data_file=false') + fi + + if check_option strip y; then + _flags+=('symbol_level=0') + fi + + # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn) + CFLAGS+=' -Wno-builtin-macro-redefined' + CXXFLAGS+=' -Wno-builtin-macro-redefined' + CPPFLAGS+=' -D__DATE__= -D__TIME__= -D__TIMESTAMP__=' + + # Do not warn about unknown warning options + CFLAGS+=' -Wno-unknown-warning-option' + CXXFLAGS+=' -Wno-unknown-warning-option' + + gn gen out/Release --args="${_flags[*]}" --script-executable=/usr/bin/python2 + ninja -C out/Release chrome chrome_sandbox chromedriver +} + +package() { + cd chromium-launcher-$_launcher_ver + make PREFIX=/usr DESTDIR="$pkgdir" install + install -Dm644 LICENSE \ + "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher" + + cd "$srcdir/$pkgname-$pkgver" + + install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium" + install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox" + ln -s /usr/lib/chromium/chromedriver "$pkgdir/usr/bin/chromedriver" + + install -Dm644 chrome/installer/linux/common/desktop.template \ + "$pkgdir/usr/share/applications/chromium.desktop" + install -Dm644 chrome/app/resources/manpage.1.in \ + "$pkgdir/usr/share/man/man1/chromium.1" + sed -i \ + -e 's/@@MENUNAME@@/Chromium/g' \ + -e 's/@@PACKAGE@@/chromium/g' \ + -e 's/@@USR_BIN_SYMLINK_NAME@@/chromium/g' \ + "$pkgdir/usr/share/applications/chromium.desktop" \ + "$pkgdir/usr/share/man/man1/chromium.1" + + install -Dm644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \ + "$pkgdir/usr/share/metainfo/chromium.appdata.xml" + sed -ni \ + -e 's/chromium-browser\.desktop/chromium.desktop/' \ + -e '/<update_contact>/d' \ + -e '/<p>/N;/<p>\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \ + -e '/^<?xml/,$p' \ + "$pkgdir/usr/share/metainfo/chromium.appdata.xml" + + local toplevel_files=( + chrome_100_percent.pak + chrome_200_percent.pak + resources.pak + v8_context_snapshot.bin + + # ANGLE + libEGL.so + libGLESv2.so + + chromedriver + ) + + if [[ -z ${_system_libs[icu]+set} ]]; then + toplevel_files+=(icudtl.dat) + fi + + cp "${toplevel_files[@]/#/out/Release/}" "$pkgdir/usr/lib/chromium/" + install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak + install -Dm755 -t "$pkgdir/usr/lib/chromium/swiftshader" out/Release/swiftshader/*.so + + for size in 24 48 64 128 256; do + install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \ + "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png" + done + + for size in 16 32; do + install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \ + "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png" + done + + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE" +} + +# vim:set ts=2 sw=2 et: Deleted: check-for-enable-accelerated-video-decode-on-Linux.patch =================================================================== --- check-for-enable-accelerated-video-decode-on-Linux.patch 2020-10-21 03:18:35 UTC (rev 398684) +++ check-for-enable-accelerated-video-decode-on-Linux.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,43 +0,0 @@ -From 54deb9811ca9bd2327def5c05ba6987b8c7a0897 Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras <evange...@foutrelis.com> -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 <j...@chromium.org> -Reviewed-by: Dale Curtis <dalecur...@chromium.org> -Commit-Queue: Ted Meyer <tmathme...@chromium.org> -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); Copied: chromium/repos/extra-x86_64/check-for-enable-accelerated-video-decode-on-Linux.patch (from rev 398684, chromium/trunk/check-for-enable-accelerated-video-decode-on-Linux.patch) =================================================================== --- check-for-enable-accelerated-video-decode-on-Linux.patch (rev 0) +++ check-for-enable-accelerated-video-decode-on-Linux.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,43 @@ +From 54deb9811ca9bd2327def5c05ba6987b8c7a0897 Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras <evange...@foutrelis.com> +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 <j...@chromium.org> +Reviewed-by: Dale Curtis <dalecur...@chromium.org> +Commit-Queue: Ted Meyer <tmathme...@chromium.org> +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); Deleted: chromium-skia-harmony.patch =================================================================== --- chromium-skia-harmony.patch 2020-10-21 03:18:35 UTC (rev 398684) +++ chromium-skia-harmony.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,14 +0,0 @@ ---- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2019-07-19 11:08:34.770972665 +0000 -+++ third_party/skia/src/ports/SkFontHost_FreeType.cpp 2019-07-19 11:08:44.274442065 +0000 -@@ -128,9 +128,9 @@ public: - : fGetVarDesignCoordinates(nullptr) - , fGetVarAxisFlags(nullptr) - , fLibrary(nullptr) -- , fIsLCDSupported(false) -+ , fIsLCDSupported(true) - , fLightHintingIsYOnly(false) -- , fLCDExtra(0) -+ , fLCDExtra(2) - { - if (FT_New_Library(&gFTMemory, &fLibrary)) { - return; Copied: chromium/repos/extra-x86_64/chromium-skia-harmony.patch (from rev 398684, chromium/trunk/chromium-skia-harmony.patch) =================================================================== --- chromium-skia-harmony.patch (rev 0) +++ chromium-skia-harmony.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,14 @@ +--- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2019-07-19 11:08:34.770972665 +0000 ++++ third_party/skia/src/ports/SkFontHost_FreeType.cpp 2019-07-19 11:08:44.274442065 +0000 +@@ -128,9 +128,9 @@ public: + : fGetVarDesignCoordinates(nullptr) + , fGetVarAxisFlags(nullptr) + , fLibrary(nullptr) +- , fIsLCDSupported(false) ++ , fIsLCDSupported(true) + , fLightHintingIsYOnly(false) +- , fLCDExtra(0) ++ , fLCDExtra(2) + { + if (FT_New_Library(&gFTMemory, &fLibrary)) { + return; Deleted: chromium.install =================================================================== --- chromium.install 2020-10-21 03:18:35 UTC (rev 398684) +++ chromium.install 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,16 +0,0 @@ -post_upgrade() { - if (($(vercmp $2 42.0.2311.90-1) < 0)); then - echo ':: This Chromium package no longer supports custom flags passed via the' - echo ' /etc/chromium/default file (or any other files under /etc/chromium/).' - echo - echo ' The new /usr/bin/chromium launcher script will automatically detect' - echo ' Pepper Flash (if installed) and pass the correct flags to Chromium.' - echo - echo ' If you need to pass extra command-line arguments to Chromium, you' - echo ' can put them in a "chromium-flags.conf" file under $HOME/.config/' - echo ' (or $XDG_CONFIG_HOME). Arguments are split on whitespace and shell' - echo ' quoting rules apply but no further parsing is performed.' - fi -} - -# vim:set ts=2 sw=2 et: Copied: chromium/repos/extra-x86_64/chromium.install (from rev 398684, chromium/trunk/chromium.install) =================================================================== --- chromium.install (rev 0) +++ chromium.install 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,16 @@ +post_upgrade() { + if (($(vercmp $2 42.0.2311.90-1) < 0)); then + echo ':: This Chromium package no longer supports custom flags passed via the' + echo ' /etc/chromium/default file (or any other files under /etc/chromium/).' + echo + echo ' The new /usr/bin/chromium launcher script will automatically detect' + echo ' Pepper Flash (if installed) and pass the correct flags to Chromium.' + echo + echo ' If you need to pass extra command-line arguments to Chromium, you' + echo ' can put them in a "chromium-flags.conf" file under $HOME/.config/' + echo ' (or $XDG_CONFIG_HOME). Arguments are split on whitespace and shell' + echo ' quoting rules apply but no further parsing is performed.' + fi +} + +# vim:set ts=2 sw=2 et: Deleted: fix-invalid-end-iterator-usage-in-CookieMonster.patch =================================================================== --- fix-invalid-end-iterator-usage-in-CookieMonster.patch 2020-10-21 03:18:35 UTC (rev 398684) +++ fix-invalid-end-iterator-usage-in-CookieMonster.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,78 +0,0 @@ -From 53478caee862624fc6d73516f8d64253854b146f Mon Sep 17 00:00:00 2001 -From: Piotr Tworek <ptwo...@vewd.com> -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 <morlov...@chromium.org> -Commit-Queue: Piotr Tworek <ptwo...@vewd.com> -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_; - Copied: chromium/repos/extra-x86_64/fix-invalid-end-iterator-usage-in-CookieMonster.patch (from rev 398684, chromium/trunk/fix-invalid-end-iterator-usage-in-CookieMonster.patch) =================================================================== --- fix-invalid-end-iterator-usage-in-CookieMonster.patch (rev 0) +++ fix-invalid-end-iterator-usage-in-CookieMonster.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,78 @@ +From 53478caee862624fc6d73516f8d64253854b146f Mon Sep 17 00:00:00 2001 +From: Piotr Tworek <ptwo...@vewd.com> +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 <morlov...@chromium.org> +Commit-Queue: Piotr Tworek <ptwo...@vewd.com> +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_; + Deleted: only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch =================================================================== --- only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch 2020-10-21 03:18:35 UTC (rev 398684) +++ only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,139 +0,0 @@ -From fbd756ab55f9351165f923b0411c31dd71319c78 Mon Sep 17 00:00:00 2001 -From: Ted Meyer <tmathme...@chromium.org> -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 <tmathme...@chromium.org> -Reviewed-by: Andres Calderon Jaramillo <andre...@chromium.org> -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<base::Environment> 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<base::Environment> 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; Copied: chromium/repos/extra-x86_64/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch (from rev 398684, chromium/trunk/only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch) =================================================================== --- only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch (rev 0) +++ only-fall-back-to-the-i965-driver-if-we-re-on-iHD.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,139 @@ +From fbd756ab55f9351165f923b0411c31dd71319c78 Mon Sep 17 00:00:00 2001 +From: Ted Meyer <tmathme...@chromium.org> +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 <tmathme...@chromium.org> +Reviewed-by: Andres Calderon Jaramillo <andre...@chromium.org> +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<base::Environment> 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<base::Environment> 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; Deleted: remove-dead-reloc-in-nonalloc-LD-flags.patch =================================================================== --- remove-dead-reloc-in-nonalloc-LD-flags.patch 2020-10-21 03:18:35 UTC (rev 398684) +++ remove-dead-reloc-in-nonalloc-LD-flags.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -1,37 +0,0 @@ -From 74b0cb5b86f7d7f8f7c1172d85b09096bef147b7 Mon Sep 17 00:00:00 2001 -From: Daniel Nicoara <dnico...@chromium.org> -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 <tha...@chromium.org> -Reviewed-by: Nico Weber <tha...@chromium.org> -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. Copied: chromium/repos/extra-x86_64/remove-dead-reloc-in-nonalloc-LD-flags.patch (from rev 398684, chromium/trunk/remove-dead-reloc-in-nonalloc-LD-flags.patch) =================================================================== --- remove-dead-reloc-in-nonalloc-LD-flags.patch (rev 0) +++ remove-dead-reloc-in-nonalloc-LD-flags.patch 2020-10-21 03:18:44 UTC (rev 398685) @@ -0,0 +1,37 @@ +From 74b0cb5b86f7d7f8f7c1172d85b09096bef147b7 Mon Sep 17 00:00:00 2001 +From: Daniel Nicoara <dnico...@chromium.org> +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 <tha...@chromium.org> +Reviewed-by: Nico Weber <tha...@chromium.org> +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.