~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/patches/enable_vaapi_on_linux.diff

  • Committer: Chad MILLER
  • Date: 2015-05-19 14:12:12 UTC
  • Revision ID: chad.miller@canonical.com-20150519141212-t9pvxg3zb7y92k0h
Remove libva from compilation on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
   VAEntrypoint entrypoint =
63
63
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
64
64
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
65
 
@@ -21,6 +21,8 @@
 
65
@@ -21,6 +21,12 @@
66
66
 #include "base/logging.h"
67
67
 #include "base/memory/scoped_ptr.h"
68
68
 #include "build/build_config.h"
69
69
+// Auto-generated for dlopen libva libraries
70
 
+#include "content/common/gpu/media/va_stubs.h"
 
70
+#ifndef __arm__
 
71
+# ifndef __aarch64__
 
72
+#  include "content/common/gpu/media/va_stubs.h"
 
73
+# endif
 
74
+#endif
71
75
 #include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
72
76
 #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h"
73
77
 #include "content/common/set_process_title.h"
74
 
@@ -31,6 +33,8 @@
 
78
@@ -31,6 +37,8 @@
75
79
 #include "sandbox/linux/syscall_broker/broker_file_permission.h"
76
80
 #include "sandbox/linux/syscall_broker/broker_process.h"
77
81
 #include "sandbox/linux/system_headers/linux_syscalls.h"
80
84
 
81
85
 using sandbox::arch_seccomp_data;
82
86
 using sandbox::bpf_dsl::Allow;
83
 
@@ -40,6 +44,11 @@ using sandbox::syscall_broker::BrokerFil
 
87
@@ -40,6 +48,11 @@ using sandbox::syscall_broker::BrokerFil
84
88
 using sandbox::syscall_broker::BrokerProcess;
85
89
 using sandbox::SyscallSets;
86
90
 
92
96
 namespace content {
93
97
 
94
98
 namespace {
95
 
@@ -94,7 +103,7 @@ inline bool UseLibV4L2() {
 
99
@@ -94,7 +107,7 @@ inline bool UseLibV4L2() {
96
100
 
97
101
 bool IsAcceleratedVaapiVideoEncodeEnabled() {
98
102
   bool accelerated_encode_enabled = false;
101
105
   const base::CommandLine& command_line =
102
106
       *base::CommandLine::ForCurrentProcess();
103
107
   accelerated_encode_enabled =
104
 
@@ -295,23 +304,41 @@ bool GpuProcessPolicy::PreSandboxHook()
 
108
@@ -290,28 +303,51 @@ bool GpuProcessPolicy::PreSandboxHook()
 
109
       GpuBrokerProcessPolicy::Create,
 
110
       std::vector<BrokerFilePermission>());  // No extra files in whitelist.
 
111
 
 
112
+#ifndef __arm__
 
113
+# ifndef __aarch64__
 
114
+
 
115
   if (IsArchitectureX86_64() || IsArchitectureI386()) {
 
116
     // Accelerated video dlopen()'s some shared objects
105
117
     // inside the sandbox, so preload them now.
106
118
     if (IsAcceleratedVaapiVideoEncodeEnabled() ||
107
119
         IsAcceleratedVideoDecodeEnabled()) {
143
155
-      dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
144
156
-#elif defined(USE_X11)
145
157
-      dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
146
 
-#endif
147
 
-    }
148
 
-  }
149
158
+      int major_version, minor_version;
150
159
+      if (vaInitialize(va_display, &major_version, &minor_version)
151
160
+          != VA_STATUS_SUCCESS) {
154
163
+      }
155
164
+    }  // end of IsAcceleratedVaapiVideoEncodeEnabled() || IsAcceleratedVideoDecodeEnabled()
156
165
+  }  // end of IsArchitectureX86_64() || IsArchitectureI386()
 
166
+# endif
 
167
 #endif
 
168
-    }
 
169
-  }
157
170
 
158
171
   return true;
159
172
 }