mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
gfxstream: fix opening virtgpu DRM
Somebody needs to modify Cuttlefish's SELinux rules to account for the syscalls used by drmGetDevices2(). Reviewed-by: Marcin Radomski <dextero@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35580>
This commit is contained in:
parent
7a723331a1
commit
5090aa7160
1 changed files with 10 additions and 1 deletions
|
|
@ -164,12 +164,21 @@ int32_t LinuxVirtGpuDevice::init(int32_t descriptor) {
|
|||
#endif
|
||||
|
||||
if (descriptor < 0) {
|
||||
#if DETECT_OS_ANDROID
|
||||
// Somebody needs to modify CF's SELinux rules to account for the syscalls used by
|
||||
// drmGetDevices2().
|
||||
mDeviceHandle = static_cast<int64_t>(drmOpenRender(128));
|
||||
if (mDeviceHandle < 0) {
|
||||
mesa_loge("Failed to open rendernode: %s", strerror(errno));
|
||||
return -EINVAL;
|
||||
}
|
||||
#else
|
||||
ret = openDevice();
|
||||
if (ret < 0) {
|
||||
mesa_logd("no virtio_gpu devices found");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
mDeviceHandle = dup(descriptor);
|
||||
if (mDeviceHandle < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue