virtio-gpud: enable VirGL 3D feature negotiation

Uncommented VIRTIO_GPU_F_VIRGL (bit 0) and added feature
negotiation in probe_device(). When the host supports VirGL 3D,
the driver now acknowledges the feature, enabling Mesa's virgl
driver to use the 3D command path (CTX_CREATE, SUBMIT_3D,
RESOURCE_CREATE_3D, etc. already defined in CommandTy enum).

Cross-referenced with Linux 7.1 drivers/gpu/drm/virtio/virtgpu_drv.c
virtio_gpu_driver_open() and virtio spec v1.2 §5.7.6.

This is the enabling step for hardware-accelerated 3D rendering
in QEMU via virglrenderer.
This commit is contained in:
Red Bear OS
2026-07-09 12:45:05 +03:00
parent 08938e304b
commit edd31ce9c2
+6 -1
View File
@@ -32,7 +32,7 @@ use virtio_core::MSIX_PRIMARY_VECTOR;
mod scheme;
//const VIRTIO_GPU_F_VIRGL: u32 = 0;
const VIRTIO_GPU_F_VIRGL: u32 = 0;
const VIRTIO_GPU_F_EDID: u32 = 1;
//const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2;
//const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3;
@@ -511,6 +511,11 @@ fn deamon(deamon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> anyhow:
if has_edid {
device.transport.ack_driver_feature(VIRTIO_GPU_F_EDID);
}
let has_virgl = device.transport.check_device_feature(VIRTIO_GPU_F_VIRGL);
if has_virgl {
device.transport.ack_driver_feature(VIRTIO_GPU_F_VIRGL);
log::info!("virtio-gpud: VirGL 3D acceleration enabled");
}
device.transport.finalize_features();
// Queue for sending control commands.