summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsL1pKn072017-10-29 15:37:41 +0100
committersL1pKn072017-10-29 15:38:20 +0100
commit04610d0a894425d3e5c7f7553628640866aebdb8 (patch)
tree9e6cb9739b484c4c513b16171cdab9fa76d5089a
parent7c191bd4bd47e5ad3fafd4c1868569cf07a881f1 (diff)
downloadaur-04610d0a894425d3e5c7f7553628640866aebdb8.tar.gz
Update to 64.0.3251.0
- add preliminary support for wayland (disabled and not ready)
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD87
-rw-r--r--chromium-exclude_unwind_tables_r2.patch.patch33
-rw-r--r--chromium-gcc5-r5.patch70
-rw-r--r--chromium-intel-vaapi_r16.diff.patch673
6 files changed, 840 insertions, 48 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e5b34e007aad..a313c5213b66 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Thu Oct 26 14:41:19 UTC 2017
+# Sun Oct 29 14:10:58 UTC 2017
pkgbase = chromium-dev
pkgdesc = The open-source project behind Google Chrome (Dev Channel)
- pkgver = 63.0.3239.18
+ pkgver = 64.0.3251.0
pkgrel = 1
url = http://www.chromium.org
install = chromium-dev.install
@@ -46,28 +46,26 @@ pkgbase = chromium-dev
optdepends = libva-mesa-driver: HW video acceleration for Nouveau, R600 and RadeonSI users
optdepends = libva-intel-driver: HW video acceleration for Intel G45 and HD users
options = !strip
- source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-63.0.3239.18.tar.xz
+ source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-64.0.3251.0.tar.xz
source = git+https://github.com/foutrelis/chromium-launcher.git
source = chromium-dev.svg
source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-FORTIFY_SOURCE-r2.patch
- source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gcc5-r4.patch
+ source = chromium-gcc5-r5.patch
source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-clang-r1.patch
- source = chromium-intel-vaapi_r15.diff.base64::https://chromium-review.googlesource.com/changes/532294/revisions/15/patch?download
+ source = chromium-intel-vaapi_r16.diff.patch
source = https://raw.githubusercontent.com/sjnewbury/gentoo-playground/master/www-client/chromium/files/chromium-intel-vaapi-fix.patch
- source = chromium-webrtc-math-r1.diff.base64::https://webrtc-review.googlesource.com/changes/9384/revisions/3/patch?download
source = chromium-widevine-r1.patch
- source = chromium-exclude_unwind_tables.patch.base64::https://chromium-review.googlesource.com/changes/712575/revisions/1/patch?download
- sha256sums = f2a3657c65d06fcc95ccb1f9e4cfb5bc1996772ff0ce84affdd0bc35fbc957d2
+ source = chromium-exclude_unwind_tables_r2.patch.patch
+ sha256sums = ad19d93ced565266aa9dddeb0b2bb84c2662de6a4f8ef54db8b35af0c9edd413
sha256sums = SKIP
sha256sums = dd2b5c4191e468972b5ea8ddb4fa2e2fa3c2c94c79fc06645d0efc0e63ce7ee1
sha256sums = fa3f703d599051135c5be24b81dfcb23190bb282db73121337ac76bc9638e8a5
- sha256sums = 6f525ea6b22a432b1c2cdc2bff8482a30b76c7ada606d9f333fc7f3caf2841a3
+ sha256sums = SKIP
sha256sums = ab5368a3e3a67fa63b33fefc6788ad5b4a79089ef4db1011a14c3bee9fdf70c6
- sha256sums = cb4933db92b669696201b2866ec9b4942466a849b94b13463d8331284d09a2d1
+ sha256sums = SKIP
sha256sums = a688de2b3a7183ebf9eb25108b0d28a8c6228cc71c8e3519062a51224f5b3488
- sha256sums = c9d97359fe35224093e57a773e2b01cafd7564f82e0f783a12063e23927673da
sha256sums = 0d537830944814fe0854f834b5dc41dc5fc2428f77b2ad61d4a5e76b0fe99880
- sha256sums = d4a99239701256edb37ef3a5504fa87ca2219349834cbf59b9fe42bf7ac496d8
+ sha256sums = SKIP
pkgname = chromium-dev
diff --git a/.gitignore b/.gitignore
index 441539d1399a..f93d9413692b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,6 @@
!chromium-dev.install
!chromium-dev.svg
!chromium-widevine-r1.patch
+!chromium-gcc5-r5.patch
+!chromium-intel-vaapi_r16.diff.patch
+!chromium-exclude_unwind_tables_r2.patch.patch
diff --git a/PKGBUILD b/PKGBUILD
index b437645abc5f..5a82fbc7aa3a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,12 +12,13 @@
_use_clang=1 # Use clang compiler (downloaded binaries from google). Results in faster build and smaller chromium.
_use_ccache=0 # Use ccache when build.
_debug_mode=0 # Build in debug mode.
+_use_wayland=0 # Build Wayland NOTE: extremely experimental and don't work at this moment
##############################################
## -- Package and components information -- ##
##############################################
pkgname=chromium-dev
-pkgver=63.0.3239.18
+pkgver=64.0.3251.0
pkgrel=1
pkgdesc="The open-source project behind Google Chrome (Dev Channel)"
arch=('i686' 'x86_64')
@@ -76,15 +77,16 @@ source=( #"https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgv
'chromium-dev.svg'
# Patch form Gentoo
'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-FORTIFY_SOURCE-r2.patch'
- 'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gcc5-r4.patch'
+ 'chromium-gcc5-r5.patch'
'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-clang-r1.patch'
# Misc Patches
- 'chromium-intel-vaapi_r15.diff.base64::https://chromium-review.googlesource.com/changes/532294/revisions/15/patch?download'
+# 'chromium-intel-vaapi_r15.diff.base64::https://chromium-review.googlesource.com/changes/532294/revisions/15/patch?download'
+ 'chromium-intel-vaapi_r16.diff.patch'
'https://raw.githubusercontent.com/sjnewbury/gentoo-playground/master/www-client/chromium/files/chromium-intel-vaapi-fix.patch'
- 'chromium-webrtc-math-r1.diff.base64::https://webrtc-review.googlesource.com/changes/9384/revisions/3/patch?download' # https://webrtc-review.googlesource.com/c/src/+/9384
# Patch from crbug (chromium bugtracker) or Arch chromium package
'chromium-widevine-r1.patch'
- 'chromium-exclude_unwind_tables.patch.base64::https://chromium-review.googlesource.com/changes/712575/revisions/1/patch?download' # https://bugs.archlinux.org/task/55914
+# 'chromium-exclude_unwind_tables.patch.base64::https://chromium-review.googlesource.com/changes/712575/revisions/1/patch?download' # https://bugs.archlinux.org/task/55914
+ 'chromium-exclude_unwind_tables_r2.patch.patch'
)
sha256sums=( #"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)"
"$(curl -sL https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)"
@@ -92,15 +94,16 @@ sha256sums=( #"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/
'dd2b5c4191e468972b5ea8ddb4fa2e2fa3c2c94c79fc06645d0efc0e63ce7ee1'
# Patch form Gentoo
'fa3f703d599051135c5be24b81dfcb23190bb282db73121337ac76bc9638e8a5'
- '6f525ea6b22a432b1c2cdc2bff8482a30b76c7ada606d9f333fc7f3caf2841a3'
+ 'SKIP'
'ab5368a3e3a67fa63b33fefc6788ad5b4a79089ef4db1011a14c3bee9fdf70c6'
# Misc Patches
- 'cb4933db92b669696201b2866ec9b4942466a849b94b13463d8331284d09a2d1'
+# 'cb4933db92b669696201b2866ec9b4942466a849b94b13463d8331284d09a2d1'
+ 'SKIP'
'a688de2b3a7183ebf9eb25108b0d28a8c6228cc71c8e3519062a51224f5b3488'
- 'c9d97359fe35224093e57a773e2b01cafd7564f82e0f783a12063e23927673da'
# Patch from crbug (chromium bugtracker) or Arch chromium package
'0d537830944814fe0854f834b5dc41dc5fc2428f77b2ad61d4a5e76b0fe99880'
- 'd4a99239701256edb37ef3a5504fa87ca2219349834cbf59b9fe42bf7ac496d8'
+# 'd4a99239701256edb37ef3a5504fa87ca2219349834cbf59b9fe42bf7ac496d8'
+ 'SKIP'
)
options=('!strip')
install=chromium-dev.install
@@ -121,11 +124,11 @@ _google_default_client_secret="0ZChLK6AxeA3Isu96MkwqDR4"
# VULKAN!! (seems only build with 64 bits) # https://crbug.com/582558 NOTE: disabled by default
if [ "${CARCH}" = "i686" ]; then
_build_nacl=0
- _nacl="false"
+ _nacl=false
elif [ "${CARCH}" = "x86_64" ]; then
_build_nacl=1
- _nacl="true"
- #_vulkan=1
+ _nacl=true
+ _vulkan=0
makedepends+=('ncurses5-compat-libs')
fi
@@ -193,6 +196,7 @@ _keeplibs=(
'third_party/flatbuffers'
'third_party/flot'
'third_party/freetype'
+ 'third_party/glslang'
'third_party/glslang-angle'
'third_party/google_input_tools'
'third_party/google_input_tools/third_party/closure_library'
@@ -222,6 +226,7 @@ _keeplibs=(
'third_party/lzma_sdk'
'third_party/markupsafe'
'third_party/mesa'
+ 'third_party/metrics_proto'
'third_party/modp_b64'
'third_party/mt19937ar'
'third_party/node'
@@ -244,11 +249,13 @@ _keeplibs=(
'third_party/protobuf/third_party/six'
'third_party/qcms'
'third_party/sfntly'
+ 'third_party/shaderc'
'third_party/skia'
'third_party/skia/third_party/gif'
'third_party/skia/third_party/vulkan'
'third_party/smhasher'
'third_party/spirv-headers'
+ 'third_party/SPIRV-Tools'
'third_party/spirv-tools-angle'
'third_party/sqlite'
'third_party/swiftshader'
@@ -303,13 +310,16 @@ _flags=(
'use_custom_libcxx=false'
)
+if [ "$_wayland" = "1" ]; then
+ _flags+=(
+ 'use_ozone=true'
+ 'use_xkbcommon=true'
+ 'enable_package_mash_services=true'
+ 'enable_vulkan_wayland_client=true'
+ )
+fi
if [ "$_vulkan" = "1" ]; then
_flags+=('enable_vulkan=true')
- _keeplibs+=(
- 'third_party/SPIRV-Tools'
- 'third_party/glslang'
- 'third_party/shaderc'
- )
fi
# Enable VAAPI, see https://chromium-review.googlesource.com/532294
@@ -325,14 +335,14 @@ optdepends+=(
_use_system=(
'ffmpeg'
'flac'
-# 'freetype' # https://bugs.chromium.org/p/pdfium/issues/detail?id=733
-# 'harfbuzz-ng' # freetype and harfbuzz needs update at same time, or both or none. disable due freetype bug. link avobe
-# 'icu' # https://crbug.com/678661
+# 'freetype' # https://bugs.chromium.org/p/pdfium/issues/detail?id=733
+# 'harfbuzz-ng' # freetype and harfbuzz needs update at same time, or both or none. disable due freetype bug. link avobe
+# 'icu' # https://crbug.com/678661
'libdrm'
-# 'libevent' # Get segfaults and other problems https://bugs.gentoo.org/593458
+# 'libevent' # Get segfaults and other problems https://bugs.gentoo.org/593458
'libjpeg'
'libpng'
-# 'libvpx' # Needs update
+# 'libvpx' # Needs update
'libwebp'
'libxml'
'libxslt'
@@ -398,19 +408,17 @@ prepare() {
msg2 "Patching the sources"
# Patch sources from Gentoo.
patch -p1 -i "${srcdir}/chromium-FORTIFY_SOURCE-r2.patch"
+
# Fix build with gcc 7(?)
- patch -p1 -i "${srcdir}/chromium-gcc5-r4.patch"
- # Better support for clang
- patch -p1 -i "${srcdir}/chromium-clang-r1.patch"
+ patch -p1 -i "${srcdir}/chromium-gcc5-r5.patch"
+
# Pats to chromium dev's about why always they forget add/remove missing build rules
# Done this time :D
# Misc Patches:
- # Fail build: https://webrtc-review.googlesource.com/c/src/+/9384
- base64 -d "${srcdir}/chromium-webrtc-math-r1.diff.base64" | patch -d third_party/webrtc -p1 -i -
# https://crbug.com/710701
- _chrome_build_hash=$(curl -s https://chromium.googlesource.com/chromium/src.git/+/${pkgver}?format=TEXT | base64 -d | grep -Po '^parent \K[0-9a-f]{40}$')
+ _chrome_build_hash=$(curl -s "https://chromium.googlesource.com/chromium/src.git/+/${pkgver}?format=TEXT" | base64 -d | grep -Po '^parent \K[0-9a-f]{40}$')
if [[ -z $_chrome_build_hash ]]; then
error "Unable to fetch Chrome build hash."
return 1
@@ -424,16 +432,23 @@ prepare() {
fi
# Apply VAAPI patch
- base64 -d "${srcdir}/chromium-intel-vaapi_r15.diff.base64" | patch -p1 -i -
+ #base64 -d "${srcdir}/chromium-intel-vaapi_r15.diff.base64" | patch -p1 -i -
+ patch -p1 -i "${srcdir}/chromium-intel-vaapi_r16.diff.patch"
+ # needs generate gpu_lists_version.h by hand (?) # taked from DEPS files
+ python2 build/util/lastchange.py -m GPU_LISTS_VERSION --revision-id-only --header gpu/config/gpu_lists_version.h
# Patch from crbug (chromium bugtracker) or Arch chromium package
# https://crbug.com/473866
patch -p0 -i "${srcdir}/chromium-widevine-r1.patch"
- sed 's|@WIDEVINE_VERSION@|The Cake Is a Lie|g' -i "third_party/widevine/cdm/stub/widevine_cdm_version.h"
+ sed 's|@WIDEVINE_VERSION@|The Cake Is a Lie|g' -i third_party/widevine/cdm/stub/widevine_cdm_version.h
# https://bugs.archlinux.org/task/55914
- base64 -d "${srcdir}/chromium-exclude_unwind_tables.patch.base64" | patch -p1 -i -
+ #base64 -d "${srcdir}/chromium-exclude_unwind_tables.patch.base64" | patch -p1 -i -
+ patch -p1 -i "${srcdir}/chromium-exclude_unwind_tables_r2.patch.patch"
+
+ #Attemp to fix build https://chromium-review.googlesource.com/c/chromium/src/+/724122
+ sed '6a#include <cmath>' -i components/machine_intelligence/generic_logistic_regression_inference.cc
# Setup nodejs dependency
mkdir -p third_party/node/linux/node-linux-x64/bin/
@@ -475,7 +490,7 @@ prepare() {
if [ "${_use_ccache}" = "1" ]; then
export CCACHE_CPP2=yes
export CCACHE_SLOPPINESS=time_macros
- _ccache='ccache'
+ _ccache=ccache
_ccache_flags='-Qunused-arguments'
fi
@@ -485,10 +500,10 @@ prepare() {
'is_clang=false'
'clang_use_chrome_plugins=false'
)
- _c_compiler="gcc"
- _cpp_compiler="g++"
- CFLAGS+=" -fno-delete-null-pointer-checks"
- CXXFLAGS+=" -fno-delete-null-pointer-checks"
+ _c_compiler=gcc
+ _cpp_compiler=g++
+ CFLAGS+=' -fno-delete-null-pointer-checks'
+ CXXFLAGS+=' -fno-delete-null-pointer-checks'
}
if [ "${_use_clang}" = "0" ]; then
diff --git a/chromium-exclude_unwind_tables_r2.patch.patch b/chromium-exclude_unwind_tables_r2.patch.patch
new file mode 100644
index 000000000000..1961f15e412d
--- /dev/null
+++ b/chromium-exclude_unwind_tables_r2.patch.patch
@@ -0,0 +1,33 @@
+diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
+index ad40fd9..50e19a4 100644
+--- a/build/config/compiler/compiler.gni
++++ b/build/config/compiler/compiler.gni
+@@ -68,19 +68,19 @@
+
+ # Whether or not we should use position independent code.
+ use_pic = true
++
++ # Exclude unwind tables for official builds as unwinding can be done from
++ # stack dumps produced by Crashpad at a later time "offline" in the crash
++ # server. For unofficial (e.g. development) builds and non-Chrome branded
++ # (e.g. Cronet which doesn't use Crashpad, crbug.com/479283) builds it's
++ # useful to be able to unwind at runtime.
++ exclude_unwind_tables =
++ (is_chrome_branded && is_official_build) ||
++ (is_chromecast && !is_cast_desktop_build && !is_debug && !is_fuchsia)
+ }
+
+ assert(!is_cfi || use_thin_lto, "CFI requires ThinLTO")
+
+-# Exclude unwind tables for official builds as unwinding can be done from stack
+-# dumps produced by Crashpad at a later time "offline" in the crash server.
+-# For unofficial (e.g. development) builds and non-Chrome branded (e.g. Cronet
+-# which doesn't use Crashpad, crbug.com/479283) builds it's useful to be able
+-# to unwind at runtime.
+-exclude_unwind_tables =
+- (is_chrome_branded && is_official_build) ||
+- (is_chromecast && !is_cast_desktop_build && !is_debug && !is_fuchsia)
+-
+ # If true, optimize for size. Does not affect windows builds.
+ # Linux & Mac favor speed over size.
+ # TODO(brettw) it's weird that Mac and desktop Linux are different. We should
diff --git a/chromium-gcc5-r5.patch b/chromium-gcc5-r5.patch
new file mode 100644
index 000000000000..ffa5d05b8a21
--- /dev/null
+++ b/chromium-gcc5-r5.patch
@@ -0,0 +1,70 @@
+--- a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h
++++ b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h
+@@ -63,7 +63,7 @@ class WTF_EXPORT ArrayBufferContents {
+ allocation_length_(0),
+ data_(data),
+ data_length_(0),
+- kind_(AllocationKind::kNormal),
++ kind_(WTF::ArrayBufferContents::AllocationKind::kNormal),
+ deleter_(deleter) {}
+ DataHandle(void* allocation_base,
+ size_t allocation_length,
+@@ -94,11 +94,11 @@ class WTF_EXPORT ArrayBufferContents {
+ reinterpret_cast<uintptr_t>(allocation_base_) +
+ allocation_length_);
+ switch (kind_) {
+- case AllocationKind::kNormal:
++ case WTF::ArrayBufferContents::AllocationKind::kNormal:
+ DCHECK(deleter_);
+ deleter_(data_);
+ return;
+- case AllocationKind::kReservation:
++ case WTF::ArrayBufferContents::AllocationKind::kReservation:
+ ReleaseReservedMemory(allocation_base_, allocation_length_);
+ return;
+ }
+--- a/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc.orig 2017-08-15 12:45:59.433532111 +0000
++++ b/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc 2017-08-15 17:52:59.691328825 +0000
+@@ -10,7 +10,7 @@
+
+ #include "modules/audio_processing/aec3/aec_state.h"
+
+-#include <math.h>
++#include <cmath>
+
+ #include <numeric>
+ #include <vector>
+--- a/gpu/ipc/common/mailbox_struct_traits.h
++++ b/gpu/ipc/common/mailbox_struct_traits.h
+@@ -15,7 +15,7 @@ namespace mojo {
+ template <>
+ struct StructTraits<gpu::mojom::MailboxDataView, gpu::Mailbox> {
+ static base::span<const int8_t> name(const gpu::Mailbox& mailbox) {
+- return mailbox.name;
++ return base::make_span(mailbox.name);
+ }
+ static bool Read(gpu::mojom::MailboxDataView data, gpu::Mailbox* out);
+ };
+--- a/services/viz/public/cpp/compositing/filter_operation_struct_traits.h
++++ b/services/viz/public/cpp/compositing/filter_operation_struct_traits.h
+@@ -134,7 +134,7 @@ struct StructTraits<viz::mojom::FilterOperationDataView, cc::FilterOperation> {
+ static base::span<const float> matrix(const cc::FilterOperation& operation) {
+ if (operation.type() != cc::FilterOperation::COLOR_MATRIX)
+ return base::span<const float>();
+- return operation.matrix();
++ return base::make_span(operation.matrix());
+ }
+
+ static base::span<const gfx::Rect> shape(
+--- a/services/viz/public/cpp/compositing/quads_struct_traits.h
++++ b/services/viz/public/cpp/compositing/quads_struct_traits.h
+@@ -303,7 +303,7 @@ struct StructTraits<viz::mojom::TextureQuadStateDataView, viz::DrawQuad> {
+ static base::span<const float> vertex_opacity(const viz::DrawQuad& input) {
+ const viz::TextureDrawQuad* quad =
+ viz::TextureDrawQuad::MaterialCast(&input);
+- return quad->vertex_opacity;
++ return base::make_span(quad->vertex_opacity);
+ }
+
+ static bool y_flipped(const viz::DrawQuad& input) {
+
diff --git a/chromium-intel-vaapi_r16.diff.patch b/chromium-intel-vaapi_r16.diff.patch
new file mode 100644
index 000000000000..e3e935decda3
--- /dev/null
+++ b/chromium-intel-vaapi_r16.diff.patch
@@ -0,0 +1,673 @@
+From 7f29b44224439377592be2b75da0b86d82d8ad6d Mon Sep 17 00:00:00 2001
+From: Daniel Charles <daniel.charles@intel.com>
+Date: Wed, 18 Oct 2017 17:27:42 -0700
+Subject: [PATCH] Enable VAVDA, VAVEA and VAJDA on linux with VAAPI only
+
+This patch contains all the changes necessary to use VA-API along with
+vaapi-driver to run all media use cases supported with hardware acceleration.
+
+It is intended to remain as experimental accessible from chrome://flags on linux.
+It requires libva/intel-vaapi-driver to be installed on the system path where
+chrome is executed. Other drivers could be tested if available. Flags are
+kept independent for linux, where this feature has to be enabled before
+actually using it. This should not change how other OSes use the flags
+already, the new flags will show at the buttom on the section of unavailable
+experiments
+
+The changes cover a range of compiler pre-processor flags to enable the stack.
+It moves the presandbox operations to the vaapi_wrapper class as the hook function
+is available there. vaInit will open driver on the correct installed folder.
+
+chrome flags consolidtation into only two flags for linux. Mjpeg and accelerated
+video are used. The other flags are kept for ChromeOS and other OSes.
+
+Developer testing was made on skylake hardware, ChromeOS and Ubuntu.
+
+BUG=NONE
+TEST="subjective testing with VAVDA,VAVEA and VAJDA, autotest for encoder"
+TEST="and decoder hardware accelerated"
+TEST="have libva/intel-vaapi-driver installed and not installed in the system"
+TEST="repeat on different hardware families"
+R=posciak@chromium.org
+R=kcwu@chromium.org
+
+Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
+Change-Id: Ifbbf5c9e5221a8b5733fc6d4d0cf984a1f103171
+Signed-off-by: Daniel Charles <daniel.charles@intel.com>
+---
+
+diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
+index 3555293..4c3115f 100644
+--- a/chrome/browser/about_flags.cc
++++ b/chrome/browser/about_flags.cc
+@@ -1246,12 +1246,14 @@
+ flag_descriptions::kUiPartialSwapDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
+ #if BUILDFLAG(ENABLE_WEBRTC)
++#if !defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
+ flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
+ {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
+ flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
++#endif
+ {"enable-webrtc-hw-h264-encoding",
+ flag_descriptions::kWebrtcHwH264EncodingName,
+ flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
+@@ -1557,6 +1559,13 @@
+ flag_descriptions::kSpuriousPowerButtonLidAngleChangeDescription, kOsCrOS,
+ MULTI_VALUE_TYPE(kSpuriousPowerButtonLidAngleChangeChoices)},
+ #endif // OS_CHROMEOS
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {
++ "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
++ flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
++ },
++#else
+ {
+ "disable-accelerated-video-decode",
+ flag_descriptions::kAcceleratedVideoDecodeName,
+@@ -1564,6 +1573,7 @@
+ kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
+ },
++#endif
+ {"mojo-video-encode-accelerator",
+ flag_descriptions::kMojoVideoEncodeAcceleratorName,
+ flag_descriptions::kMojoVideoEncodeAcceleratorDescription,
+@@ -2229,12 +2239,17 @@
+ FEATURE_VALUE_TYPE(features::kWebVrVsyncAlign)},
+ #endif // OS_ANDROID
+ #endif // ENABLE_VR
+-#if defined(OS_CHROMEOS)
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {"enable-accelerated-mjpeg-decode",
++ flag_descriptions::kAcceleratedMjpegDecodeName,
++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
++#elif defined(OS_CHROMEOS)
+ {"disable-accelerated-mjpeg-decode",
+ flag_descriptions::kAcceleratedMjpegDecodeName,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
+-#endif // OS_CHROMEOS
++#endif
+ {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
+ flag_descriptions::kV8CacheOptionsDescription, kOsAll,
+ MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
+diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
+index 3815e79..d5d3712 100644
+--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
++++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
+@@ -19,6 +19,7 @@
+ #include "base/sys_info.h"
+ #include "base/timer/timer.h"
+ #include "base/values.h"
++#include "build/build_config.h"
+ #include "cc/base/switches.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/chromeos/boot_times_recorder.h"
+@@ -79,8 +80,13 @@
+ ::switches::kDisable2dCanvasImageChromium,
+ ::switches::kDisableAccelerated2dCanvas,
+ ::switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ ::switches::kEnableAcceleratedMjpegDecode,
++ ::switches::kEnableAcceleratedVideo,
++#else
+ ::switches::kDisableAcceleratedMjpegDecode,
+ ::switches::kDisableAcceleratedVideoDecode,
++#endif
+ ::switches::kDisableBlinkFeatures,
+ ::switches::kDisableCastStreamingHWEncoding,
+ ::switches::kDisableDistanceFieldText,
+@@ -166,7 +172,7 @@
+ ::switches::kDisableWebGLImageChromium,
+ ::switches::kEnableWebGLImageChromium,
+ ::switches::kEnableWebVR,
+-#if BUILDFLAG(ENABLE_WEBRTC)
++#if BUILDFLAG(ENABLE_WEBRTC) && (defined(OS_CHROMEOS) || defined(OS_ANDROID))
+ ::switches::kDisableWebRtcHWDecoding,
+ ::switches::kDisableWebRtcHWEncoding,
+ #endif
+diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
+index 74e6bc7..ab184a5 100644
+--- a/chrome/browser/flag_descriptions.cc
++++ b/chrome/browser/flag_descriptions.cc
+@@ -14,6 +14,13 @@
+ "Enables the use of the GPU to perform 2d canvas rendering instead of "
+ "using software rendering.";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++const char kAcceleratedVideoName[] = "Hardware-accelerated video";
++const char kAcceleratedVideoDescription[] =
++ "Hardware-accelerated video where VA-API driver is installed on the"
++ "system.";
++#endif
++
+ const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
+ const char kAcceleratedVideoDecodeDescription[] =
+ "Hardware-accelerated video decode where available.";
+@@ -1478,6 +1485,7 @@
+ const char kWebrtcEchoCanceller3Description[] =
+ "Experimental WebRTC echo canceller (AEC3).";
+
++#if !defined(OS_LINUX) || !defined(OS_CHROMEOS)
+ const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
+ const char kWebrtcHwDecodingDescription[] =
+ "Support in WebRTC for decoding video streams using platform hardware.";
+@@ -1485,6 +1493,7 @@
+ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
+ const char kWebrtcHwEncodingDescription[] =
+ "Support in WebRTC for encoding video streams using platform hardware.";
++#endif
+
+ const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
+ const char kWebrtcHwH264EncodingDescription[] =
+@@ -2283,14 +2292,16 @@
+
+ // Chrome OS -------------------------------------------------------------------
+
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ const char kAcceleratedMjpegDecodeName[] =
+ "Hardware-accelerated mjpeg decode for captured frame";
+ const char kAcceleratedMjpegDecodeDescription[] =
+ "Enable hardware-accelerated mjpeg decode for captured frame where "
+ "available.";
++#endif
+
++#if defined(OS_CHROMEOS)
+ const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
+ const char kAllowTouchpadThreeFingerClickDescription[] =
+ "Enables touchpad three-finger-click as middle button.";
+diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
+index 54a4950..5ace5e0 100644
+--- a/chrome/browser/flag_descriptions.h
++++ b/chrome/browser/flag_descriptions.h
+@@ -37,6 +37,10 @@
+ extern const char kAccelerated2dCanvasName[];
+ extern const char kAccelerated2dCanvasDescription[];
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++extern const char kAcceleratedVideoName[];
++extern const char kAcceleratedVideoDescription[];
++#endif
+ extern const char kAcceleratedVideoDecodeName[];
+ extern const char kAcceleratedVideoDecodeDescription[];
+
+@@ -1401,13 +1405,17 @@
+
+ #endif // defined(OS_MACOSX)
+
+-// Chrome OS ------------------------------------------------------------------
+-
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ extern const char kAcceleratedMjpegDecodeName[];
+ extern const char kAcceleratedMjpegDecodeDescription[];
+
++#endif
++
++// Chrome OS ------------------------------------------------------------------
++
++#if defined(OS_CHROMEOS)
++
+ extern const char kAllowTouchpadThreeFingerClickName[];
+ extern const char kAllowTouchpadThreeFingerClickDescription[];
+
+diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
+index 122282d..bc102a3 100644
+--- a/content/browser/gpu/compositor_util.cc
++++ b/content/browser/gpu/compositor_util.cc
+@@ -105,7 +105,11 @@
+ true},
+ {"video_decode",
+ manager->GetFeatureStatus(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
++#else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
++#endif
+ "Accelerated video decode has been disabled, either via blacklist,"
+ " about:flags or the command line.",
+ true},
+diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
+index 51aa672..963da85 100644
+--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
++++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
+@@ -717,7 +717,11 @@
+ DCHECK(command_line);
+
+ if (ShouldDisableAcceleratedVideoDecode(command_line))
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ command_line->AppendSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
++#endif
+
+ #if defined(USE_AURA)
+ if (!CanUseGpuBrowserCompositor())
+@@ -826,7 +834,12 @@
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ if (!ShouldDisableAcceleratedVideoDecode(command_line) &&
+- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ command_line->HasSwitch(switches::kEnableAcceleratedVideo)
++#else
++ !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)
++#endif
++ ) {
+ prefs->pepper_accelerated_video_decode_enabled = true;
+ }
+ }
+@@ -1016,7 +1029,13 @@
+
+ bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode(
+ const base::CommandLine* command_line) const {
+- if (command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
++ if (
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo)
++#else
++ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)
++#endif
++ ) {
+ // It was already disabled on the command line.
+ return false;
+ }
+diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
+index 95d4dff..9b26d3f 100644
+--- a/content/browser/gpu/gpu_process_host.cc
++++ b/content/browser/gpu/gpu_process_host.cc
+@@ -120,7 +124,7 @@
+ switches::kDisableLogging,
+ switches::kDisableSeccompFilterSandbox,
+ switches::kDisableShaderNameHashing,
+-#if BUILDFLAG(ENABLE_WEBRTC)
++#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_LINUX)
+ switches::kDisableWebRtcHWEncoding,
+ #endif
+ #if defined(OS_WIN)
+diff --git a/content/browser/renderer_host/media/video_capture_browsertest.cc b/content/browser/renderer_host/media/video_capture_browsertest.cc
+index 8ca0ad0..8c489d0 100644
+--- a/content/browser/renderer_host/media/video_capture_browsertest.cc
++++ b/content/browser/renderer_host/media/video_capture_browsertest.cc
+@@ -155,8 +155,13 @@
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kUseFakeJpegDecodeAccelerator);
+ } else {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ base::CommandLine::ForCurrentProcess()->AppendSwitch(
++ switches::kEnableAcceleratedMjpegDecode);
++#else
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kDisableAcceleratedMjpegDecode);
++#endif
+ }
+ if (params_.use_mojo_service) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+diff --git a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
+index 34afec23..ad77490 100644
+--- a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
++++ b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
+@@ -56,15 +56,21 @@
+ bool is_platform_supported =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeJpegDecodeAccelerator);
+-#if defined(OS_CHROMEOS)
+- // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish
+- // gpu channel to avoid introducing overhead.
++#if !defined(OS_ANDROID) && defined(OS_LINUX)
++ // Non-ChromeOS or Non-Linux platforms do not support HW JPEG decode now. Do
++ // not establish gpu channel to avoid introducing overhead.
+ is_platform_supported = true;
+ #endif
+
+ if (!is_platform_supported ||
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kEnableAcceleratedMjpegDecode)
++#else
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+- switches::kDisableAcceleratedMjpegDecode)) {
++ switches::kDisableAcceleratedMjpegDecode)
++#endif
++ ) {
+ decoder_status_ = FAILED;
+ RecordInitDecodeUMA_Locked();
+ return;
+diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
+index fbe4d21..1be295e 100644
+--- a/content/browser/renderer_host/render_process_host_impl.cc
++++ b/content/browser/renderer_host/render_process_host_impl.cc
+@@ -2506,7 +2506,11 @@
+ switches::kDefaultTileHeight,
+ switches::kDisable2dCanvasImageChromium,
+ switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo,
++#else
+ switches::kDisableAcceleratedVideoDecode,
++#endif
+ switches::kDisableBackgroundTimerThrottling,
+ switches::kDisableBreakpad,
+ switches::kDisableBrowserSideNavigation,
+@@ -2660,8 +2664,10 @@
+ switches::kDisableMojoRenderer,
+ #endif
+ #if BUILDFLAG(ENABLE_WEBRTC)
++#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+ switches::kDisableWebRtcHWDecoding,
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ switches::kEnableWebRtcSrtpAesGcm,
+ switches::kEnableWebRtcSrtpEncryptedHeaders,
+ switches::kEnableWebRtcStunOrigin,
+diff --git a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc b/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
+index 3d815a2..2c96048 100644
+--- a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
++++ b/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
+@@ -58,7 +58,12 @@
+ return;
+ // This flag is also used for encoding, https://crbug.com/616640.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+- switches::kDisableAcceleratedVideoDecode);
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo
++#else
++ switches::kDisableAcceleratedVideoDecode
++#endif
++ );
+ }
+
+ private:
+diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
+index a5424bb..b68b802 100644
+--- a/content/gpu/BUILD.gn
++++ b/content/gpu/BUILD.gn
+@@ -45,7 +45,6 @@
+ ]
+
+ configs += [ "//content:content_implementation" ]
+-
+ deps = [
+ "//base",
+ "//base/third_party/dynamic_annotations",
+@@ -114,4 +113,8 @@
+ if (enable_vulkan) {
+ deps += [ "//gpu/vulkan" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ "//media/gpu:libva_config" ]
++ }
+ }
+diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
+index 556cf00..730f4ae 100644
+--- a/content/gpu/gpu_main.cc
++++ b/content/gpu/gpu_main.cc
+@@ -254,7 +254,7 @@
+ // Initializes StatisticsRecorder which tracks UMA histograms.
+ base::StatisticsRecorder::Initialize();
+
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ // Set thread priority before sandbox initialization.
+ base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
+ #endif
+@@ -283,7 +283,7 @@
+ GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
+
+ base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ io_thread_priority = base::ThreadPriority::DISPLAY;
+ #endif
+
+diff --git a/content/public/browser/gpu_utils.cc b/content/public/browser/gpu_utils.cc
+index 6aafb06..d4ddd8d 100644
+--- a/content/public/browser/gpu_utils.cc
++++ b/content/public/browser/gpu_utils.cc
+@@ -7,6 +7,7 @@
+ #include "base/command_line.h"
+ #include "base/single_thread_task_runner.h"
+ #include "base/strings/string_number_conversions.h"
++#include "build/build_config.h"
+ #include "content/browser/gpu/gpu_process_host.h"
+ #include "content/public/common/content_features.h"
+ #include "content/public/common/content_switches.h"
+@@ -57,12 +58,19 @@
+ gpu_preferences.ui_prioritize_in_gpu_process =
+ command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
+ gpu_preferences.disable_accelerated_video_decode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
+-#if defined(OS_CHROMEOS)
++#endif
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ gpu_preferences.disable_vaapi_accelerated_video_encode =
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#elif defined(OS_CHROMEOS)
+ gpu_preferences.disable_vaapi_accelerated_video_encode =
+ command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
+ #endif
+-#if BUILDFLAG(ENABLE_WEBRTC)
++#if BUILDFLAG(ENABLE_WEBRTC) && (!defined(OS_LINUX) || defined(OS_CHROMEOS))
+ gpu_preferences.disable_web_rtc_hw_encoding =
+ command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
+ #endif
+diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
+index 4e699d1..3a7a2b7 100644
+--- a/content/public/common/content_switches.cc
++++ b/content/public/common/content_switches.cc
+@@ -89,12 +89,21 @@
+
+ // Disable gpu-accelerated 2d canvas.
+ const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";
+-
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++// Enable hardware accelerated mjpeg decode on linux
++const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
++#else
+ // Disable hardware acceleration of mjpeg decode for captured frame, where
+ // available.
+ const char kDisableAcceleratedMjpegDecode[] =
+ "disable-accelerated-mjpeg-decode";
++#endif
+
++#if defined(OS_LINUX)
++// Enables hardware acceleration of video for Linux only. VA-API driver
++// is required to be present on the system installation.
++const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
++#endif
+ // Disables hardware acceleration of video decode, where available.
+ const char kDisableAcceleratedVideoDecode[] =
+ "disable-accelerated-video-decode";
+@@ -932,11 +941,13 @@
+ // ignores this switch on its stable and beta channels.
+ const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption";
+
++#if defined(OS_CHROMEOS)
+ // Disables HW decode acceleration for WebRTC.
+ const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding";
+
+ // Disables HW encode acceleration for WebRTC.
+ const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
++#endif
+
+ // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
+ // See https://tools.ietf.org/html/rfc7714 for further information.
+diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
+index 2704924..67d00bb 100644
+--- a/content/public/common/content_switches.h
++++ b/content/public/common/content_switches.h
+@@ -35,7 +35,11 @@
+ CONTENT_EXPORT extern const char kDisable3DAPIs[];
+ CONTENT_EXPORT extern const char kDisableAccelerated2dCanvas[];
+ CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++CONTENT_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
++#else
+ CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
++#endif
+ CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
+ CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[];
+ extern const char kDisableBackingStoreLimit[];
+@@ -109,6 +113,9 @@
+ CONTENT_EXPORT extern const char kDomAutomationController[];
+ extern const char kDisable2dCanvasClipAntialiasing[];
+ CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
++#endif
+ CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
+ CONTENT_EXPORT extern const char kEnableAutomation[];
+ CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[];
+@@ -256,8 +263,10 @@
+
+ #if BUILDFLAG(ENABLE_WEBRTC)
+ CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
++#if defined(OS_CHROMEOS)
+ CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
+ CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
++#endif
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
+ CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
+diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+index 017056c..825bdce 100644
+--- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
++++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+@@ -239,10 +239,19 @@
+
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
++#endif
+ decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
+
+- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
++ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
++#endif
++ {
+ encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
+ }
+ }
+diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
+index dc01117..2f9ee03 100644
+--- a/content/renderer/render_thread_impl.cc
++++ b/content/renderer/render_thread_impl.cc
+@@ -1456,7 +1456,11 @@
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner =
+ GetMediaThreadTaskRunner();
+ const bool enable_video_accelerator =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ cmd_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
++#endif
+ const bool enable_gpu_memory_buffer_video_frames =
+ #if defined(OS_MACOSX) || defined(OS_LINUX)
+ !cmd_line->HasSwitch(switches::kDisableGpuMemoryBufferVideoFrames) &&
+diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json
+index 1289a55..22e11e5 100644
+--- a/gpu/config/software_rendering_list.json
++++ b/gpu/config/software_rendering_list.json
+@@ -374,17 +374,6 @@
+ ]
+ },
+ {
+- "id": 48,
+- "description": "Accelerated video decode is unavailable on Linux",
+- "cr_bugs": [137247],
+- "os": {
+- "type": "linux"
+- },
+- "features": [
+- "accelerated_video_decode"
+- ]
+- },
+- {
+ "id": 50,
+ "description": "Disable VMware software renderer on older Mesa",
+ "cr_bugs": [145531, 332596, 571899, 629434],
+diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn
+index 490722c..1cda2fb 100644
+--- a/media/filters/BUILD.gn
++++ b/media/filters/BUILD.gn
+@@ -189,7 +189,7 @@
+ deps += [ "//media/base/android" ]
+ }
+
+- if (current_cpu != "arm" && is_chromeos) {
++ if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) {
+ sources += [
+ "h264_bitstream_buffer.cc",
+ "h264_bitstream_buffer.h",
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index 729c6fa..4878251 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -24,6 +24,14 @@
+ import("//build/config/mac/mac_sdk.gni")
+ }
+
++if (is_desktop_linux && use_vaapi) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("libva_config") {
++ packages = [ "libva" ]
++ }
++}
++
+ if (use_vaapi) {
+ action("libva_generate_stubs") {
+ extra_header = "va_stub_header.fragment"
+@@ -334,6 +342,9 @@
+ "vaapi_drm_picture.h",
+ ]
+ }
++ if (is_desktop_linux) {
++ public_configs = [ ":libva_config" ]
++ }
+ }
+
+ if (is_win) {
+diff --git a/media/gpu/gpu_video_decode_accelerator_factory.cc b/media/gpu/gpu_video_decode_accelerator_factory.cc
+index 2cee490..de02414 100644
+--- a/media/gpu/gpu_video_decode_accelerator_factory.cc
++++ b/media/gpu/gpu_video_decode_accelerator_factory.cc
+@@ -87,6 +87,7 @@
+ // profile (instead of calculating a superset).
+ // TODO(posciak,henryhsu): improve this so that we choose a superset of
+ // resolutions and other supported profile parameters.
++ DVLOG(1) << "Get Supported profiles";
+ #if defined(OS_WIN)
+ capabilities.supported_profiles =
+ DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences,
+diff --git a/media/gpu/vaapi_wrapper.cc b/media/gpu/vaapi_wrapper.cc
+index 1e72893..6495642 100644
+--- a/media/gpu/vaapi_wrapper.cc
++++ b/media/gpu/vaapi_wrapper.cc
+@@ -1117,6 +1117,7 @@
+ if (drm_file.IsValid())
+ GetDisplayState()->SetDrmFd(drm_file.GetPlatformFile());
+ #endif
++ GetProfileInfos(); // dlopen all necessary libraries
+ }
+
+ // static