diff options
author | Samantha McVey | 2016-07-23 17:48:57 -0700 |
---|---|---|
committer | Samantha McVey | 2016-07-23 17:48:57 -0700 |
commit | 0e552eb44b69fd6b6e71fad9e4b0fa214349b400 (patch) | |
tree | ad7c16de1490ddcb532518ca615c95e2e656aeb8 | |
parent | bab213f6da7055c5492aac82a9179a131d424cd0 (diff) | |
download | aur-0e552eb44b69fd6b6e71fad9e4b0fa214349b400.tar.gz |
Update to 52.0.2743.82
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | chromium-widevine.patch | 43 | ||||
-rw-r--r-- | chromium_vaapi.patch | 895 |
4 files changed, 550 insertions, 410 deletions
@@ -1,7 +1,7 @@ pkgbase = chromium-vaapi pkgdesc = Chromium compiled with support for VA-API, allowing GPU accelerated decode of H.264 and other video formats supported by your GPU. - pkgver = 51.0.2704.106 - pkgrel = 2 + pkgver = 52.0.2743.82 + pkgrel = 1 url = http://www.chromium.org/ install = chromium.install arch = i686 @@ -46,18 +46,18 @@ pkgbase = chromium-vaapi provides = chromium conflicts = chromium options = !strip - source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-51.0.2704.106.tar.xz + source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-52.0.2743.82.tar.xz source = chromium-launcher-3.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v3.tar.gz source = chromium.desktop source = chromium-widevine.patch source = PNGImageDecoder.patch source = chromium_vaapi.patch - sha256sums = fb97a6a3119ec2c8cc4ad9a0bd6c4d306516769039a2633633f7d0c770012cfd + sha256sums = a7de6015df9cf685d68efd1e070ae9c706c723cd9395d079a7d43672a2c37eb4 sha256sums = 8b01fb4efe58146279858a754d90b49e5a38c9a0b36a1f84cbb7d12f92b84c28 sha256sums = 028a748a5c275de9b8f776f97909f999a8583a4b77fd1cd600b4fc5c0c3e91e9 - sha256sums = 4660344789c45c9b9e52cb6d86f7cb6edb297b39320d04f6947e5216d6e5f64c + sha256sums = d6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808 sha256sums = d9fd982ba6d50edb7743db6122b975ad1d3da5a9ad907c8ab7cf574395b186cd - sha256sums = 2258e5ab6ea5e06cee9d3740cf5c62ee04c41e300f6d27561c2788f78b1c70ab + sha256sums = a84baad70b205dc051ac42fcd14df0c5e069195ec326c3fd21e246bfdf052d24 pkgname = chromium-vaapi @@ -9,8 +9,8 @@ # Contributor: Daniel J Griffiths <ghost1227@archlinux.us> # pkgname=chromium-vaapi -pkgver=51.0.2704.106 -pkgrel=2 +pkgver=52.0.2743.82 +pkgrel=1 _launcher_ver=3 pkgdesc="Chromium compiled with support for VA-API, allowing GPU accelerated decode of H.264 and other video formats supported by your GPU." @@ -39,12 +39,12 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom chromium-widevine.patch PNGImageDecoder.patch chromium_vaapi.patch) -sha256sums=('fb97a6a3119ec2c8cc4ad9a0bd6c4d306516769039a2633633f7d0c770012cfd' +sha256sums=('a7de6015df9cf685d68efd1e070ae9c706c723cd9395d079a7d43672a2c37eb4' '8b01fb4efe58146279858a754d90b49e5a38c9a0b36a1f84cbb7d12f92b84c28' '028a748a5c275de9b8f776f97909f999a8583a4b77fd1cd600b4fc5c0c3e91e9' - '4660344789c45c9b9e52cb6d86f7cb6edb297b39320d04f6947e5216d6e5f64c' + 'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808' 'd9fd982ba6d50edb7743db6122b975ad1d3da5a9ad907c8ab7cf574395b186cd' - '2258e5ab6ea5e06cee9d3740cf5c62ee04c41e300f6d27561c2788f78b1c70ab') + 'a84baad70b205dc051ac42fcd14df0c5e069195ec326c3fd21e246bfdf052d24') # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # Note: These are for Arch Linux use ONLY. For your own distribution, please diff --git a/chromium-widevine.patch b/chromium-widevine.patch index 569ad4c88bfe..a67ae8b1c118 100644 --- a/chromium-widevine.patch +++ b/chromium-widevine.patch @@ -1,46 +1,3 @@ -diff -upr chromium-48.0.2564.82.orig/chrome/common/chrome_content_client.cc chromium-48.0.2564.82/chrome/common/chrome_content_client.cc ---- chromium-48.0.2564.82.orig/chrome/common/chrome_content_client.cc 2016-01-20 22:01:20.000000000 +0200 -+++ chromium-48.0.2564.82/chrome/common/chrome_content_client.cc 2016-01-21 20:02:02.788936626 +0200 -@@ -158,7 +158,12 @@ void ComputeBuiltInPlugins(std::vector<c - #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ - !defined(WIDEVINE_CDM_IS_COMPONENT) - static bool skip_widevine_cdm_file_check = false; -- if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) { -+ bool widevine_cdm_present = -+ skip_widevine_cdm_file_check || -+ (PathService::Get(chrome::FILE_WIDEVINE_CDM, &path) && -+ base::PathExists(path)); -+ if (widevine_cdm_present && -+ PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) { - if (skip_widevine_cdm_file_check || base::PathExists(path)) { - content::PepperPluginInfo widevine_cdm; - widevine_cdm.is_out_of_process = true; -diff -upr chromium-48.0.2564.82.orig/chrome/common/chrome_paths.cc chromium-48.0.2564.82/chrome/common/chrome_paths.cc ---- chromium-48.0.2564.82.orig/chrome/common/chrome_paths.cc 2016-01-20 22:01:20.000000000 +0200 -+++ chromium-48.0.2564.82/chrome/common/chrome_paths.cc 2016-01-21 19:18:51.287978456 +0200 -@@ -375,6 +375,11 @@ bool PathProvider(int key, base::FilePat - return false; - cur = cur.AppendASCII(kWidevineCdmAdapterFileName); - break; -+ case chrome::FILE_WIDEVINE_CDM: -+ if (!GetInternalPluginsDirectory(&cur)) -+ return false; -+ cur = cur.AppendASCII(kWidevineCdmFileName); -+ break; - #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) - case chrome::FILE_RESOURCES_PACK: - #if defined(OS_MACOSX) && !defined(OS_IOS) -diff -upr chromium-48.0.2564.82.orig/chrome/common/chrome_paths.h chromium-48.0.2564.82/chrome/common/chrome_paths.h ---- chromium-48.0.2564.82.orig/chrome/common/chrome_paths.h 2016-01-14 03:49:22.000000000 +0200 -+++ chromium-48.0.2564.82/chrome/common/chrome_paths.h 2016-01-21 19:18:51.287978456 +0200 -@@ -99,6 +99,7 @@ enum { - DIR_COMPONENT_WIDEVINE_CDM, // Directory that contains component-updated - // Widevine CDM files. - FILE_WIDEVINE_CDM_ADAPTER, // Full path to the Widevine CDM adapter file. -+ FILE_WIDEVINE_CDM, // Full path to the Widevine CDM file. - FILE_RESOURCES_PACK, // Full path to the .pak file containing - // binary data (e.g., html files and images - // used by internal pages). diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h --- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-14 01:05:17.000000000 +0200 +++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-21 19:18:51.287978456 +0200 diff --git a/chromium_vaapi.patch b/chromium_vaapi.patch index f44316e10ef7..1a92b39ad707 100644 --- a/chromium_vaapi.patch +++ b/chromium_vaapi.patch @@ -1,16 +1,15 @@ -Description: -Enables using VA-API hardware acceleration in Linux. The patch for bpf_gpu_policy_linux.cc initially came from https://codereview.chromium.org/15955009/diff/92001/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +Originally from https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/master/debian/patches/enable_vaapi_on_linux.diff +Thanks to Saikrishna Arcot (saiarcot895) -Taken from: -https://code.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.wily.dev -And rebased against chromium-dev 51.0.2704.63 sources. - --------- +Refactored for Chromium 52 by Samantha McVey (samcv) samantham@posteo.net + +Description: Enables using VA-API hardware acceleration in Linux. The patch for bpf_gpu_policy_linux.cc initially came from https://codereview.chromium.org/15955009/diff/92001/content/common/sandbox_linux/bpf_gpu_policy_linux.cc. -diff -uar chromium-51.0.2704.63.orig/chrome/browser/about_flags.cc chromium-51.0.2704.63/chrome/browser/about_flags.cc ---- chromium-51.0.2704.63.orig/chrome/browser/about_flags.cc 2016-05-25 21:00:57.000000000 +0200 -+++ chromium-51.0.2704.63/chrome/browser/about_flags.cc 2016-05-26 09:45:41.205615406 +0200 -@@ -843,7 +843,7 @@ +Index: dev/chrome/browser/about_flags.cc +=================================================================== +--- dev.orig/chrome/browser/about_flags.cc ++++ dev/chrome/browser/about_flags.cc +@@ -866,7 +866,7 @@ const FeatureEntry kFeatureEntries[] = { "disable-accelerated-video-decode", IDS_FLAGS_ACCELERATED_VIDEO_DECODE_NAME, IDS_FLAGS_ACCELERATED_VIDEO_DECODE_DESCRIPTION, @@ -19,267 +18,126 @@ diff -uar chromium-51.0.2704.63.orig/chrome/browser/about_flags.cc chromium-51.0 SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), }, #if defined(USE_ASH) -diff -uar chromium-51.0.2704.63.orig/content/common/BUILD.gn chromium-51.0.2704.63/content/common/BUILD.gn ---- chromium-51.0.2704.63.orig/content/common/BUILD.gn 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/BUILD.gn 2016-05-26 09:45:41.207615638 +0200 -@@ -11,7 +11,7 @@ +Index: dev/content/common/BUILD.gn +=================================================================== +--- dev.orig/content/common/BUILD.gn ++++ dev/content/common/BUILD.gn +@@ -11,6 +11,49 @@ if (is_mac) { import("//build/config/mac/mac_sdk.gni") } --if (is_chromeos && current_cpu != "arm") { -+if (is_linux && !(is_chromeos && current_cpu == "arm")) { - action("libva_generate_stubs") { - extra_header = "gpu/media/va_stub_header.fragment" - -@@ -347,7 +347,7 @@ - } - } - -- if (is_chromeos) { -+ if (is_linux) { - sources += [ - "gpu/media/accelerated_video_decoder.h", - "gpu/media/h264_decoder.cc", -@@ -392,13 +392,13 @@ - "GLESv2", - ] - } -- if (current_cpu == "arm") { -+ if (current_cpu == "arm" && is_chromeos) { - sources += [ - "gpu/media/tegra_v4l2_device.cc", - "gpu/media/tegra_v4l2_device.h", - ] - } -- if (current_cpu != "arm") { -+ if (current_cpu != "arm" || !is_chromeos) { - sources += [ - "gpu/media/va_surface.h", - "gpu/media/vaapi_jpeg_decode_accelerator.cc", -diff -uar chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator.cc ---- chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator.cc 2016-05-26 09:45:41.208615755 +0200 -@@ -57,7 +57,7 @@ - return true; - } - --#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) || defined(OS_LINUX) - static bool BindImage(const base::WeakPtr<gpu::GpuCommandBufferStub>& stub, - uint32_t client_texture_id, - uint32_t texture_target, -@@ -169,7 +169,7 @@ - get_gl_context_cb_ = base::Bind(&GetGLContext, stub_->AsWeakPtr()); - make_context_current_cb_ = - base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr()); --#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) || defined(OS_LINUX) - bind_image_cb_ = base::Bind(&BindImage, stub_->AsWeakPtr()); - #endif - get_gles2_decoder_cb_ = base::Bind(&GetGLES2Decoder, stub_->AsWeakPtr()); -diff -uar chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc ---- chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc 2016-05-26 09:45:41.208615755 +0200 -@@ -13,14 +13,14 @@ - #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" - #elif defined(OS_MACOSX) - #include "content/common/gpu/media/vt_video_decode_accelerator_mac.h" --#elif defined(OS_CHROMEOS) -+#elif defined(OS_CHROMEOS) || defined(OS_LINUX) - #if defined(USE_V4L2_CODEC) - #include "content/common/gpu/media/v4l2_device.h" - #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" - #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" - #include "ui/gl/gl_surface_egl.h" - #endif --#if defined(ARCH_CPU_X86_FAMILY) -+#if defined(ARCH_CPU_X86_FAMILY) || defined(OS_LINUX) - #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" - #include "ui/gl/gl_implementation.h" - #endif -@@ -78,7 +78,7 @@ - #if defined(OS_WIN) - capabilities.supported_profiles = - DXVAVideoDecodeAccelerator::GetSupportedProfiles(); --#elif defined(OS_CHROMEOS) -+#elif defined(OS_CHROMEOS) || defined(OS_LINUX) - media::VideoDecodeAccelerator::SupportedProfiles vda_profiles; - #if defined(USE_V4L2_CODEC) - vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); -@@ -88,7 +88,7 @@ - media::GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( - vda_profiles, &capabilities.supported_profiles); - #endif --#if defined(ARCH_CPU_X86_FAMILY) -+#if defined(ARCH_CPU_X86_FAMILY) || defined(OS_LINUX) - vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles(); - media::GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles( - vda_profiles, &capabilities.supported_profiles); -@@ -129,7 +129,7 @@ - &GpuVideoDecodeAcceleratorFactoryImpl::CreateV4L2VDA, - &GpuVideoDecodeAcceleratorFactoryImpl::CreateV4L2SVDA, - #endif --#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_LINUX) - &GpuVideoDecodeAcceleratorFactoryImpl::CreateVaapiVDA, - #endif - #if defined(OS_MACOSX) -@@ -194,10 +194,11 @@ - } - #endif - --#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_LINUX) - scoped_ptr<media::VideoDecodeAccelerator> - GpuVideoDecodeAcceleratorFactoryImpl::CreateVaapiVDA( - const gpu::GpuPreferences& gpu_preferences) const { -+ VLOG(1) << "Creating new VAAPI video decode accelerator."; - scoped_ptr<media::VideoDecodeAccelerator> decoder; - decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_cb_, - bind_image_cb_)); -diff -uar chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h ---- chromium-51.0.2704.63.orig/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h 2016-05-26 09:45:41.208615755 +0200 -@@ -95,7 +95,7 @@ - scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SVDA( - const gpu::GpuPreferences& gpu_preferences) const; - #endif --#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_LINUX) - scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA( - const gpu::GpuPreferences& gpu_preferences) const; - #endif -diff -uar chromium-51.0.2704.63.orig/content/common/gpu/media/vaapi_video_decode_accelerator.cc chromium-51.0.2704.63/content/common/gpu/media/vaapi_video_decode_accelerator.cc ---- chromium-51.0.2704.63.orig/content/common/gpu/media/vaapi_video_decode_accelerator.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/gpu/media/vaapi_video_decode_accelerator.cc 2016-05-26 09:45:41.209615872 +0200 -@@ -337,17 +337,17 @@ - - base::AutoLock auto_lock(lock_); - DCHECK_EQ(state_, kUninitialized); -- DVLOG(2) << "Initializing VAVDA, profile: " << profile; -+ VLOG(1) << "Initializing VAVDA, profile: " << profile; - - #if defined(USE_X11) - if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { -- DVLOG(1) << "HW video decode acceleration not available without " -+ VLOG(1) << "HW video decode acceleration not available without " - "DesktopGL (GLX)."; - return false; - } - #elif defined(USE_OZONE) - if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { -- DVLOG(1) << "HW video decode acceleration not available without " -+ VLOG(1) << "HW video decode acceleration not available without " - << "EGLGLES2."; - return false; - } -@@ -357,7 +357,7 @@ - VaapiWrapper::kDecode, profile, base::Bind(&ReportToUMA, VAAPI_ERROR)); - - if (!vaapi_wrapper_.get()) { -- DVLOG(1) << "Failed initializing VAAPI for profile " << profile; -+ VLOG(1) << "Failed initializing VAAPI for profile " << profile; - return false; - } - -@@ -374,7 +374,7 @@ - vp9_accelerator_.reset(new VaapiVP9Accelerator(this, vaapi_wrapper_.get())); - decoder_.reset(new VP9Decoder(vp9_accelerator_.get())); ++if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") { ++ action("libva_generate_stubs") { ++ extra_header = "../../media/gpu/va_stub_header.fragment" ++ ++ script = "../../tools/generate_stubs/generate_stubs.py" ++ sources = [ ++ "../../media/gpu/va.sigs", ++ ] ++ inputs = [ ++ extra_header, ++ ] ++ sources += [ "../../media/gpu/va_x11.sigs" ] ++ if (use_ozone) { ++ sources += [ ++ "../../media/gpu/va_drm.sigs", ++ "va_wayland.sigs", ++ ] ++ } ++ stubs_filename_root = "va_stubs" ++ ++ outputs = [ ++ "$target_gen_dir/$stubs_filename_root.cc", ++ "$target_gen_dir/$stubs_filename_root.h", ++ ] ++ args = [ ++ "-i", ++ rebase_path("$target_gen_dir", root_build_dir), ++ "-o", ++ rebase_path("$target_gen_dir", root_build_dir), ++ "-t", ++ "posix_stubs", ++ "-e", ++ rebase_path(extra_header, root_build_dir), ++ "-s", ++ stubs_filename_root, ++ "-p", ++ "content/common", ++ ] ++ ++ args += rebase_path(sources, root_build_dir) ++ } ++} ++ + source_set("common") { + # Targets external to content should always link to the public API. + # In addition, targets outside of the content component (shell and tests) +@@ -178,6 +221,15 @@ source_set("common") { + + if (use_seccomp_bpf) { + defines += [ "USE_SECCOMP_BPF" ] ++ if (current_cpu != "arm" && is_desktop_linux) { ++ sources += get_target_outputs(":libva_generate_stubs") ++ deps += [ ":libva_generate_stubs" ] ++ configs += [ "//third_party/libva:libva_config" ] ++ if (use_ozone) { ++ configs += [ "//build/config/linux:x11" ] ++ deps += [ "//third_party/wayland:wayland_client" ] ++ } ++ } } else { -- DLOG(ERROR) << "Unsupported profile " << profile; -+ VLOG(1) << "Unsupported profile " << profile; - return false; - } - -diff -uar chromium-51.0.2704.63.orig/content/common/gpu/media/vaapi_wrapper.cc chromium-51.0.2704.63/content/common/gpu/media/vaapi_wrapper.cc ---- chromium-51.0.2704.63.orig/content/common/gpu/media/vaapi_wrapper.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/gpu/media/vaapi_wrapper.cc 2016-05-26 09:45:41.209615872 +0200 -@@ -186,7 +186,7 @@ - VAProfile va_profile, - const base::Closure& report_error_to_uma_cb) { - if (!profile_infos_.Get().IsProfileSupported(mode, va_profile)) { -- DVLOG(1) << "Unsupported va_profile: " << va_profile; -+ VLOG(1) << "Unsupported va_profile: " << va_profile; - return nullptr; - } - -@@ -341,15 +341,17 @@ - bool VaapiWrapper::VaInitialize(const base::Closure& report_error_to_uma_cb) { - static bool vaapi_functions_initialized = PostSandboxInitialization(); - if (!vaapi_functions_initialized) { -- bool running_on_chromeos = false; --#if defined(OS_CHROMEOS) -+ bool error_level_logging = false; -+#if defined(OS_LINUX) -+ error_level_logging = true; -+#elif defined(OS_CHROMEOS) - // When chrome runs on linux with chromeos=1, do not log error message - // without VAAPI libraries. -- running_on_chromeos = base::SysInfo::IsRunningOnChromeOS(); -+ error_level_logging = base::SysInfo::IsRunningOnChromeOS(); - #endif - static const char kErrorMsg[] = "Failed to initialize VAAPI libs"; -- if (running_on_chromeos) -- LOG(ERROR) << kErrorMsg; -+ if (error_level_logging) -+ VLOG(1) << kErrorMsg; - else - DVLOG(1) << kErrorMsg; - return false; -@@ -417,7 +419,7 @@ - if (std::find(supported_entrypoints.begin(), - supported_entrypoints.end(), - entrypoint) == supported_entrypoints.end()) { -- DVLOG(1) << "Unsupported entrypoint"; -+ VLOG(1) << "Unsupported entrypoint"; - return false; - } - return true; -@@ -441,8 +443,8 @@ - if (attribs[i].type != required_attribs[i].type || - (attribs[i].value & required_attribs[i].value) != - required_attribs[i].value) { -- DVLOG(1) << "Unsupported value " << required_attribs[i].value -- << " for attribute type " << required_attribs[i].type; -+ VLOG(1) << "Unsupported value " << required_attribs[i].value -+ << " for attribute type " << required_attribs[i].type; - return false; - } - } -diff -uar chromium-51.0.2704.63.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc chromium-51.0.2704.63/content/common/sandbox_linux/bpf_gpu_policy_linux.cc ---- chromium-51.0.2704.63.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2016-05-26 09:45:41.210615989 +0200 -@@ -22,6 +22,8 @@ + if (is_linux) { + sources -= [ +Index: dev/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +=================================================================== +--- dev.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc ++++ dev/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +@@ -23,6 +23,12 @@ #include "base/macros.h" - #include "base/memory/scoped_ptr.h" + #include "base/memory/ptr_util.h" #include "build/build_config.h" ++ ++#if !defined(__arm__) +// Auto-generated for dlopen libva libraries -+#include "content/common/gpu/media/va_stubs.h" ++#include "content/common/va_stubs.h" ++#endif ++ #include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h" #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" #include "content/common/set_process_title.h" -@@ -32,6 +34,8 @@ - #include "sandbox/linux/syscall_broker/broker_file_permission.h" +@@ -34,6 +40,14 @@ #include "sandbox/linux/syscall_broker/broker_process.h" #include "sandbox/linux/system_headers/linux_syscalls.h" + ++#if !defined(__arm__) +#include "third_party/libva/va/va.h" +#include "third_party/libva/va/va_x11.h" - ++#if defined(USE_OZONE) ++#include "third_party/libva/va/wayland/va_wayland.h" ++#endif ++#endif ++ using sandbox::arch_seccomp_data; using sandbox::bpf_dsl::Allow; -@@ -41,6 +45,11 @@ + using sandbox::bpf_dsl::ResultExpr; +@@ -42,6 +56,16 @@ using sandbox::syscall_broker::BrokerFil using sandbox::syscall_broker::BrokerProcess; using sandbox::SyscallSets; -+using content_common_gpu_media::kModuleVa; -+using content_common_gpu_media::kModuleVa_x11; -+using content_common_gpu_media::InitializeStubs; -+using content_common_gpu_media::StubPathMap; ++#if !defined(__arm__) ++using content_common::kModuleVa; ++using content_common::kModuleVa_x11; ++#if defined(USE_OZONE) ++using content_common::kModuleVa_drm; ++#endif ++using content_common::InitializeStubs; ++using content_common::StubPathMap; ++#endif + namespace content { namespace { -@@ -95,7 +104,7 @@ +@@ -96,7 +120,7 @@ inline bool UseLibV4L2() { bool IsAcceleratedVaapiVideoEncodeEnabled() { bool accelerated_encode_enabled = false; @@ -288,32 +146,40 @@ diff -uar chromium-51.0.2704.63.orig/content/common/sandbox_linux/bpf_gpu_policy const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); accelerated_encode_enabled = -@@ -295,32 +304,46 @@ +@@ -297,32 +321,72 @@ bool GpuProcessPolicy::PreSandboxHook() GpuBrokerProcessPolicy::Create, std::vector<BrokerFilePermission>()); // No extra files in whitelist. -- if (IsArchitectureX86_64() || IsArchitectureI386()) { -+ if (true) { ++#if !defined(__arm__) + if (IsArchitectureX86_64() || IsArchitectureI386()) { // Accelerated video dlopen()'s some shared objects // inside the sandbox, so preload them now. if (IsAcceleratedVaapiVideoEncodeEnabled() || IsAcceleratedVideoDecodeEnabled()) { - const char* I965DrvVideoPath = NULL; - const char* I965HybridDrvVideoPath = NULL; +- +- if (IsArchitectureX86_64()) { +- I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; +- I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; +- } else if (IsArchitectureI386()) { +- I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; + VLOG(1) << "Attempting to enable hardware video acceleration."; + StubPathMap paths; + paths[kModuleVa].push_back("libva.so.1"); + paths[kModuleVa_x11].push_back("libva-x11.so.1"); ++#if defined(USE_OZONE) ++ paths[kModuleVa_drm].push_back("libva-drm.so.1"); ++#endif + if (!InitializeStubs(paths)) { -+ VLOG(1) << "Failed to initialize stubs"; -+ return false; -+ } ++ LOG(WARNING) << "Failed to initialize stubs"; ++ return true; + } -- if (IsArchitectureX86_64()) { -- I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; -- I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; -- } else if (IsArchitectureI386()) { -- I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; +- dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); +- if (I965HybridDrvVideoPath) +- dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); +- dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); + // libva drivers won't get loaded even above two libraries get dlopened. + // Thus, libva calls will fail after post sandbox stage. + // @@ -325,117 +191,104 @@ diff -uar chromium-51.0.2704.63.orig/content/common/sandbox_linux/bpf_gpu_policy + // Fortunately, the va driver will be loadded when vaInitialize() get + // called. + // So the following code is to call vaInitialize() before sandboxing. -+ Display* x_display = XOpenDisplay(NULL); -+ VADisplay va_display = vaGetDisplay(x_display); -+ if (!vaDisplayIsValid(va_display)) { -+ VLOG(1) << "Failed to call vaGetDisplay()"; -+ return false; - } - -- dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); -- if (I965HybridDrvVideoPath) -- dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); -- dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); --#if defined(USE_OZONE) ++ ++ VADisplay va_display = NULL; + #if defined(USE_OZONE) - dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); -#elif defined(USE_X11) - dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); --#endif -- } -- } ++ struct wl_display* wayland_display = wl_display_connect(NULL); ++ if (wayland_display) { ++ va_display = vaGetDisplayWl(wayland_display); ++ if (!vaDisplayIsValid(va_display)) { ++ LOG(WARNING) << "Failed to call vaGetDisplayWl()"; ++ va_display = NULL; ++ } ++ } else { ++ LOG(WARNING) << "Failed to find Wayland display"; ++ } ++#endif ++ ++ if (!va_display) { ++ Display* x_display = XOpenDisplay(NULL); ++ if (!x_display) { ++ LOG(WARNING) << "Failed to find X-Display"; ++ return true; ++ } ++ va_display = vaGetDisplay(x_display); ++ if (!vaDisplayIsValid(va_display)) { ++ LOG(WARNING) << "Failed to call vaGetDisplay()"; ++ return true; ++ } ++ } ++ + int major_version, minor_version; + if (vaInitialize(va_display, &major_version, &minor_version) + != VA_STATUS_SUCCESS) { -+ VLOG(1) << "Failed to call vaInitialize()"; -+ return false; ++ LOG(WARNING) << "Failed to call vaInitialize()"; ++ return true; + } + } // end of IsAcceleratedVaapiVideoEncodeEnabled() || IsAcceleratedVideoDecodeEnabled() -+ } // end of true ++ } // end of IsArchitectureX86_64() || IsArchitectureI386() + #endif +- } +- } return true; } -diff -uar chromium-51.0.2704.63.orig/content/content_common.gypi chromium-51.0.2704.63/content/content_common.gypi ---- chromium-51.0.2704.63.orig/content/content_common.gypi 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/content_common.gypi 2016-05-26 09:45:41.210615989 +0200 -@@ -790,7 +790,7 @@ - }, - ], - }], -- ['chromeos==1', { -+ ['chromeos==1 or desktop_linux==1', { - 'sources': [ - 'common/gpu/media/accelerated_video_decoder.h', - 'common/gpu/media/h264_decoder.cc', -@@ -846,7 +846,7 @@ - 'common/gpu/media/tegra_v4l2_device.h', - ], - }], -- ['target_arch != "arm" and chromeos == 1', { -+ ['(target_arch != "arm" and chromeos == 1) or desktop_linux == 1', { - 'dependencies': [ - '../media/media.gyp:media', - '../third_party/libyuv/libyuv.gyp:libyuv', -diff -uar chromium-51.0.2704.63.orig/content/content_gpu.gypi chromium-51.0.2704.63/content/content_gpu.gypi ---- chromium-51.0.2704.63.orig/content/content_gpu.gypi 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/content_gpu.gypi 2016-05-26 09:45:41.210615989 +0200 -@@ -45,7 +45,7 @@ +Index: dev/content/content_gpu.gypi +=================================================================== +--- dev.orig/content/content_gpu.gypi ++++ dev/content/content_gpu.gypi +@@ -49,7 +49,7 @@ ], }, }], - ['target_arch!="arm" and chromeos == 1', { -+ ['(target_arch!="arm" and chromeos == 1) or desktop_linux == 1', { ++ ['target_arch!="arm" and (chromeos == 1 or desktop_linux == 1)', { 'include_dirs': [ '<(DEPTH)/third_party/libva', ], -diff -uar chromium-51.0.2704.63.orig/content/content_tests.gypi chromium-51.0.2704.63/content/content_tests.gypi ---- chromium-51.0.2704.63.orig/content/content_tests.gypi 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/content_tests.gypi 2016-05-26 09:45:41.211616106 +0200 -@@ -1729,7 +1729,7 @@ - }, - ] - }], -- ['chromeos==1 and target_arch != "arm"', { -+ ['desktop_linux==1 or (chromeos==1 and target_arch != "arm")', { - 'targets': [ - { - 'target_name': 'vaapi_jpeg_decoder_unittest', -diff -uar chromium-51.0.2704.63.orig/content/gpu/BUILD.gn chromium-51.0.2704.63/content/gpu/BUILD.gn ---- chromium-51.0.2704.63.orig/content/gpu/BUILD.gn 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/gpu/BUILD.gn 2016-05-26 09:45:41.229618219 +0200 -@@ -81,7 +81,7 @@ +Index: dev/content/gpu/BUILD.gn +=================================================================== +--- dev.orig/content/gpu/BUILD.gn ++++ dev/content/gpu/BUILD.gn +@@ -86,7 +86,7 @@ source_set("gpu_sources") { ] } - if (is_chromeos && current_cpu != "arm") { -+ if ((is_chromeos && current_cpu != "arm") || is_linux) { ++ if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") { configs += [ "//third_party/libva:libva_config" ] } -diff -uar chromium-51.0.2704.63.orig/content/gpu/gpu_main.cc chromium-51.0.2704.63/content/gpu/gpu_main.cc ---- chromium-51.0.2704.63.orig/content/gpu/gpu_main.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/gpu/gpu_main.cc 2016-05-26 09:45:41.240619514 +0200 -@@ -74,7 +74,7 @@ +Index: dev/content/gpu/gpu_main.cc +=================================================================== +--- dev.orig/content/gpu/gpu_main.cc ++++ dev/content/gpu/gpu_main.cc +@@ -75,7 +75,7 @@ #include "content/common/sandbox_mac.h" #endif -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_LINUX) - #include "content/common/gpu/media/vaapi_wrapper.h" ++#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY) + #include "media/gpu/vaapi_wrapper.h" #endif -@@ -245,7 +245,7 @@ +@@ -252,7 +252,7 @@ int GpuMain(const MainFunctionParams& pa GetGpuInfoFromCommandLine(gpu_info, command_line); gpu_info.in_process_gpu = false; -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) -+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_LINUX) - VaapiWrapper::PreSandboxInitialization(); ++#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY) + media::VaapiWrapper::PreSandboxInitialization(); #endif -diff -uar chromium-51.0.2704.63.orig/content/public/common/content_switches.cc chromium-51.0.2704.63/content/public/common/content_switches.cc ---- chromium-51.0.2704.63.orig/content/public/common/content_switches.cc 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/public/common/content_switches.cc 2016-05-26 09:45:41.240619514 +0200 -@@ -957,7 +957,9 @@ +Index: dev/content/public/common/content_switches.cc +=================================================================== +--- dev.orig/content/public/common/content_switches.cc ++++ dev/content/public/common/content_switches.cc +@@ -970,7 +970,9 @@ const char kDisableAudioSupportForDeskto #if defined(OS_CHROMEOS) // Disables panel fitting (used for mirror mode). const char kDisablePanelFitting[] = "disable-panel-fitting"; @@ -445,10 +298,11 @@ diff -uar chromium-51.0.2704.63.orig/content/public/common/content_switches.cc c // Disables VA-API accelerated video encode. const char kDisableVaapiAcceleratedVideoEncode[] = "disable-vaapi-accelerated-video-encode"; -diff -uar chromium-51.0.2704.63.orig/content/public/common/content_switches.h chromium-51.0.2704.63/content/public/common/content_switches.h ---- chromium-51.0.2704.63.orig/content/public/common/content_switches.h 2016-05-25 21:01:01.000000000 +0200 -+++ chromium-51.0.2704.63/content/public/common/content_switches.h 2016-05-26 09:45:41.241619632 +0200 -@@ -274,6 +274,8 @@ +Index: dev/content/public/common/content_switches.h +=================================================================== +--- dev.orig/content/public/common/content_switches.h ++++ dev/content/public/common/content_switches.h +@@ -278,6 +278,8 @@ CONTENT_EXPORT extern const char kEnable #if defined(OS_CHROMEOS) CONTENT_EXPORT extern const char kDisablePanelFitting[]; @@ -457,10 +311,11 @@ diff -uar chromium-51.0.2704.63.orig/content/public/common/content_switches.h ch CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[]; #endif -diff -uar chromium-51.0.2704.63.orig/gpu/config/software_rendering_list_json.cc chromium-51.0.2704.63/gpu/config/software_rendering_list_json.cc ---- chromium-51.0.2704.63.orig/gpu/config/software_rendering_list_json.cc 2016-05-25 21:01:02.000000000 +0200 -+++ chromium-51.0.2704.63/gpu/config/software_rendering_list_json.cc 2016-05-26 09:45:41.256621394 +0200 -@@ -484,17 +484,6 @@ +Index: dev/gpu/config/software_rendering_list_json.cc +=================================================================== +--- dev.orig/gpu/config/software_rendering_list_json.cc ++++ dev/gpu/config/software_rendering_list_json.cc +@@ -488,17 +488,6 @@ ] }, { @@ -478,45 +333,373 @@ diff -uar chromium-51.0.2704.63.orig/gpu/config/software_rendering_list_json.cc "id": 49, "description": "NVidia GeForce GT 650M can cause the system to hang with flash 3D", "cr_bugs": [140175], -diff -uar chromium-51.0.2704.63.orig/media/BUILD.gn chromium-51.0.2704.63/media/BUILD.gn ---- chromium-51.0.2704.63.orig/media/BUILD.gn 2016-05-25 21:01:03.000000000 +0200 -+++ chromium-51.0.2704.63/media/BUILD.gn 2016-05-26 09:45:41.256621394 +0200 -@@ -326,7 +326,7 @@ + +Index: dev/media/BUILD.gn +=================================================================== +--- dev.orig/media/BUILD.gn ++++ dev/media/BUILD.gn +@@ -339,7 +339,7 @@ component("media") { allow_circular_includes_from = [ "//media/base/android" ] } - if (current_cpu != "arm" && is_chromeos) { -+ if ((current_cpu != "arm" && is_chromeos) || is_linux) { ++ if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) { sources += [ "filters/h264_bitstream_buffer.cc", "filters/h264_bitstream_buffer.h", -@@ -615,7 +615,7 @@ +@@ -629,7 +629,7 @@ test("media_unittests") { } } - if (current_cpu != "arm" && is_chromeos) { -+ if ((current_cpu != "arm" && is_chromeos) || is_linux) { ++ if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) { sources += [ "filters/h264_bitstream_buffer_unittest.cc" ] } -diff -uar chromium-51.0.2704.63.orig/media/media.gyp chromium-51.0.2704.63/media/media.gyp ---- chromium-51.0.2704.63.orig/media/media.gyp 2016-05-25 21:01:03.000000000 +0200 -+++ chromium-51.0.2704.63/media/media.gyp 2016-05-26 09:45:41.274623511 +0200 -@@ -739,7 +739,7 @@ +Index: dev/media/gpu/BUILD.gn +=================================================================== +--- dev.orig/media/gpu/BUILD.gn ++++ dev/media/gpu/BUILD.gn +@@ -12,7 +12,7 @@ if (is_mac) { + import("//build/config/mac/mac_sdk.gni") + } + +-if (is_chromeos && current_cpu != "arm") { ++if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") { + action("libva_generate_stubs") { + extra_header = "va_stub_header.fragment" + +@@ -229,7 +229,7 @@ component("gpu") { + } + } + +- if (is_chromeos) { ++ if (is_linux) { + sources += [ + "accelerated_video_decoder.h", + "h264_decoder.cc", +@@ -273,7 +273,7 @@ component("gpu") { + "GLESv2", + ] + } +- if (current_cpu == "arm") { ++ if (current_cpu == "arm" && is_chromeos) { + sources += [ + "tegra_v4l2_device.cc", + "tegra_v4l2_device.h", +Index: dev/media/gpu/gpu_video_decode_accelerator_factory_impl.cc +=================================================================== +--- dev.orig/media/gpu/gpu_video_decode_accelerator_factory_impl.cc ++++ dev/media/gpu/gpu_video_decode_accelerator_factory_impl.cc +@@ -14,7 +14,7 @@ + #include "media/gpu/dxva_video_decode_accelerator_win.h" + #elif defined(OS_MACOSX) + #include "media/gpu/vt_video_decode_accelerator_mac.h" +-#elif defined(OS_CHROMEOS) ++#elif defined(OS_CHROMEOS) || defined(OS_LINUX) + #if defined(USE_V4L2_CODEC) + #include "media/gpu/v4l2_device.h" + #include "media/gpu/v4l2_slice_video_decode_accelerator.h" +@@ -79,7 +79,7 @@ + #if defined(OS_WIN) + capabilities.supported_profiles = + DXVAVideoDecodeAccelerator::GetSupportedProfiles(); +-#elif defined(OS_CHROMEOS) ++#elif defined(OS_CHROMEOS) || defined(OS_LINUX) + media::VideoDecodeAccelerator::SupportedProfiles vda_profiles; + #if defined(USE_V4L2_CODEC) + vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); +@@ -130,7 +130,7 @@ + &GpuVideoDecodeAcceleratorFactoryImpl::CreateV4L2VDA, + &GpuVideoDecodeAcceleratorFactoryImpl::CreateV4L2SVDA, + #endif +-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) ++#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY) + &GpuVideoDecodeAcceleratorFactoryImpl::CreateVaapiVDA, + #endif + #if defined(OS_MACOSX) +@@ -194,10 +194,11 @@ + } + #endif + +-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) ++#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY) + std::unique_ptr<media::VideoDecodeAccelerator> + GpuVideoDecodeAcceleratorFactoryImpl::CreateVaapiVDA( + const gpu::GpuPreferences& gpu_preferences) const { ++ VLOG(1) << "Creating new VAAPI video decode accelerator."; + std::unique_ptr<media::VideoDecodeAccelerator> decoder; + decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_cb_, + bind_image_cb_)); +Index: dev/media/gpu/gpu_video_decode_accelerator_factory_impl.h +=================================================================== +--- dev.orig/media/gpu/gpu_video_decode_accelerator_factory_impl.h ++++ dev/media/gpu/gpu_video_decode_accelerator_factory_impl.h +@@ -99,7 +99,7 @@ + std::unique_ptr<media::VideoDecodeAccelerator> CreateV4L2SVDA( + const gpu::GpuPreferences& gpu_preferences) const; + #endif +-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) ++#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY) + std::unique_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA( + const gpu::GpuPreferences& gpu_preferences) const; + #endif +Index: dev/media/gpu/ipc/service/BUILD.gn +=================================================================== +--- dev.orig/media/gpu/ipc/service/BUILD.gn ++++ dev/media/gpu/ipc/service/BUILD.gn +@@ -37,7 +37,7 @@ source_set("service") { + "//third_party/mesa:mesa_headers", + ] + +- if (is_chromeos && current_cpu != "arm") { ++ if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") { + configs += [ "//third_party/libva:libva_config" ] + } + +Index: dev/media/gpu/ipc/service/gpu_video_decode_accelerator.cc +=================================================================== +--- dev.orig/media/gpu/ipc/service/gpu_video_decode_accelerator.cc ++++ dev/media/gpu/ipc/service/gpu_video_decode_accelerator.cc +@@ -58,7 +58,7 @@ static bool MakeDecoderContextCurrent( + return true; + } + +-#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) ++#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) + static bool BindImage(const base::WeakPtr<gpu::GpuCommandBufferStub>& stub, + uint32_t client_texture_id, + uint32_t texture_target, +@@ -170,7 +170,7 @@ GpuVideoDecodeAccelerator::GpuVideoDecod + get_gl_context_cb_ = base::Bind(&GetGLContext, stub_->AsWeakPtr()); + make_context_current_cb_ = + base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr()); +-#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) ++#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) + bind_image_cb_ = base::Bind(&BindImage, stub_->AsWeakPtr()); + #endif + get_gles2_decoder_cb_ = base::Bind(&GetGLES2Decoder, stub_->AsWeakPtr()); +Index: dev/media/gpu/va_stub_header.fragment +=================================================================== +--- dev.orig/media/gpu/va_stub_header.fragment ++++ dev/media/gpu/va_stub_header.fragment +@@ -5,8 +5,9 @@ extern "C" { + + #include "third_party/libva/va/drm/va_drm.h" + #include "third_party/libva/va/va.h" +-#if defined(USE_X11) + #include "third_party/libva/va/va_x11.h" ++#if defined(USE_OZONE) ++#include "third_party/libva/va/wayland/va_wayland.h" + #endif + + } +Index: dev/media/gpu/vaapi_video_decode_accelerator.cc +=================================================================== +--- dev.orig/media/gpu/vaapi_video_decode_accelerator.cc ++++ dev/media/gpu/vaapi_video_decode_accelerator.cc +@@ -342,17 +342,17 @@ + + base::AutoLock auto_lock(lock_); + DCHECK_EQ(state_, kUninitialized); +- DVLOG(2) << "Initializing VAVDA, profile: " << profile; ++ VLOG(1) << "Initializing VAVDA, profile: " << profile; + + #if defined(USE_X11) + if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { +- DVLOG(1) << "HW video decode acceleration not available without " ++ VLOG(1) << "HW video decode acceleration not available without " + "DesktopGL (GLX)."; + return false; + } + #elif defined(USE_OZONE) + if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { +- DVLOG(1) << "HW video decode acceleration not available without " ++ VLOG(1) << "HW video decode acceleration not available without " + << "EGLGLES2."; + return false; + } +@@ -362,7 +362,7 @@ + VaapiWrapper::kDecode, profile, base::Bind(&ReportToUMA, VAAPI_ERROR)); + + if (!vaapi_wrapper_.get()) { +- DVLOG(1) << "Failed initializing VAAPI for profile " << profile; ++ VLOG(1) << "Failed initializing VAAPI for profile " << profile; + return false; + } + +@@ -379,7 +379,7 @@ + vp9_accelerator_.reset(new VaapiVP9Accelerator(this, vaapi_wrapper_.get())); + decoder_.reset(new VP9Decoder(vp9_accelerator_.get())); + } else { +- DLOG(ERROR) << "Unsupported profile " << profile; ++ VLOG(1) << "Unsupported profile " << profile; + return false; + } + +Index: dev/media/gpu/vaapi_wrapper.cc +=================================================================== +--- dev.orig/media/gpu/vaapi_wrapper.cc ++++ dev/media/gpu/vaapi_wrapper.cc +@@ -189,7 +189,7 @@ scoped_refptr<VaapiWrapper> VaapiWrapper + VAProfile va_profile, + const base::Closure& report_error_to_uma_cb) { + if (!profile_infos_.Get().IsProfileSupported(mode, va_profile)) { +- DVLOG(1) << "Unsupported va_profile: " << va_profile; ++ VLOG(1) << "Unsupported va_profile: " << va_profile; + return nullptr; + } + +@@ -342,15 +342,17 @@ VaapiWrapper::GetSupportedProfileInfosFo + bool VaapiWrapper::VaInitialize(const base::Closure& report_error_to_uma_cb) { + static bool vaapi_functions_initialized = PostSandboxInitialization(); + if (!vaapi_functions_initialized) { +- bool running_on_chromeos = false; +-#if defined(OS_CHROMEOS) ++ bool error_level_logging = false; ++#if defined(OS_LINUX) ++ error_level_logging = true; ++#elif defined(OS_CHROMEOS) + // When chrome runs on linux with chromeos=1, do not log error message + // without VAAPI libraries. +- running_on_chromeos = base::SysInfo::IsRunningOnChromeOS(); ++ error_level_logging = base::SysInfo::IsRunningOnChromeOS(); + #endif + static const char kErrorMsg[] = "Failed to initialize VAAPI libs"; +- if (running_on_chromeos) +- LOG(ERROR) << kErrorMsg; ++ if (error_level_logging) ++ VLOG(1) << kErrorMsg; + else + DVLOG(1) << kErrorMsg; + return false; +@@ -416,7 +418,7 @@ bool VaapiWrapper::IsEntrypointSupported + + if (std::find(supported_entrypoints.begin(), supported_entrypoints.end(), + entrypoint) == supported_entrypoints.end()) { +- DVLOG(1) << "Unsupported entrypoint"; ++ VLOG(1) << "Unsupported entrypoint"; + return false; + } + return true; +@@ -440,8 +442,8 @@ bool VaapiWrapper::AreAttribsSupported_L + if (attribs[i].type != required_attribs[i].type || + (attribs[i].value & required_attribs[i].value) != + required_attribs[i].value) { +- DVLOG(1) << "Unsupported value " << required_attribs[i].value +- << " for attribute type " << required_attribs[i].type; ++ VLOG(1) << "Unsupported value " << required_attribs[i].value ++ << " for attribute type " << required_attribs[i].type; + return false; + } + } +Index: dev/media/media.gyp +=================================================================== +--- dev.orig/media/media.gyp ++++ dev/media/media.gyp +@@ -752,7 +752,7 @@ ], }], # For VaapiVideoEncodeAccelerator. - ['target_arch != "arm" and chromeos == 1', { -+ ['(target_arch != "arm" and chromeos == 1) or desktop_linux == 1', { ++ ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', { 'sources': [ 'filters/h264_bitstream_buffer.cc', 'filters/h264_bitstream_buffer.h', -@@ -1313,7 +1313,7 @@ +@@ -1330,7 +1330,7 @@ 'cdm/cdm_adapter_unittest.cc', ], }], - ['target_arch != "arm" and chromeos == 1 and use_x11 == 1', { -+ ['(target_arch != "arm" and chromeos == 1) or desktop_linux == 1 and use_x11 == 1', { ++ ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1) and use_x11 == 1', { 'sources': [ 'filters/h264_bitstream_buffer_unittest.cc', ], +@@ -2264,7 +2264,7 @@ + ], + }], + +- ['chromeos==1 and target_arch != "arm"', { ++ ['(desktop_linux==1 or chromeos==1) and target_arch != "arm"', { + 'targets': [ + { + 'target_name': 'vaapi_jpeg_decoder_unittest', +Index: dev/media/media_gpu.gypi +=================================================================== +--- dev.orig/media/media_gpu.gypi ++++ dev/media/media_gpu.gypi +@@ -174,7 +174,7 @@ + }, + ], + }], +- ['chromeos==1', { ++ ['chromeos==1 or desktop_linux==1', { + 'sources': [ + 'gpu/accelerated_video_decoder.h', + 'gpu/h264_decoder.cc', +@@ -230,7 +230,7 @@ + 'gpu/tegra_v4l2_device.h', + ], + }], +- ['target_arch != "arm" and chromeos == 1', { ++ ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', { + 'dependencies': [ + '../media/media.gyp:media', + '../third_party/libyuv/libyuv.gyp:libyuv', +Index: dev/content/content_common.gypi +=================================================================== +--- dev.orig/content/content_common.gypi ++++ dev/content/content_common.gypi +@@ -650,6 +650,52 @@ + ], + }, { + 'defines': ['USE_SECCOMP_BPF'], ++ 'dependencies': [ ++ '../build/linux/system.gyp:x11', ++ ], ++ 'variables': { ++ 'sig_files': [ ++ '../media/gpu/va.sigs', ++ '../media/gpu/va_x11.sigs', ++ ], ++ 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py', ++ 'extra_header': '../media/gpu/va_stub_header.fragment', ++ 'outfile_type': 'posix_stubs', ++ 'stubs_filename_root': 'va_stubs', ++ 'project_path': 'content/common', ++ 'intermediate_dir': '<(INTERMEDIATE_DIR)', ++ 'output_root': '<(SHARED_INTERMEDIATE_DIR)/va', ++ }, ++ 'actions': [ ++ { ++ 'action_name': 'libva_generate_stubs', ++ 'inputs': [ ++ '<(generate_stubs_script)', ++ '<(extra_header)', ++ '<@(sig_files)', ++ ], ++ 'outputs': [ ++ '<(intermediate_dir)/<(stubs_filename_root).cc', ++ '<(output_root)/<(project_path)/<(stubs_filename_root).h', ++ ], ++ 'action': ['python', ++ '<(generate_stubs_script)', ++ '-i', '<(intermediate_dir)', ++ '-o', '<(output_root)/<(project_path)', ++ '-t', '<(outfile_type)', ++ '-e', '<(extra_header)', ++ '-s', '<(stubs_filename_root)', ++ '-p', '<(project_path)', ++ '<@(_inputs)', ++ ], ++ 'process_outputs_as_sources': 1, ++ 'message': 'Generating libva stubs for dynamic loading', ++ }, ++ ], ++ 'include_dirs': [ ++ '<(DEPTH)/third_party/libva', ++ '<(output_root)', ++ ], + }], + ['use_ozone==1', { + 'dependencies': [ |