Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
index 2460f02b65febb15e848fcba0a8315eaa2208906..5ee7ac84c6d4a36a94b81d55d5558330521b524d 100644 |
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
@@ -72,18 +72,6 @@ inline bool IsArchitectureArm() { |
#endif |
} |
-bool IsAcceleratedVideoDecodeEnabled() { |
- // Accelerated video decode is currently enabled on Chrome OS, |
- // but not on Linux: crbug.com/137247. |
- bool is_enabled = IsChromeOS(); |
- |
- const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
- is_enabled &= |
- !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode); |
- |
- return is_enabled; |
-} |
- |
intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args, |
void* aux_broker_process) { |
RAW_CHECK(aux_broker_process); |
@@ -214,13 +202,22 @@ bool GpuProcessPolicy::PreSandboxHook() { |
if (IsArchitectureX86_64() || IsArchitectureI386()) { |
// Accelerated video decode dlopen()'s some shared objects |
// inside the sandbox, so preload them now. |
- if (IsAcceleratedVideoDecodeEnabled()) { |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kDisableAcceleratedVideoDecode)) { |
const char* I965DrvVideoPath = NULL; |
if (IsArchitectureX86_64()) { |
+#if defined(OS_CHROMEOS) |
I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; |
+#else |
+ I965DrvVideoPath = "/usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so"; |
+#endif |
} else if (IsArchitectureI386()) { |
+#if defined(OS_CHROMEOS) |
I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; |
+#else |
+ I965DrvVideoPath = "/usr/lib/i386-linux-gnu/dri/i965_drv_video.so"; |
+#endif |
} |
dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |