virtio-gpu: build modular

Only build virtio-gpu-device modular (the code which actually depends on
the external virglrenderer library).  virtio-gpu-pci and virtio-vga are
compiled into core qemu still.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200914134224.29769-7-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2020-09-14 15:42:24 +02:00
parent 3b593b3fe4
commit 7b0de5b796
2 changed files with 8 additions and 16 deletions

View File

@ -59,24 +59,14 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU',
if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c', 'virtio-gpu-3d.c'), pixman, virgl])
virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c'))
virtio_gpu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('virtio-gpu-pci.c'))
virtio_gpu_ss.add(when: ['CONFIG_VHOST_USER_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('vhost-user-gpu-pci.c'))
virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_VGA', if_true: files('virtio-vga.c'))
virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_VGA', if_true: files('vhost-user-vga.c'))
# FIXME: this was attempted in the Makefile build system; it was then reverted
# as it would try to load all devices when the module is loaded, even if
# config_devices for this target only has some of them. Since virtio-gpu-pci
# and virtio-vga both instantiate a virtio-gpu-device, fixing it probably does
# not even require a dependency system, just splitting the module in three
# for CONFIG_VIRTIO_GPU/CONFIG_VHOST_USER_GPU, CONFIG_VIRTIO_PCI and
# CONFIG_VIRTIO_VGA/CONFIG_VHOST_USER_VGA.
# Sourcesets are a dime a dozen, so keep it and just disable module builds.
#hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
softmmu_ss.add_all(virtio_gpu_ss)
hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
endif
softmmu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('virtio-gpu-pci.c'))
softmmu_ss.add(when: ['CONFIG_VHOST_USER_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('vhost-user-gpu-pci.c'))
softmmu_ss.add(when: 'CONFIG_VIRTIO_VGA', if_true: files('virtio-vga.c'))
softmmu_ss.add(when: 'CONFIG_VHOST_USER_VGA', if_true: files('vhost-user-vga.c'))
specific_ss.add(when: [x11, opengl, 'CONFIG_MILKYMIST_TMU2'], if_true: files('milkymist-tmu2.c'))
specific_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_lcdc.c'))

View File

@ -265,6 +265,8 @@ static struct {
{ "usb-redir", "hw-", "usb-redirect" },
{ "qxl-vga", "hw-", "display-qxl" },
{ "qxl", "hw-", "display-qxl" },
{ "virtio-gpu-device", "hw-", "display-virtio-gpu" },
{ "vhost-user-gpu", "hw-", "display-virtio-gpu" },
{ "chardev-braille", "chardev-", "baum" },
};