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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user