@@ -115,6 +115,11 @@ static bool is_vgem_device(int fd)
return __is_device(fd, "vgem");
}
+static bool is_virtio_device(int fd)
+{
+ return __is_device(fd, "virt");
+}
+
static bool has_known_intel_chipset(int fd)
{
struct drm_i915_getparam gp;
@@ -260,6 +265,10 @@ int __drm_open_driver(int chipset)
is_vgem_device(fd))
return fd;
+ if (chipset & DRIVER_VIRTIO &&
+ is_virtio_device(fd))
+ return fd;
+
close(fd);
}
@@ -41,6 +41,7 @@
#define DRIVER_INTEL (1 << 0)
#define DRIVER_VC4 (1 << 1)
#define DRIVER_VGEM (1 << 2)
+#define DRIVER_VIRTIO (1 << 3)
#define DRIVER_ANY ~(DRIVER_VGEM)
#ifdef ANDROID