diff options
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | enable_vaapi_on_linux-r1.diff | 294 | ||||
-rw-r--r-- | enable_vaapi_on_linux.diff | 2 |
3 files changed, 329 insertions, 26 deletions
@@ -11,22 +11,22 @@ _use_clang=1 # Use clang compiler (system). Results in faster build and smaller chromium. _use_bundled_clang=1 # Use bundled clang compiler (needs build). NOTE: if use this option , _use_clang need set to 1 _use_ccache=0 # Use ccache when build -_use_pax=0 # If set 1 to change PaX permisions in executables NOTE: only use if use PaX environment +_use_pax=0 # Set 1 to change PaX permisions in executables NOTE: only use if use PaX environment +_use_gtk3=1 # If set 1, then build with GTK3 support, if set 0, then build with GTK2 ############################################## ## -- Package and components information -- ## ############################################## pkgname=chromium-dev -pkgver=47.0.2503.0 -_launcher_ver=2 +pkgver=47.0.2522.1 +_launcher_ver=3 pkgrel=1 pkgdesc="The open-source project behind Google Chrome (Dev Channel)" arch=('i686' 'x86_64') url='http://www.chromium.org' license=('BSD') depends=('desktop-file-utils' - 'gtk2' - #'icu' + 'icu' 'jsoncpp' #'libsrtp' 'libwebp' @@ -55,19 +55,20 @@ makedepends=('libexif' 'python2-html5lib' 'python2-simplejson' 'python2-jinja' + 'python2-ply' 'subversion' 'yasm' 'git' - # https://bugs.archlinux.org/task/45625 - #'python2-ply' ) makedepends_x86_64=('lib32-gcc-libs' 'lib32-zlib') optdepends=('chromium-pepper-flash-dev: PPAPI Flash Player (Dev Channel)' + # 'kdebase-kdialog: Needed for file dialogs in KDE4' - 'kdeutils-kwalletmanager: For storing passwords in KWallet in KDE4' + 'kwalletmanager4: Needed for storing passwords in KWallet in KDE4' + # 'kdialog-frameworks-git: Needed for file dialogs in KF5' - 'kwalletmanager-git: Needed for storing passwords in KWallet in KF5' - 'libappindicator-gtk2: Needed for show systray icon in the panel in plasma-next (KF5)' + 'kwalletmanager: Needed for storing passwords in KWallet in KF5' + # 'libexif: Need for read EXIF metadata' 'ttf-font: For some typography') source=("https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz" @@ -76,24 +77,22 @@ source=("https://commondatastorage.googleapis.com/chromium-browser-official/chro 'chromium-dev.xml' 'chromium-dev.svg' # Patch form Gentoo - + 'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-system-jinja-r7.patch' # Misc Patches - 'chromium-system-jinja-r8.patch' - 'enable_vaapi_on_linux.diff' + 'enable_vaapi_on_linux-r1.diff' # Patch from crbug (chromium bugtracker) ) sha1sums=( #"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/?marker=chromium-${pkgver}.tar.x | awk -v FS='<td>"' -v RS='"</td>' '$0=$2' | head -n1)" "$(curl -sL "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes" | grep sha1 | cut -d " " -f3)" - '55f9646683bc8b92587f8e0a36aff242cb436a24' + 'd18f8d96e80be9c31d994cc6362d7d8041c53319' '0acc45b901418f270d0b2068502e39c407c74ea4' '2b98c549332e7337307ce287e150930cfc1dfa5f' '336976cb66bf8df71fc7f2e92aa723891b6efb53' # Patch form Gentoo - + 'c24d14029714d2295f3220a7173a5a7362f578a2' # Misc Patches - '51ee08f9500a9006673787b0f29ffa089b09c286' - '4e223ea3df5be9374f202f7c3f0679ae55eed495' + '255d71cd9b9e55265e1bfeaa4612bcf60d293204' # Patch from crbug (chromium bugtracker) ) @@ -142,6 +141,16 @@ if [ "${_use_bundled_clang}" = "1" ]; then ) fi +# Build with GTK3? +if [ "${_use_gtk3}" = "1" ]; then + depends+=('gtk3') + optdepends+=('libappindicator-gtk3: Needed for show systray icon in the panel in plasma-next (KF5)') + _launcher_gtk='GTK=3' +elif [ "${_use_gtk3}" = "0" ]; then + depends+=('gtk2') + optdepends+=('libappindicator-gtk2: Needed for show systray icon in the panel in plasma-next (KF5)') +fi + # Need you use ccache? if [ "${_use_ccache}" = "1" ]; then makedepends+=('ccache') @@ -217,7 +226,6 @@ _necesary=('base/third_party/dmg_fp' 'third_party/google_input_tools/third_party/closure_library/third_party/closure' 'third_party/hunspell' 'third_party/iccjpeg' - 'third_party/icu' 'third_party/jstemplate' 'third_party/khronos' 'third_party/leveldatabase' @@ -230,8 +238,8 @@ _necesary=('base/third_party/dmg_fp' 'third_party/libudev' 'third_party/libusb' 'third_party/libva' - 'third_party/libvpx' - 'third_party/libvpx/source/libvpx/third_party/x86inc' + 'third_party/libvpx_new' + 'third_party/libvpx_new/source/libvpx/third_party/x86inc' 'third_party/libxml/chromium' 'third_party/libwebm' 'third_party/libXNVCtrl' @@ -240,7 +248,6 @@ _necesary=('base/third_party/dmg_fp' 'third_party/lzma_sdk' 'third_party/mesa' 'third_party/mojo' - 'third_party/mojo/src/mojo/public/third_party/ply' 'third_party/modp_b64' 'third_party/mt19937ar' 'third_party/npapi' @@ -256,7 +263,6 @@ _necesary=('base/third_party/dmg_fp' 'third_party/pdfium/third_party/libjpeg' 'third_party/pdfium/third_party/libopenjpeg20' 'third_party/pdfium/third_party/zlib_v128' - 'third_party/ply' 'third_party/polymer' 'third_party/protobuf' 'third_party/qcms' @@ -321,6 +327,7 @@ _flags=("-Dclang=${_use_clang}" "-Duse_gconf=${_use_gnome}" "-Duse_gio=${_use_gnome}" "-Duse_gnome_keyring=${_use_gnome_keyring}" + "-Duse_gtk3=${_use_gtk3}" "-Duse_pulseaudio=${_use_pulseaudio}" '-Dwerror=' ) @@ -365,7 +372,7 @@ _use_system=('-Duse_system_expat=1' '-Duse_system_flac=1' '-Duse_system_fontconfig=1' '-Duse_system_harfbuzz=1' - '-Duse_system_icu=0' + '-Duse_system_icu=1' '-Duse_system_jsoncpp=1' '-Duse_system_libevent=0' '-Duse_system_libexif=1' @@ -420,10 +427,10 @@ prepare() { msg2 "Patching the sources" # Patch sources from Gentoo + patch -p0 -i ../chromium-system-jinja-r7.patch # Misc Patches: - patch -p0 -i ../chromium-system-jinja-r8.patch - patch -p1 -i ../enable_vaapi_on_linux.diff + patch -p1 -i ../enable_vaapi_on_linux-r1.diff # Patch from crbug (chromium bugtracker) # fix the missing define (if not, fail build) (need upstream fix) (https://crbug.com/473866) @@ -452,7 +459,7 @@ prepare() { build() { msg2 "Build the Launcher" - make -C "chromium-launcher-${_launcher_ver}" CHROMIUM_SUFFIX="-dev" PREFIX=/usr + make -C "chromium-launcher-${_launcher_ver}" CHROMIUM_SUFFIX="-dev" PREFIX=/usr ${_launcher_gtk} cd "chromium-${pkgver}" diff --git a/enable_vaapi_on_linux-r1.diff b/enable_vaapi_on_linux-r1.diff new file mode 100644 index 000000000000..3dfdfc22bb5a --- /dev/null +++ b/enable_vaapi_on_linux-r1.diff @@ -0,0 +1,294 @@ +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. + +Index: beta.vivid/content/common/gpu/media/gpu_video_decode_accelerator.cc +=================================================================== +--- beta.vivid.orig/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-06-02 14:57:28.961592702 -0400 ++++ beta.vivid/content/common/gpu/media/gpu_video_decode_accelerator.cc 2015-06-02 14:57:28.954592798 -0400 +@@ -33,7 +33,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" +-#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" +@@ -346,7 +346,7 @@ + scoped_ptr<media::VideoDecodeAccelerator> + GpuVideoDecodeAccelerator::CreateVaapiVDA() { + scoped_ptr<media::VideoDecodeAccelerator> decoder; +-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) ++#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY) + 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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/content_common.gypi 2015-06-02 15:12:59.289303797 -0400 +@@ -826,7 +826,7 @@ + }, + ], + }], +- ['chromeos==1', { ++ ['chromeos==1 or desktop_linux==1', { + 'sources': [ + 'common/gpu/media/accelerated_video_decoder.h', + 'common/gpu/media/h264_decoder.cc', +@@ -875,7 +875,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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/content_gpu.gypi 2015-06-02 15:12:59.289303797 -0400 +@@ -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', + ], +Index: dev.vivid/content/content_tests.gypi +=================================================================== +--- dev.vivid.orig/content/content_tests.gypi 2015-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/content_tests.gypi 2015-06-02 15:12:59.289303797 -0400 +@@ -1651,7 +1651,7 @@ + }, + ] + }], +- ['chromeos==1 and target_arch != "arm"', { ++ ['(chromeos==1 or desktop_linux==1) and target_arch != "arm"', { + 'targets': [ + { + 'target_name': 'vaapi_jpeg_decoder_unittest', +Index: dev.vivid/content/public/common/content_switches.cc +=================================================================== +--- dev.vivid.orig/content/public/common/content_switches.cc 2015-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/public/common/content_switches.cc 2015-06-02 15:12:59.290303784 -0400 +@@ -962,7 +962,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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/public/common/content_switches.h 2015-06-02 15:12:59.290303784 -0400 +@@ -273,7 +273,7 @@ + + CONTENT_EXPORT extern const char kDisableWebAudio[]; + +-#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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/media/media.gyp 2015-06-02 15:12:59.290303784 -0400 +@@ -708,7 +708,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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/gpu/config/software_rendering_list_json.cc 2015-06-02 15:12:59.290303784 -0400 +@@ -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": [ +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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2015-06-02 15:12:59.291303771 -0400 +@@ -21,6 +21,8 @@ + #include "base/logging.h" + #include "base/memory/scoped_ptr.h" + #include "build/build_config.h" ++// Auto-generated for dlopen libva libraries ++#include "content/common/gpu/media/va_stubs.h" + #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" +@@ -31,6 +33,8 @@ + #include "sandbox/linux/syscall_broker/broker_file_permission.h" + #include "sandbox/linux/syscall_broker/broker_process.h" + #include "sandbox/linux/system_headers/linux_syscalls.h" ++#include "third_party/libva/va/va.h" ++#include "third_party/libva/va/va_x11.h" + + using sandbox::arch_seccomp_data; + using sandbox::bpf_dsl::Allow; +@@ -40,6 +44,11 @@ + 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; ++ + namespace content { + + namespace { +@@ -94,7 +103,7 @@ + + bool IsAcceleratedVaapiVideoEncodeEnabled() { + bool accelerated_encode_enabled = false; +-#if defined(OS_CHROMEOS) ++#if defined(OS_CHROMEOS) || defined(OS_LINUX) + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + accelerated_encode_enabled = +@@ -295,27 +304,41 @@ + // inside the sandbox, so preload them now. + if (IsAcceleratedVaapiVideoEncodeEnabled() || + IsAcceleratedVideoDecodeEnabled()) { +- const char* I965DrvVideoPath = NULL; +- const char* I965HybridDrvVideoPath = NULL; ++ 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 (!InitializeStubs(paths)) { ++ VLOG(1) << "Failed to initialize stubs"; ++ return false; ++ } + +- 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"; ++ // libva drivers won't get loaded even above two libraries get dlopened. ++ // Thus, libva calls will fail after post sandbox stage. ++ // ++ // To get the va driver loaded before sandboxing, upstream simply dlopen ++ // the hard-coded va driver path because ChromeOS is the only platform ++ // that Google want to support libva. ++ // ++ // While generic linux distros ship va driver as anywhere they want. ++ // 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) +- 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 +- } +- } ++ int major_version, minor_version; ++ if (vaInitialize(va_display, &major_version, &minor_version) ++ != VA_STATUS_SUCCESS) { ++ VLOG(1) << "Failed to call vaInitialize()"; ++ return false; ++ } ++ } // end of IsAcceleratedVaapiVideoEncodeEnabled() || IsAcceleratedVideoDecodeEnabled() ++ } // end of IsArchitectureX86_64() || IsArchitectureI386() + + return true; + } +Index: dev.vivid/chrome/browser/about_flags.cc +=================================================================== +--- dev.vivid.orig/chrome/browser/about_flags.cc 2015-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/chrome/browser/about_flags.cc 2015-06-02 15:12:59.292303758 -0400 +@@ -1072,7 +1072,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-06-02 15:12:59.295303719 -0400 ++++ dev.vivid/content/common/gpu/media/vaapi_wrapper.cc 2015-06-02 15:12:59.293303745 -0400 +@@ -146,7 +146,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; + } + +@@ -378,7 +378,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; +@@ -402,8 +402,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 --git a/enable_vaapi_on_linux.diff b/enable_vaapi_on_linux.diff index 19f5cd6ef9d1..99b84a7b173e 100644 --- a/enable_vaapi_on_linux.diff +++ b/enable_vaapi_on_linux.diff @@ -191,6 +191,7 @@ Index: dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc if (IsAcceleratedVaapiVideoEncodeEnabled() || IsAcceleratedVideoDecodeEnabled()) { - const char* I965DrvVideoPath = NULL; +- const char* I965HybridDrvVideoPath = NULL; + VLOG(1) << "Attempting to enable hardware video acceleration."; + StubPathMap paths; + paths[kModuleVa].push_back("libva.so.1"); @@ -202,6 +203,7 @@ Index: dev.vivid/content/common/sandbox_linux/bpf_gpu_policy_linux.cc - 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"; + // libva drivers won't get loaded even above two libraries get dlopened. |