Currently we have one virtio-gpu device. Problem with this approach is
that if you compile a full-featured qemu you'll get a virtio-gpu device
which depends on opengl and virgl, so these dependencies must be
installed and the libraries will be loaded into memory even if you don't
use virgl. Also the code is cluttered with #ifdefs and a bit messy.
This patch series splits the virtio-gpu device into two:
(1) virtio-gpu-device becomes the non-virgl device, same as
virtio-gpu-device,virgl=off today.
(2) virtio-gpu-gl-device is the new virgl device, same as
virtio-gpu-device,virgl=on today.
When compiling qemu without virglrenderer support virtio-gpu-device
behavior doesn't change.
v2:
- rebase to latest master.
- move pci and vga wrappers to separate modules.
- fix ci failures.
The patch series looks good.
But isn't that a breaking change? Any existing user of virtio-gpu/vga,virgl=on will no longer get a working setup. Right? Imho, in this case (virgl VM being not very common) the benefit is worth it. However, I suggest to keep the 'virgl=' property, and print a deprecation / replaced-by warning, falling back to non-virgl/2d mode. Or perhaps we could have more cleverness to have virgl=on aliasing to the new devices.
Gerd Hoffmann (16):
virtio-gpu: rename virgl source file.
virtio-gpu: add virtio-gpu-gl-device
virtio-gpu: move virgl realize + properties
virtio-gpu: move virgl reset
virtio-gpu: use class function for ctrl queue handlers
virtio-gpu: move virgl handle_ctrl
virtio-gpu: move virgl gl_flushed
virtio-gpu: move virgl process_cmd
virtio-gpu: move update_cursor_data
virtio-gpu: drop VIRGL() macro
virtio-gpu: move virtio-gpu-gl-device to separate module
virtio-gpu: drop use_virgl_renderer
virtio-gpu: move fields to struct VirtIOGPUGL
virtio-gpu: add virtio-gpu-gl-pci
modules: add have_vga
virtio-gpu: add virtio-vga-gl
include/hw/display/vga.h | 6 +
include/hw/virtio/virtio-gpu.h | 31 +++-
hw/display/vga.c | 2 +
hw/display/virtio-gpu-base.c | 6 +-
hw/display/virtio-gpu-gl.c | 163 ++++++++++++++++++
hw/display/virtio-gpu-pci-gl.c | 55 ++++++
.../{virtio-gpu-3d.c => virtio-gpu-virgl.c} | 0
hw/display/virtio-gpu.c | 142 +++------------
hw/display/virtio-vga-gl.c | 47 +++++
util/module.c | 7 +
hw/display/meson.build | 19 +-
11 files changed, 344 insertions(+), 134 deletions(-)
create mode 100644 hw/display/virtio-gpu-gl.c
create mode 100644 hw/display/virtio-gpu-pci-gl.c
rename hw/display/{virtio-gpu-3d.c => virtio-gpu-virgl.c} (100%)
create mode 100644 hw/display/virtio-vga-gl.c
--
2.30.2