From 955bf131c5078d5d546b819657c576752649e6ba Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Thu, 21 May 2015 10:20:34 +0000 Subject: chromium_vaapi.patch: rebased against chromium-dev 44.0.2398.0 sources --- chromium-dev/build/patches/chromium_vaapi.patch | 335 ++++++++++++------------ 1 file changed, 165 insertions(+), 170 deletions(-) (limited to 'chromium-dev') diff --git a/chromium-dev/build/patches/chromium_vaapi.patch b/chromium-dev/build/patches/chromium_vaapi.patch index 52ea1fcd..cd716bcc 100644 --- a/chromium-dev/build/patches/chromium_vaapi.patch +++ b/chromium-dev/build/patches/chromium_vaapi.patch @@ -1,9 +1,25 @@ # -# Adapted from http://bazaar.launchpad.net/~saiarcot895/chromium-browser +# Taken from: +# https://code.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.vivid.dev +# And rebased against chromium-dev 44.0.2398.0 sources. # ---- dev.vivid.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-03-12 08:50:35.486933116 -0400 -@@ -30,7 +30,7 @@ + +diff -uarN chromium-44.0.2398.0.orig/chrome/browser/about_flags.cc chromium-44.0.2398.0/chrome/browser/about_flags.cc +--- chromium-44.0.2398.0.orig/chrome/browser/about_flags.cc 2015-05-11 09:58:19.000000000 +0200 ++++ chromium-44.0.2398.0/chrome/browser/about_flags.cc 2015-05-21 12:08:48.252309710 +0200 +@@ -1100,7 +1100,7 @@ + { "disable-accelerated-video-decode", + IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, + IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, +- kOsMac | kOsWin | kOsCrOS, ++ kOsAll, + SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), + }, + #if defined(USE_ASH) +diff -uarN chromium-44.0.2398.0.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc chromium-44.0.2398.0/content/common/gpu/media/gpu_video_decode_accelerator.cc +--- chromium-44.0.2398.0.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-05-21 12:08:48.235306888 +0200 +@@ -31,7 +31,7 @@ #include "content/common/gpu/media/dxva_video_decode_accelerator.h" #elif defined(OS_MACOSX) #include "content/common/gpu/media/vt_video_decode_accelerator.h" @@ -12,7 +28,7 @@ #if defined(USE_V4L2_CODEC) #include "content/common/gpu/media/v4l2_device.h" #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" -@@ -348,7 +348,7 @@ +@@ -344,7 +344,7 @@ scoped_ptr GpuVideoDecodeAccelerator::CreateVaapiVDA() { scoped_ptr decoder; @@ -21,122 +37,41 @@ decoder.reset(new VaapiVideoDecodeAccelerator( make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage, base::Unretained(this)))); -Index: dev.vivid/content/content_common.gypi -=================================================================== ---- dev.vivid.orig/content/content_common.gypi 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/content_common.gypi 2015-03-12 08:50:35.486933116 -0400 -@@ -859,7 +859,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', -Index: dev.vivid/content/content_gpu.gypi -=================================================================== ---- dev.vivid.orig/content/content_gpu.gypi 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/content_gpu.gypi 2015-03-12 08:50:35.486933116 -0400 -@@ -39,7 +39,7 @@ - ], - }, - }], -- ['target_arch!="arm" and chromeos == 1', { -+ ['target_arch!="arm" and (chromeos == 1 or desktop_linux == 1)', { - 'include_dirs': [ - '<(DEPTH)/third_party/libva', - ], -Index: dev.vivid/content/content_tests.gypi -=================================================================== ---- dev.vivid.orig/content/content_tests.gypi 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/content_tests.gypi 2015-03-12 08:50:35.487933101 -0400 -@@ -1639,7 +1639,7 @@ - }, - ] - }], -- ['chromeos==1 and target_arch != "arm"', { -+ ['(chromeos==1 or desktop_linux==1) and target_arch != "arm"', { - 'targets': [ - { - 'target_name': 'vaapi_h264_decoder_unittest', -Index: dev.vivid/content/public/common/content_switches.cc -=================================================================== ---- dev.vivid.orig/content/public/common/content_switches.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/public/common/content_switches.cc 2015-03-12 08:50:35.487933101 -0400 -@@ -937,7 +937,7 @@ - // Disable web audio API. - const char kDisableWebAudio[] = "disable-webaudio"; - --#if defined(OS_CHROMEOS) -+#if defined(OS_CHROMEOS) || defined(OS_LINUX) - // Disables panel fitting (used for mirror mode). - const char kDisablePanelFitting[] = "disable-panel-fitting"; - -Index: dev.vivid/content/public/common/content_switches.h -=================================================================== ---- dev.vivid.orig/content/public/common/content_switches.h 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/public/common/content_switches.h 2015-03-12 08:50:35.488933086 -0400 -@@ -269,7 +269,7 @@ - - CONTENT_EXPORT extern const char kDisableWebAudio[]; +diff -uarN chromium-44.0.2398.0.orig/content/common/gpu/media/vaapi_wrapper.cc chromium-44.0.2398.0/content/common/gpu/media/vaapi_wrapper.cc +--- chromium-44.0.2398.0.orig/content/common/gpu/media/vaapi_wrapper.cc 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/common/gpu/media/vaapi_wrapper.cc 2015-05-21 12:08:48.252309710 +0200 +@@ -143,7 +143,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; + } --#if defined(OS_CHROMEOS) -+#if defined(OS_CHROMEOS) || defined(OS_LINUX) - CONTENT_EXPORT extern const char kDisablePanelFitting[]; - CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[]; - #endif -Index: dev.vivid/media/media.gyp -=================================================================== ---- dev.vivid.orig/media/media.gyp 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/media/media.gyp 2015-03-12 08:50:35.488933086 -0400 -@@ -732,7 +732,7 @@ - ], - }], - # For VaapiVideoEncodeAccelerator. -- ['target_arch != "arm" and chromeos == 1', { -+ ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', { - 'sources': [ - 'filters/h264_bitstream_buffer.cc', - 'filters/h264_bitstream_buffer.h', -Index: dev.vivid/gpu/config/software_rendering_list_json.cc -=================================================================== ---- dev.vivid.orig/gpu/config/software_rendering_list_json.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/gpu/config/software_rendering_list_json.cc 2015-03-12 08:50:35.488933086 -0400 -@@ -507,17 +507,6 @@ - ] - }, - { -- "id": 48, -- "description": "Accelerated video decode is unavailable on Linux", -- "cr_bugs": [137247], -- "os": { -- "type": "linux" -- }, -- "features": [ -- "accelerated_video_decode" -- ] -- }, -- { - "id": 49, - "description": "NVidia GeForce GT 650M can cause the system to hang with flash 3D", - "cr_bugs": [140175], -@@ -1087,6 +1076,11 @@ - "os": { - "type": "android" - } -+ }, -+ { -+ "os": { -+ "type": "linux" -+ } - } - ], - "features": [ -Index: dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc -=================================================================== ---- dev.vivid.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2015-03-12 08:50:35.488933086 -0400 +@@ -386,7 +386,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; +@@ -410,8 +410,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 -uarN chromium-44.0.2398.0.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc chromium-44.0.2398.0/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +--- chromium-44.0.2398.0.orig/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2015-05-21 12:08:48.251309544 +0200 @@ -21,6 +21,8 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -232,57 +167,117 @@ Index: dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc return true; } -Index: dev.vivid/chrome/browser/about_flags.cc -=================================================================== ---- dev.vivid.orig/chrome/browser/about_flags.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/chrome/browser/about_flags.cc 2015-03-12 08:50:35.489933071 -0400 -@@ -949,7 +949,7 @@ - { "disable-accelerated-video-decode", - IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, - IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, -- kOsMac | kOsWin | kOsCrOS, -+ kOsAll, - SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), - }, - #if defined(USE_ASH) -Index: dev.vivid/content/common/gpu/media/vaapi_wrapper.cc -=================================================================== ---- dev.vivid.orig/content/common/gpu/media/vaapi_wrapper.cc 2015-03-12 08:50:35.492933024 -0400 -+++ dev.vivid/content/common/gpu/media/vaapi_wrapper.cc 2015-03-12 08:50:35.489933071 -0400 -@@ -184,14 +184,17 @@ - - if (!vaapi_wrapper->VaInitialize(report_error_to_uma_cb)) - return nullptr; -+ VLOG(1) << "VAAPI wrapper: initialized VA driver"; - - std::vector supported_va_profiles; - if (!vaapi_wrapper->GetSupportedVaProfiles(&supported_va_profiles)) - return nullptr; -+ VLOG(1) << "VAAPI wrapper: got supported VA profiles"; +diff -uarN chromium-44.0.2398.0.orig/content/content_common.gypi chromium-44.0.2398.0/content/content_common.gypi +--- chromium-44.0.2398.0.orig/content/content_common.gypi 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/content_common.gypi 2015-05-21 12:08:48.236307054 +0200 +@@ -822,7 +822,7 @@ + }, + ], + }], +- ['chromeos==1', { ++ ['chromeos==1 or desktop_linux==1', { + 'sources': [ + 'common/gpu/media/accelerated_video_decoder.h', + 'common/gpu/media/h264_decoder.cc', +@@ -871,7 +871,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 -uarN chromium-44.0.2398.0.orig/content/content_gpu.gypi chromium-44.0.2398.0/content/content_gpu.gypi +--- chromium-44.0.2398.0.orig/content/content_gpu.gypi 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/content_gpu.gypi 2015-05-21 12:08:48.236307054 +0200 +@@ -36,7 +36,7 @@ + ], + }, + }], +- ['target_arch!="arm" and chromeos == 1', { ++ ['target_arch!="arm" and (chromeos == 1 or desktop_linux == 1)', { + 'include_dirs': [ + '<(DEPTH)/third_party/libva', + ], +diff -uarN chromium-44.0.2398.0.orig/content/content_tests.gypi chromium-44.0.2398.0/content/content_tests.gypi +--- chromium-44.0.2398.0.orig/content/content_tests.gypi 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/content/content_tests.gypi 2015-05-21 12:08:48.237307220 +0200 +@@ -1648,7 +1648,7 @@ + }, + ] + }], +- ['chromeos==1 and target_arch != "arm"', { ++ ['(chromeos==1 or desktop_linux==1) and target_arch != "arm"', { + 'targets': [ + { + 'target_name': 'vaapi_jpeg_decoder_unittest', +diff -uarN chromium-44.0.2398.0.orig/content/public/common/content_switches.cc chromium-44.0.2398.0/content/public/common/content_switches.cc +--- chromium-44.0.2398.0.orig/content/public/common/content_switches.cc 2015-05-11 10:11:08.000000000 +0200 ++++ chromium-44.0.2398.0/content/public/common/content_switches.cc 2015-05-21 12:08:48.249309212 +0200 +@@ -943,7 +943,7 @@ + // Disable web audio API. + const char kDisableWebAudio[] = "disable-webaudio"; - VAProfile va_profile = ProfileToVAProfile(profile, supported_va_profiles); - if (!vaapi_wrapper->Initialize(mode, va_profile)) - return nullptr; -+ VLOG(1) << "VAAPI wrapper: VAAPI wrapper initialized"; +-#if defined(OS_CHROMEOS) ++#if defined(OS_CHROMEOS) || defined(OS_LINUX) + // Disables panel fitting (used for mirror mode). + const char kDisablePanelFitting[] = "disable-panel-fitting"; - return vaapi_wrapper.Pass(); - } -@@ -363,6 +366,7 @@ - bool VaapiWrapper::Initialize(CodecMode mode, VAProfile va_profile) { - if (va_profile == VAProfileNone) { - DVLOG(1) << "Unsupported profile"; -+ VLOG(1) << "Unsupported profile"; - return false; - } - VAEntrypoint entrypoint = -@@ -372,8 +376,10 @@ - std::vector required_attribs = GetRequiredAttribs(mode); - if (!AreAttribsSupported(va_profile, entrypoint, required_attribs)) - return false; -+ VLOG(1) << "VAAPI Wrapper Initialization: entrypoint and attribs supported"; +diff -uarN chromium-44.0.2398.0.orig/content/public/common/content_switches.h chromium-44.0.2398.0/content/public/common/content_switches.h +--- chromium-44.0.2398.0.orig/content/public/common/content_switches.h 2015-05-11 10:11:08.000000000 +0200 ++++ chromium-44.0.2398.0/content/public/common/content_switches.h 2015-05-21 12:08:48.250309378 +0200 +@@ -269,7 +269,7 @@ - TryToSetVADisplayAttributeToLocalGPU(); -+ VLOG(1) << "VAAPI Wrapper Initialization: attributes set"; + CONTENT_EXPORT extern const char kDisableWebAudio[]; - base::AutoLock auto_lock(va_lock_); - VAStatus va_res = vaCreateConfig(va_display_, +-#if defined(OS_CHROMEOS) ++#if defined(OS_CHROMEOS) || defined(OS_LINUX) + CONTENT_EXPORT extern const char kDisablePanelFitting[]; + CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[]; + #endif +diff -uarN chromium-44.0.2398.0.orig/gpu/config/software_rendering_list_json.cc chromium-44.0.2398.0/gpu/config/software_rendering_list_json.cc +--- chromium-44.0.2398.0.orig/gpu/config/software_rendering_list_json.cc 2015-05-11 09:58:24.000000000 +0200 ++++ chromium-44.0.2398.0/gpu/config/software_rendering_list_json.cc 2015-05-21 12:08:48.251309544 +0200 +@@ -475,17 +475,6 @@ + ] + }, + { +- "id": 48, +- "description": "Accelerated video decode is unavailable on Linux", +- "cr_bugs": [137247], +- "os": { +- "type": "linux" +- }, +- "features": [ +- "accelerated_video_decode" +- ] +- }, +- { + "id": 49, + "description": "NVidia GeForce GT 650M can cause the system to hang with flash 3D", + "cr_bugs": [140175], +@@ -1034,6 +1023,11 @@ + "op": ">=", + "value": "3.0" + } ++ }, ++ { ++ "os": { ++ "type": "linux" ++ } + } + ], + "features": [ +diff -uarN chromium-44.0.2398.0.orig/media/media.gyp chromium-44.0.2398.0/media/media.gyp +--- chromium-44.0.2398.0.orig/media/media.gyp 2015-05-11 10:11:08.000000000 +0200 ++++ chromium-44.0.2398.0/media/media.gyp 2015-05-21 12:08:48.250309378 +0200 +@@ -703,7 +703,7 @@ + ], + }], + # For VaapiVideoEncodeAccelerator. +- ['target_arch != "arm" and chromeos == 1', { ++ ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', { + 'sources': [ + 'filters/h264_bitstream_buffer.cc', + 'filters/h264_bitstream_buffer.h', -- cgit v1.2.3