OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 InitGpuBrokerProcess( | 293 InitGpuBrokerProcess( |
294 GpuBrokerProcessPolicy::Create, | 294 GpuBrokerProcessPolicy::Create, |
295 std::vector<BrokerFilePermission>()); // No extra files in whitelist. | 295 std::vector<BrokerFilePermission>()); // No extra files in whitelist. |
296 | 296 |
297 if (IsArchitectureX86_64() || IsArchitectureI386()) { | 297 if (IsArchitectureX86_64() || IsArchitectureI386()) { |
298 // Accelerated video dlopen()'s some shared objects | 298 // Accelerated video dlopen()'s some shared objects |
299 // inside the sandbox, so preload them now. | 299 // inside the sandbox, so preload them now. |
300 if (IsAcceleratedVaapiVideoEncodeEnabled() || | 300 if (IsAcceleratedVaapiVideoEncodeEnabled() || |
301 IsAcceleratedVideoDecodeEnabled()) { | 301 IsAcceleratedVideoDecodeEnabled()) { |
302 const char* I965DrvVideoPath = NULL; | 302 const char* I965DrvVideoPath = NULL; |
| 303 const char* I965HybridDrvVideoPath = NULL; |
303 | 304 |
304 if (IsArchitectureX86_64()) { | 305 if (IsArchitectureX86_64()) { |
305 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; | 306 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; |
| 307 I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; |
306 } else if (IsArchitectureI386()) { | 308 } else if (IsArchitectureI386()) { |
307 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; | 309 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; |
308 } | 310 } |
309 | 311 |
310 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 312 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 313 if (I965HybridDrvVideoPath) |
| 314 dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
311 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 315 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
312 #if defined(USE_OZONE) | 316 #if defined(USE_OZONE) |
313 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 317 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
314 #elif defined(USE_X11) | 318 #elif defined(USE_X11) |
315 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 319 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
316 #endif | 320 #endif |
317 } | 321 } |
318 } | 322 } |
319 | 323 |
320 return true; | 324 return true; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 356 } |
353 | 357 |
354 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); | 358 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); |
355 // The initialization callback will perform generic initialization and then | 359 // The initialization callback will perform generic initialization and then |
356 // call broker_sandboxer_callback. | 360 // call broker_sandboxer_callback. |
357 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 361 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
358 broker_sandboxer_allocator))); | 362 broker_sandboxer_allocator))); |
359 } | 363 } |
360 | 364 |
361 } // namespace content | 365 } // namespace content |
OLD | NEW |