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:
Gurchetan Singh 2025-06-16 07:42:56 -07:00 committed by Marge Bot
parent 7a723331a1
commit 5090aa7160

View file

@ -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) {