[Frugalware-git] frugalware-current: chromium-browser-59.0.3071.86-1-x86_64

DeX77 dex77 at frugalware.org
Wed Jun 7 15:06:14 CEST 2017


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=22a01ec6d6a9089f46b3fcb8c6e350079e67d013

commit 22a01ec6d6a9089f46b3fcb8c6e350079e67d013
Author: DeX77 <dex77 at frugalware.org>
Date:   Wed Jun 7 14:57:49 2017 +0200

chromium-browser-59.0.3071.86-1-x86_64

* version bump

diff --git a/source/xapps-extra/chromium-browser/FrugalBuild b/source/xapps-extra/chromium-browser/FrugalBuild
index 9862353..d3772f8 100644
--- a/source/xapps-extra/chromium-browser/FrugalBuild
+++ b/source/xapps-extra/chromium-browser/FrugalBuild
@@ -2,13 +2,13 @@
# Maintainer: Marius Cirsta <mcirsta at frugalware.org>

pkgname=chromium-browser
-pkgver=58.0.3029.81
-pkgrel=2
+pkgver=59.0.3071.86
+pkgrel=1
pkgdesc='Development version of Chromium browser'
url='http://www.chromium.org/'
depends=('nss>=3.21-3' 'libxscrnsaver>=1.2.2-2' 'libpulse>=7.1-4' 'snappy>=1.1.3-2' 'libcups' \
-	'speech-dispatcher>=0.7.1-4' 'libxtst>=1.2.2-2' 'freetype2' 'pango' 'ffmpeg>=3.1.4' 'atk' 'libxkbcommon' \
-	'libatomic' 'pciutils>=3.5' 'gtk+3' 'libxslt' 'libwebp' 'icu4c>=58.1' 'libwebp>=0.6.0')
+	'speech-dispatcher>=0.7.1-4' 'libxtst>=1.2.2-2' 'pango' 'ffmpeg>=3.1.4' 'atk' 'libxkbcommon' \
+	'libatomic' 'pciutils>=3.5' 'gtk+3' 'libxslt' 'libwebp' 'icu4c>=58.1' 'libwebp>=0.6.0' 'libdrm')
#using the built in ones for now
#depends+=('libevent>=2.0.22-3' 'libjpeg>=9a')
makedepends=('ninja' 'clang>=3.7.0-3' 'yasm' 'libexif' 'gperf' 'libpthread-stubs' 'x11-protos' 'krb5' 'cups' 'gtk+2'\
@@ -26,28 +26,28 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom
$pkgname.desktop \
$pkgname.sh \
chromium-gn-bootstrap-r2.patch \
-        chromium-system-ffmpeg-r4.patch \
+	chromium-system-ffmpeg-r6.patch \
chromium-last-commit-position-r1.patch \
gcc6-no-delete-null-pointer-checks.patch \
chromium-46.0.2490.86-use_system_opus.patch \
chromium-47.0.2526.80-nacl-ignore-broken-fd-counter.patch \
chromium-58.0.3029.81-use_system_harfbuzz.patch \
chromium-54.0.2840.59-nullfix.patch \
-	chromium-widevine.patch \
-	vaapi_patch_r0.patch )
-sha1sums=('76a3c7ef3a90c0eebe22be3ba5af69366af60f48' \
+	fix-compile-error-linux-dma-buf-has-no-such-defines-2.patch \
+	chromium-widevine.patch )
+sha1sums=('b700714b7830ca4133616d51a77a30430133b341' \
'264b8e7c4e3273263d504e041e5e4d152677922c' \
'4c41d59b4d85a9f0443d6ca1dec456e50059dab5' \
'b25a672de974efc34429ce6f7ec14b8ed9d250f8' \
-          'e7db42be95f3ca28a270df45d884b12f66686716' \
+          'c5ffc64e60004c2e87ba0869b02ae5cf9a8f0c55' \
'd03e6465cd5a84580f9dad5d45f24ccd42bb71e6' \
'0fa01f6ac92d4616cdc74073952ada2259be1d70' \
'd6d09996ff5ff4d796cf26f239eb2b688e017d25' \
'af663b4b7a7a9e6f0075c4f60f0b4310a77d2d89' \
'38b79bdb506d7b186b1c909ffd9f7366e1f56cd7' \
'a3e76fd3e890eabab86d14fc41ca9b17b03317e4' \
-          'c5719d06e0b39dfd3ca74f9f42684f4ee7584ade' \
-          '05547588ff218cc720b444af9931392fac5a2f56')
+          '0b811a212fb9ed67b7e3e27a76dca9932699640f' \
+          'c5719d06e0b39dfd3ca74f9f42684f4ee7584ade')

chromium_path="chromium"

@@ -146,7 +146,7 @@ build() {
'third_party/libudev' \
'third_party/libusb' \
'third_party/libwebm' \
-		'third_party/libxml/chromium' \
+		'third_party/libxml' \
'third_party/libyuv' \
'third_party/lss' \
'third_party/lzma_sdk' \
@@ -159,16 +159,18 @@ build() {
'third_party/opus' \
'third_party/ots' \
'third_party/pdfium' \
+		'third_party/pdfium/third_party/base' \
+		'third_party/pdfium/third_party/build' \
'third_party/pdfium/third_party/agg23' \
'third_party/pdfium/third_party/base' \
'third_party/pdfium/third_party/bigint' \
'third_party/pdfium/third_party/freetype' \
'third_party/pdfium/third_party/lcms2-2.6' \
-		'third_party/pdfium/third_party/libjpeg' \
'third_party/pdfium/third_party/libopenjpeg20' \
'third_party/pdfium/third_party/libpng16' \
'third_party/pdfium/third_party/libtiff' \
'third_party/pdfium/third_party/zlib_v128' \
+		'third_party/freetype' \
'third_party/ply' \
'third_party/polymer' \
'third_party/protobuf' \
@@ -198,6 +200,11 @@ build() {
'third_party/libvpx/source/libvpx/third_party/x86inc' \
'third_party/widevine' \
'third_party/libva' \
+		'third_party/swiftshader' \
+		'third_party/swiftshader/third_party/subzero' \
+		'third_party/swiftshader/third_party/llvm-subzero' \
+		'native_client/src/third_party/dlmalloc' \
+		'native_client_sdk/src/libraries/third_party/newlib-extras' \
--do-remove


@@ -206,12 +213,12 @@ build() {
harfbuzz-ng
libpng
libwebp
-		libxml
libxslt
snappy
yasm
zlib
-		ffmpeg"
+		ffmpeg
+		libdrm"

Fexec build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries} || Fdie

@@ -227,7 +234,7 @@ build() {

myconf_gn+=" enable_hangout_services_extension=false"
myconf_gn+=" enable_widevine=true"
-	myconf_gn+=" use_allocator=\"none\""
+	myconf_gn+=" use_allocator=\"tcmalloc\""
myconf_gn+=" use_kerberos=true"
myconf_gn+=" use_pulseaudio=true"
myconf_gn+=" fieldtrial_testing_like_official_build=true"
@@ -260,6 +267,7 @@ build() {

Fexec out/Release/gn gen --args="${myconf_gn}" out/Release || Fdie
Fexec mkdir -p third_party/node/linux/node-linux-x64/bin || Fdie
+	Fexec rm -rf third_party/node/linux/node-linux-x64/bin/node
Fexec ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/

Fexec ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter || Fdie
diff --git a/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r4.patch b/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r4.patch
deleted file mode 100644
index 3abfc16..0000000
--- a/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r4.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- a/media/ffmpeg/ffmpeg_common.h.orig	2016-09-09 13:16:07.757294768 +0000
-+++ b/media/ffmpeg/ffmpeg_common.h	2016-09-09 13:16:41.705989273 +0000
-@@ -22,10 +22,6 @@
-
- // Include FFmpeg header files.
- extern "C" {
--// Disable deprecated features which result in spammy compile warnings.  This
--// list of defines must mirror those in the 'defines' section of FFmpeg's
--// BUILD.gn file or the headers below will generate different structures!
--#define FF_API_CONVERGENCE_DURATION 0
- // Upstream libavcodec/utils.c still uses the deprecated
- // av_dup_packet(), causing deprecation warnings.
- // The normal fix for such things is to disable the feature as below,
-@@ -35,7 +35,6 @@
- MSVC_PUSH_DISABLE_WARNING(4244);
- #include <libavcodec/avcodec.h>
- #include <libavformat/avformat.h>
--#include <libavformat/internal.h>
- #include <libavformat/avio.h>
- #include <libavutil/avutil.h>
- #include <libavutil/imgutils.h>
---- a/media/filters/ffmpeg_demuxer.cc.orig	2016-09-09 14:21:40.185828912 +0000
-+++ b/media/filters/ffmpeg_demuxer.cc	2016-09-09 14:21:52.894089352 +0000
-@@ -1185,24 +1185,6 @@
-   // If no estimate is found, the stream entry will be kInfiniteDuration.
-   std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
-                                                     kInfiniteDuration);
--  const AVFormatInternal* internal = format_context->internal;
--  if (internal && internal->packet_buffer &&
--      format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
--    struct AVPacketList* packet_buffer = internal->packet_buffer;
--    while (packet_buffer != internal->packet_buffer_end) {
--      DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
--                start_time_estimates.size());
--      const AVStream* stream =
--          format_context->streams[packet_buffer->pkt.stream_index];
--      if (packet_buffer->pkt.pts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
--        const base::TimeDelta packet_pts =
--            ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
--        if (packet_pts < start_time_estimates[stream->index])
--          start_time_estimates[stream->index] = packet_pts;
--      }
--      packet_buffer = packet_buffer->next;
--    }
--  }
-
-   std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
-
diff --git a/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r6.patch b/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r6.patch
new file mode 100644
index 0000000..d2e0157
--- /dev/null
+++ b/source/xapps-extra/chromium-browser/chromium-system-ffmpeg-r6.patch
@@ -0,0 +1,43 @@
+--- a/media/ffmpeg/ffmpeg_common.h.orig	2017-04-07 18:17:22.623538889 +0000
++++ b/media/ffmpeg/ffmpeg_common.h	2017-04-07 18:18:16.780656283 +0000
+@@ -23,10 +23,12 @@
+
+ // Include FFmpeg header files.
+ extern "C" {
++#if !defined(USE_SYSTEM_FFMPEG)
+ // Disable deprecated features which result in spammy compile warnings.  This
+ // list of defines must mirror those in the 'defines' section of FFmpeg's
+ // BUILD.gn file or the headers below will generate different structures!
+ #define FF_API_CONVERGENCE_DURATION 0
++#endif  // !defined(USE_SYSTEM_FFMPEG)
+ // Upstream libavcodec/utils.c still uses the deprecated
+ // av_dup_packet(), causing deprecation warnings.
+ // The normal fix for such things is to disable the feature as below,
+@@ -40,7 +42,9 @@
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
++#if !defined(USE_SYSTEM_FFMPEG)
+ #include <libavformat/internal.h>
++#endif  // !defined(USE_SYSTEM_FFMPEG)
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/imgutils.h>
+--- a/media/filters/ffmpeg_demuxer.cc.orig	2017-04-07 18:15:14.776901183 +0000
++++ b/media/filters/ffmpeg_demuxer.cc	2017-04-07 18:15:54.813727201 +0000
+@@ -1223,6 +1223,7 @@
+   // If no estimate is found, the stream entry will be kInfiniteDuration.
+   std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
+                                                     kInfiniteDuration);
++#if !defined(USE_SYSTEM_FFMPEG)
+   const AVFormatInternal* internal = format_context->internal;
+   if (internal && internal->packet_buffer &&
+       format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+@@ -1246,6 +1247,7 @@
+       packet_buffer = packet_buffer->next;
+     }
+   }
++#endif  // !defined(USE_SYSTEM_FFMPEG)
+
+   std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
+
diff --git a/source/xapps-extra/chromium-browser/fix-compile-error-linux-dma-buf-has-no-such-defines-2.patch b/source/xapps-extra/chromium-browser/fix-compile-error-linux-dma-buf-has-no-such-defines-2.patch
new file mode 100644
index 0000000..bcfc9ee
--- /dev/null
+++ b/source/xapps-extra/chromium-browser/fix-compile-error-linux-dma-buf-has-no-such-defines-2.patch
@@ -0,0 +1,61 @@
+diff -Naur chromium-59.0.3071.86/ui/gfx/linux/client_native_pixmap_dmabuf.cc chromium-59.0.3071.86-p/ui/gfx/linux/client_native_pixmap_dmabuf.cc
+--- chromium-59.0.3071.86/ui/gfx/linux/client_native_pixmap_dmabuf.cc	2017-06-05 21:03:30.000000000 +0200
++++ chromium-59.0.3071.86-p/ui/gfx/linux/client_native_pixmap_dmabuf.cc	2017-06-07 12:47:05.469069729 +0200
+@@ -24,16 +24,16 @@
+   __u64 flags;
+ };
+
+-#define LOCAL_DMA_BUF_SYNC_READ (1 << 0)
+-#define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0)
+-#define LOCAL_DMA_BUF_SYNC_RW \
+-  (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
+-#define LOCAL_DMA_BUF_SYNC_START (0 << 2)
+-#define LOCAL_DMA_BUF_SYNC_END (1 << 2)
+-
+-#define LOCAL_DMA_BUF_BASE 'b'
+-#define LOCAL_DMA_BUF_IOCTL_SYNC \
+-  _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)
++#define DMA_BUF_SYNC_READ (1 << 0)
++#define DMA_BUF_SYNC_WRITE (2 << 0)
++#define DMA_BUF_SYNC_RW \
++  (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
++#define DMA_BUF_SYNC_START (0 << 2)
++#define DMA_BUF_SYNC_END (1 << 2)
++
++#define DMA_BUF_BASE 'b'
++#define DMA_BUF_IOCTL_SYNC \
++  _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
+
+ #else
+ #include <linux/dma-buf.h>
+@@ -44,24 +44,24 @@
+ namespace {
+
+ void PrimeSyncStart(int dmabuf_fd) {
+-  struct local_dma_buf_sync sync_start = {0};
++  struct dma_buf_sync sync_start = {0};
+
+-  sync_start.flags = LOCAL_DMA_BUF_SYNC_START | LOCAL_DMA_BUF_SYNC_RW;
++  sync_start.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
+ #if DCHECK_IS_ON()
+   int rv =
+ #endif
+-      drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_start);
++      drmIoctl(dmabuf_fd, DMA_BUF_IOCTL_SYNC, &sync_start);
+   DPLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_START";
+ }
+
+ void PrimeSyncEnd(int dmabuf_fd) {
+-  struct local_dma_buf_sync sync_end = {0};
++  struct dma_buf_sync sync_end = {0};
+
+-  sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_RW;
++  sync_end.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
+ #if DCHECK_IS_ON()
+   int rv =
+ #endif
+-      drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end);
++      drmIoctl(dmabuf_fd, DMA_BUF_IOCTL_SYNC, &sync_end);
+   DPLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_END";
+ }
+
diff --git a/source/xapps-extra/chromium-browser/vaapi_patch_r0.patch b/source/xapps-extra/chromium-browser/vaapi_patch_r0.patch
deleted file mode 100644
index 0ba9332..0000000
--- a/source/xapps-extra/chromium-browser/vaapi_patch_r0.patch
+++ /dev/null
@@ -1,616 +0,0 @@
---- a/chrome/browser/about_flags.cc
-+++ b/chrome/browser/about_flags.cc
-@@ -1044,7 +1044,7 @@ const FeatureEntry kFeatureEntries[] = {
-         "disable-accelerated-video-decode",
-         IDS_FLAGS_ACCELERATED_VIDEO_DECODE_NAME,
-         IDS_FLAGS_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
--        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
-+        kOsAll,
-         SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
-     },
- #if defined(USE_ASH)
---- a/content/common/BUILD.gn
-+++ b/content/common/BUILD.gn
-@@ -13,6 +13,49 @@ if (is_mac) {
-   import("//build/config/mac/mac_sdk.gni")
- }
-
-+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)
-@@ -525,6 +568,16 @@ source_set("common") {
-         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
-       ]
-     }
-+  } else {
-+    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" ]
-+      }
-+    }
-   }
-
-   if (is_mac) {
---- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
-+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
-@@ -25,6 +25,12 @@
- #include "base/memory/ptr_util.h"
- #include "base/strings/stringprintf.h"
- #include "build/build_config.h"
-+
-+#if !defined(__arm__)
-+// Auto-generated for dlopen libva libraries
-+#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"
-@@ -36,6 +42,28 @@
- #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_backend.h"
-+#if defined(USE_X11)
-+#include "third_party/libva/va/va_x11.h"
-+#include "ui/gfx/x/x11_types.h"
-+#elif defined(USE_OZONE)
-+#include "base/files/file.h"
-+#include "third_party/libva/va/drm/va_drm.h"
-+#include "third_party/libva/va/va_drmcommon.h"
-+#endif
-+#endif
-+
-+#define DRIVER_EXTENSION        "_drv_video.so"
-+#if defined(__x86_64__)
-+#define VA_DRIVERS_PATH         "/usr/lib/dri"
-+#elif defined(__i386__)
-+#define VA_DRIVERS_PATH         "/usr/lib/dri"
-+#elif defined(__aarch64__)
-+#define VA_DRIVERS_PATH         "/usr/lib/dri"
-+#endif
-+
- using sandbox::arch_seccomp_data;
- using sandbox::bpf_dsl::Allow;
- using sandbox::bpf_dsl::ResultExpr;
-@@ -44,6 +72,17 @@ using sandbox::syscall_broker::BrokerFilePermission;
- using sandbox::syscall_broker::BrokerProcess;
- using sandbox::SyscallSets;
-
-+#if !defined(__arm__)
-+using content_common::kModuleVa;
-+#if defined(USE_X11)
-+using content_common::kModuleVa_x11;
-+#elif defined(USE_OZONE)
-+using content_common::kModuleVa_drm;
-+#endif
-+using content_common::InitializeStubs;
-+using content_common::StubPathMap;
-+#endif
-+
- namespace content {
-
- namespace {
-@@ -98,7 +137,7 @@ inline bool UseLibV4L2() {
-
- 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 =
-@@ -290,6 +329,36 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
-   }
- }
-
-+#if !defined(__arm__)
-+static VADisplay VaapiGetVADisplay() {
-+  StubPathMap paths;
-+  VADisplay va_display;
-+  paths[kModuleVa].push_back("libva.so.1");
-+#if defined(USE_OZONE)
-+  paths[kModuleVa_drm].push_back("libva-drm.so.1");
-+#elif defined (USE_X11)
-+  paths[kModuleVa_x11].push_back("libva-x11.so.1");
-+#endif
-+  if (!InitializeStubs(paths)) {
-+    return NULL;
-+  }
-+#if defined(USE_OZONE)
-+  const char kDriRenderNode0Path[] = "/dev/dri/renderD128";
-+  base::File drm_file = base::File(
-+      base::FilePath::FromUTF8Unsafe(kDriRenderNode0Path),
-+      base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
-+  va_display = vaGetDisplayDRM(drm_file.GetPlatformFile());
-+#elif defined(USE_X11)
-+  va_display = vaGetDisplay(gfx::GetXDisplay());
-+#endif
-+  if (!vaDisplayIsValid(va_display)) {
-+    LOG(WARNING) << "Unable to get display.";
-+    return NULL;
-+  }
-+  return va_display;
-+}
-+#endif
-+
- bool GpuProcessPolicy::PreSandboxHook() {
-   // Warm up resources needed by the policy we're about to enable and
-   // eventually start a broker process.
-@@ -303,32 +372,75 @@ bool GpuProcessPolicy::PreSandboxHook() {
-       GpuBrokerProcessPolicy::Create,
-       std::vector<BrokerFilePermission>());  // No extra files in whitelist.
-
-+#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";
--      }
--
--      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);
-+      // Init a VA Context, get driver name (and path), close context and preload
-+#if defined(USE_OZONE) || defined(USE_X11)
-+      VADisplay va_display = VaapiGetVADisplay();
-+      if (va_display) {
-+        char *va_search_path = getenv("LIBVA_DRIVERS_PATH");
-+        char *va_driver_name = getenv("LIBVA_DRIVER_NAME");
-+        char *saveptr, *driver_dir;
-+        if (!va_driver_name) {
-+          VADisplayContextP pDisplayContext =
-+            static_cast<VADisplayContextP>(va_display);
-+          pDisplayContext->vaGetDriverName(pDisplayContext, &va_driver_name);
-+        }
-+
-+        if (!va_driver_name) {
-+          return true;
-+        }
-+
-+        if (!va_search_path) {
-+          va_search_path = strdup(VA_DRIVERS_PATH);
-+        }
-+
-+        driver_dir = strtok_r(va_search_path, ":", &saveptr);
-+        while (driver_dir) {
-+          std::string driver_path = base::StringPrintf("%s/%s%s", driver_dir,
-+              va_driver_name, DRIVER_EXTENSION);
-+
-+          // attempt to dlopen() the va driver
-+          LOG(INFO) << "Looking for " << driver_path << "...";
-+          if (access(driver_path.c_str(), R_OK) != -1) {
-+            LOG(WARNING) << "Attempting to pre-load " << va_driver_name << " VA driver...";
-+            if (dlopen(driver_path.c_str(), RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE)) {
-+              LOG(WARNING) << "VA driver \"" << driver_path << "\" opened!";
-+
-+              if (strcmp(va_driver_name, "nvidia") == 0) {
-+                LOG(WARNING) << "Pre-loading NVIDIA VDPAU driver libraries...";
-+                if (dlopen("libvdpau_nvidia.so", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE)) {
-+                  LOG(WARNING) << "Loaded libvdpau_nvidia.so";
-+                }
-+
-+                if (dlopen("libvdpau.so", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE)) {
-+                  LOG(WARNING) << "Loaded libvdpau.so";
-+                }
-+              }
-+              LOG(WARNING) << "Loading libva libraries...";
-+              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);
-+              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);
-+              dlopen("libva-x11.so.1", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
-+#endif
-+              break;
-+            }
-+            LOG(ERROR) << "VA driver failed to open!";
-+          }
-+
-+          driver_dir = strtok_r(NULL, ":", &saveptr);
-+        }
-+        free(va_search_path);
-+      }
- #endif
-     }
-   }
-+#endif
-
-   return true;
- }
---- /dev/null
-+++ b/content/common/va_wayland.sigs
-@@ -0,0 +1,8 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+//------------------------------------------------
-+// Functions from libva-wayland used in chromium code.
-+//------------------------------------------------
-+VADisplay vaGetDisplayWl(struct wl_display *display);
---- a/content/gpu/BUILD.gn
-+++ b/content/gpu/BUILD.gn
-@@ -92,7 +92,7 @@ target(link_target_type, "gpu_sources") {
-     ]
-   }
-
--  if (is_chromeos && current_cpu != "arm") {
-+  if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") {
-     configs += [ "//third_party/libva:libva_config" ]
-   }
-
---- a/content/gpu/gpu_main.cc
-+++ b/content/gpu/gpu_main.cc
-@@ -85,7 +85,7 @@
- #include "ui/ozone/public/ozone_platform.h"
- #endif
-
--#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
-+#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)
- #include "media/gpu/vaapi_wrapper.h"
- #endif
-
-@@ -141,7 +141,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper {
-       (void)base::RandUint64();
-     }
-
--#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
-+#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)
-     media::VaapiWrapper::PreSandboxInitialization();
- #endif
- #if defined(OS_WIN)
---- a/content/public/common/content_switches.cc
-+++ b/content/public/common/content_switches.cc
-@@ -1000,7 +1000,9 @@ const char kDisableAudioSupportForDesktopShare[] =
- #if defined(OS_CHROMEOS)
- // Disables panel fitting (used for mirror mode).
- const char kDisablePanelFitting[]           = "disable-panel-fitting";
-+#endif
-
-+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
- // Disables VA-API accelerated video encode.
- const char kDisableVaapiAcceleratedVideoEncode[] =
-     "disable-vaapi-accelerated-video-encode";
---- a/content/public/common/content_switches.h
-+++ b/content/public/common/content_switches.h
-@@ -291,6 +291,8 @@ CONTENT_EXPORT extern const char kEnableOSKOverscroll[];
-
- #if defined(OS_CHROMEOS)
- CONTENT_EXPORT extern const char kDisablePanelFitting[];
-+#endif
-+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
- CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[];
- #endif
-
---- a/gpu/config/software_rendering_list_json.cc
-+++ b/gpu/config/software_rendering_list_json.cc
-@@ -395,17 +395,6 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
-       ]
-     },
-     {
--      "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],
---- a/media/BUILD.gn
-+++ b/media/BUILD.gn
-@@ -396,7 +396,7 @@ component("media") {
-     allow_circular_includes_from = [ "//media/base/android" ]
-   }
-
--  if (current_cpu != "arm" && is_chromeos) {
-+  if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) {
-     sources += [
-       "filters/h264_bitstream_buffer.cc",
-       "filters/h264_bitstream_buffer.h",
-@@ -667,7 +667,7 @@ source_set("unit_tests") {
-     }
-   }
-
--  if (current_cpu != "arm" && is_chromeos) {
-+  if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) {
-     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
-   }
-
---- a/media/gpu/BUILD.gn
-+++ b/media/gpu/BUILD.gn
-@@ -18,7 +18,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"
-
-@@ -212,7 +212,7 @@ component("gpu") {
-     }
-   }
-
--  if (is_chromeos || is_win) {
-+  if (is_linux || is_win) {
-     sources += [
-       "accelerated_video_decoder.h",
-       "h264_decoder.cc",
-@@ -221,7 +221,7 @@ component("gpu") {
-       "h264_dpb.h",
-     ]
-   }
--  if (is_chromeos) {
-+  if (is_linux) {
-     sources += [
-       "vp8_decoder.cc",
-       "vp8_decoder.h",
-@@ -259,7 +259,7 @@ component("gpu") {
-         "GLESv2",
-       ]
-     }
--    if (current_cpu == "arm") {
-+    if (current_cpu == "arm" && is_chromeos) {
-       sources += [
-         "tegra_v4l2_device.cc",
-         "tegra_v4l2_device.h",
---- a/media/gpu/gpu_video_decode_accelerator_factory.cc
-+++ b/media/gpu/gpu_video_decode_accelerator_factory.cc
-@@ -16,7 +16,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"
-@@ -82,7 +82,7 @@ GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities(
- #if defined(OS_WIN)
-   capabilities.supported_profiles =
-       DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences);
--#elif defined(OS_CHROMEOS)
-+#elif defined(OS_CHROMEOS) || defined(OS_LINUX)
-   VideoDecodeAccelerator::SupportedProfiles vda_profiles;
- #if defined(USE_V4L2_CODEC)
-   vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles();
-@@ -135,7 +135,7 @@ GpuVideoDecodeAcceleratorFactory::CreateVDA(
-     &GpuVideoDecodeAcceleratorFactory::CreateV4L2VDA,
-     &GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA,
- #endif
--#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
-+#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)
-     &GpuVideoDecodeAcceleratorFactory::CreateVaapiVDA,
- #endif
- #if defined(OS_MACOSX)
-@@ -218,11 +218,12 @@ GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA(
- }
- #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<VideoDecodeAccelerator>
- GpuVideoDecodeAcceleratorFactory::CreateVaapiVDA(
-     const gpu::GpuDriverBugWorkarounds& workarounds,
-     const gpu::GpuPreferences& gpu_preferences) const {
-+  VLOG(1) << "Creating new VAAPI video decode accelerator.";
-   std::unique_ptr<VideoDecodeAccelerator> decoder;
-   decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_cb_,
-                                                 bind_image_cb_));
---- a/media/gpu/gpu_video_decode_accelerator_factory.h
-+++ b/media/gpu/gpu_video_decode_accelerator_factory.h
-@@ -101,7 +101,7 @@ class MEDIA_GPU_EXPORT GpuVideoDecodeAcceleratorFactory {
-       const gpu::GpuDriverBugWorkarounds& workarounds,
-       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<VideoDecodeAccelerator> CreateVaapiVDA(
-       const gpu::GpuDriverBugWorkarounds& workarounds,
-       const gpu::GpuPreferences& gpu_preferences) const;
---- a/media/gpu/ipc/service/BUILD.gn
-+++ b/media/gpu/ipc/service/BUILD.gn
-@@ -47,7 +47,7 @@ target(link_target_type, "service") {
-
-   configs += [ "//media/gpu:gpu_config" ]
-
--  if (is_chromeos && current_cpu != "arm") {
-+  if ((is_desktop_linux || is_chromeos) && current_cpu != "arm") {
-     configs += [ "//third_party/libva:libva_config" ]
-   }
-
---- a/media/gpu/ipc/service/gpu_video_decode_accelerator.cc
-+++ b/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)) || \
-+#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)) || \
-     defined(OS_MACOSX) || defined(OS_WIN)
- static bool BindImage(const base::WeakPtr<gpu::GpuCommandBufferStub>& stub,
-                       uint32_t client_texture_id,
-@@ -172,7 +172,7 @@ GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator(
-   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)) || \
-+#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_FAMILY)) || \
-     defined(OS_MACOSX) || defined(OS_WIN)
-   bind_image_cb_ = base::Bind(&BindImage, stub_->AsWeakPtr());
- #endif
---- a/media/gpu/va_stub_header.fragment
-+++ b/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
-
- }
---- a/media/gpu/vaapi_video_decode_accelerator.cc
-+++ b/media/gpu/vaapi_video_decode_accelerator.cc
-@@ -358,17 +358,17 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
-
-   base::AutoLock auto_lock(lock_);
-   DCHECK_EQ(state_, kUninitialized);
--  DVLOG(2) << "Initializing VAVDA, profile: " << GetProfileName(profile);
-+  VLOG(1) << "Initializing VAVDA, profile: " << GetProfileName(profile);
-
- #if defined(USE_X11)
-   if (gl::GetGLImplementation() != gl::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 (gl::GetGLImplementation() != gl::kGLImplementationEGLGLES2) {
--    DVLOG(1) << "HW video decode acceleration not available without "
-+    VLOG(1) << "HW video decode acceleration not available without "
-              << "EGLGLES2.";
-     return false;
-   }
-@@ -378,7 +378,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
-       VaapiWrapper::kDecode, profile, base::Bind(&ReportToUMA, VAAPI_ERROR));
-
-   if (!vaapi_wrapper_.get()) {
--    DVLOG(1) << "Failed initializing VAAPI for profile "
-+    VLOG(1) << "Failed initializing VAAPI for profile "
-              << GetProfileName(profile);
-     return false;
-   }
-@@ -394,7 +394,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
-     vp9_accelerator_.reset(new VaapiVP9Accelerator(this, vaapi_wrapper_.get()));
-     decoder_.reset(new VP9Decoder(vp9_accelerator_.get()));
-   } else {
--    DLOG(ERROR) << "Unsupported profile " << GetProfileName(profile);
-+    VLOG(1) << "Unsupported profile " << GetProfileName(profile);
-     return false;
-   }
-
---- a/media/gpu/vaapi_wrapper.cc
-+++ b/media/gpu/vaapi_wrapper.cc
-@@ -188,7 +188,7 @@ scoped_refptr<VaapiWrapper> VaapiWrapper::Create(
-     VAProfile va_profile,
-     const base::Closure& report_error_to_uma_cb) {
-   if (!GetProfileInfos()->IsProfileSupported(mode, va_profile)) {
--    DVLOG(1) << "Unsupported va_profile: " << va_profile;
-+    VLOG(1) << "Unsupported va_profile: " << va_profile;
-     return nullptr;
-   }
-
-@@ -340,15 +340,17 @@ VaapiWrapper::GetSupportedProfileInfosForCodecModeInternal(CodecMode mode) {
- 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;
-@@ -407,7 +409,7 @@ bool VaapiWrapper::IsEntrypointSupported_Locked(VAProfile va_profile,
-
-   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;
-@@ -431,8 +433,8 @@ bool VaapiWrapper::AreAttribsSupported_Locked(
-     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;
-     }
-   }


More information about the Frugalware-git mailing list