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

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

Issue 784553004: Revert of Generalize V4L2 HW video codec device names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/v4l2_video_device.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_cros_arm_gpu_policy_linux.h" 5 #include "content/common/sandbox_linux/bpf_cros_arm_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return true; 52 return true;
53 #else 53 #else
54 return false; 54 return false;
55 #endif 55 #endif
56 } 56 }
57 57
58 void AddArmMaliGpuWhitelist(std::vector<BrokerFilePermission>* permissions) { 58 void AddArmMaliGpuWhitelist(std::vector<BrokerFilePermission>* permissions) {
59 // Device file needed by the ARM GPU userspace. 59 // Device file needed by the ARM GPU userspace.
60 static const char kMali0Path[] = "/dev/mali0"; 60 static const char kMali0Path[] = "/dev/mali0";
61 61
62 // Devices nodes for V4L2 video decode accelerator drivers. 62 // Devices needed for video decode acceleration on ARM.
63 static const char kDevVideoDecPath[] = "/dev/video-dec"; 63 static const char kDevMfcDecPath[] = "/dev/mfc-dec";
64
65 // Video processor used on ARM Exynos platforms.
66 static const char kDevGsc1Path[] = "/dev/gsc1"; 64 static const char kDevGsc1Path[] = "/dev/gsc1";
67 65
68 // Devices nodes for V4L2 video encode accelerator drivers. 66 // Devices needed for video encode acceleration on ARM.
69 static const char kDevVideoEncPath[] = "/dev/video-enc"; 67 static const char kDevMfcEncPath[] = "/dev/mfc-enc";
70 68
71 permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path)); 69 permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path));
72 permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoDecPath)); 70 permissions->push_back(BrokerFilePermission::ReadWrite(kDevMfcDecPath));
73 permissions->push_back(BrokerFilePermission::ReadWrite(kDevGsc1Path)); 71 permissions->push_back(BrokerFilePermission::ReadWrite(kDevGsc1Path));
74 permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoEncPath)); 72 permissions->push_back(BrokerFilePermission::ReadWrite(kDevMfcEncPath));
75 } 73 }
76 74
77 void AddArmGpuWhitelist(std::vector<BrokerFilePermission>* permissions) { 75 void AddArmGpuWhitelist(std::vector<BrokerFilePermission>* permissions) {
78 // On ARM we're enabling the sandbox before the X connection is made, 76 // On ARM we're enabling the sandbox before the X connection is made,
79 // so we need to allow access to |.Xauthority|. 77 // so we need to allow access to |.Xauthority|.
80 static const char kXAuthorityPath[] = "/home/chronos/.Xauthority"; 78 static const char kXAuthorityPath[] = "/home/chronos/.Xauthority";
81 static const char kLdSoCache[] = "/etc/ld.so.cache"; 79 static const char kLdSoCache[] = "/etc/ld.so.cache";
82 80
83 // Files needed by the ARM GPU userspace. 81 // Files needed by the ARM GPU userspace.
84 static const char kLibGlesPath[] = "/usr/lib/libGLESv2.so.2"; 82 static const char kLibGlesPath[] = "/usr/lib/libGLESv2.so.2";
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Preload the Tegra V4L2 (video decode acceleration) library. 171 // Preload the Tegra V4L2 (video decode acceleration) library.
174 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); 172 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag);
175 // Resetting errno since platform-specific libraries will fail on other 173 // Resetting errno since platform-specific libraries will fail on other
176 // platforms. 174 // platforms.
177 errno = 0; 175 errno = 0;
178 176
179 return true; 177 return true;
180 } 178 }
181 179
182 } // namespace content 180 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/v4l2_video_device.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698