Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: content/common/sandbox_linux/bpf_gpu_policy_linux.cc

Issue 1345943009: Reland: Add accelerated VP9 decode infrastructure and an implementation for VA-API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/gpu/media/vp9_picture.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/gpu/media/vp9_picture.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698