virtio-gpu: Support Venus context

Request Venus when initializing VirGL and if venus=true flag is set for
virtio-gpu-gl device.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Message-Id: <20241024210311.118220-14-dmitry.osipenko@collabora.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Antonio Caggiano 2024-10-25 00:03:11 +03:00 committed by Alex Bennée
parent 1333fd0693
commit 94d0ea1c19
5 changed files with 49 additions and 4 deletions

View file

@ -1477,6 +1477,21 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
#endif
}
if (virtio_gpu_venus_enabled(g->parent_obj.conf)) {
#ifdef VIRGL_VERSION_MAJOR
#if VIRGL_VERSION_MAJOR >= 1
if (!virtio_gpu_blob_enabled(g->parent_obj.conf) ||
!virtio_gpu_hostmem_enabled(g->parent_obj.conf)) {
error_setg(errp, "venus requires enabled blob and hostmem options");
return;
}
#else
error_setg(errp, "old virglrenderer, venus unsupported");
return;
#endif
#endif
}
if (!virtio_gpu_base_device_realize(qdev,
virtio_gpu_handle_ctrl_cb,
virtio_gpu_handle_cursor_cb,