@samitouri / QOSamiQemu / commits / 988499515d

hw/display: Build stubs once

Move stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary. Add pixman to qemuutil library dependencies since pixman is transitively included, which is needed to be able to include prototypes for stubs we declared: In file included from include/ui/console.h:4, include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or directory 10 | #include <pixman.h> | ^~~~~~~~~~ On OpenBSD, opengl headers are not available in default include path, and thus we need to add opengl to list of qemuutil dependencies, otherwise we get: In file included from ../hw/display/acpi-vga-stub.c:4: In file included from ../hw/display/vga_int.h:28: In file included from include/ui/console.h:9: include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' file not found # include <epoxy/gl.h> ^~~~~~~~~~~~ 1 error generated. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260225035739.42848-8-philmd@linaro.org> Co-developed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260315070834.198331-4-pierrick.bouvier@linaro.org>

Philippe Mathieu-Daudé committed Feb 24, 2026 at 19:14 UTC 988499515dafcb99c54b02729ac9bf5fdb0dfa77
3 files changed +10 -12
hw/display/acpi-vga-stub.c
+1
@@ -1,4 +1,5 @@
1 #include "qemu/osdep.h"
2 +#undef CONFIG_PIXMAN
3 #include "hw/acpi/acpi_aml_interface.h"
4 #include "vga_int.h"
5
hw/display/meson.build
+8 -11
@@ -3,7 +3,8 @@ hw_display_modules = {}
3 system_ss.add(when: 'CONFIG_DDC', if_true: files('i2c-ddc.c'))
4 system_ss.add(when: 'CONFIG_EDID', if_true: files('edid-generate.c', 'edid-region.c'))
5
6 -system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb.c'), if_false: files('ramfb-stubs.c'))
6 +system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb.c'))
7 +stub_ss.add(files('ramfb-stubs.c'))
8 system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb-standalone.c'))
9
10 system_ss.add(when: 'CONFIG_VGA_CIRRUS', if_true: files('cirrus_vga.c'))
@@ -36,21 +37,20 @@ system_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c'))
37 system_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-dmabuf.c'))
38 system_ss.add(when: 'CONFIG_DM163', if_true: files('dm163.c'))
39
40 +stub_ss.add([files('acpi-vga-stub.c'), pixman])
41 if (config_all_devices.has_key('CONFIG_VGA_CIRRUS') or
42 config_all_devices.has_key('CONFIG_VGA_PCI') or
43 config_all_devices.has_key('CONFIG_VMWARE_VGA') or
44 config_all_devices.has_key('CONFIG_ATI_VGA')
45 )
44 - system_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
45 - if_false: files('acpi-vga-stub.c'))
46 + system_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'))
47 endif
48
49 if config_all_devices.has_key('CONFIG_QXL')
50 qxl_ss = ss.source_set()
51 qxl_ss.add(when: 'CONFIG_QXL', if_true: [files('qxl.c', 'qxl-logger.c', 'qxl-render.c'),
52 pixman, spice])
52 - qxl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
53 - if_false: files('acpi-vga-stub.c'))
53 + qxl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'))
54 hw_display_modules += {'qxl': qxl_ss}
55 endif
56
@@ -119,16 +119,14 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
119 if_true: [files('virtio-vga.c'), pixman])
120 virtio_vga_ss.add(when: 'CONFIG_VHOST_USER_VGA',
121 if_true: files('vhost-user-vga.c'))
122 - virtio_vga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
123 - if_false: files('acpi-vga-stub.c'))
122 + virtio_vga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'))
123 hw_display_modules += {'virtio-vga': virtio_vga_ss}
124
125 if virgl.found() and opengl.found()
126 virtio_vga_gl_ss = ss.source_set()
127 virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
128 if_true: [files('virtio-vga-gl.c'), pixman])
130 - virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
131 - if_false: files('acpi-vga-stub.c'))
129 + virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'))
130 hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
131 endif
132
@@ -136,8 +134,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
134 virtio_vga_rutabaga_ss = ss.source_set()
135 virtio_vga_rutabaga_ss.add(when: ['CONFIG_VIRTIO_VGA', rutabaga],
136 if_true: [files('virtio-vga-rutabaga.c'), pixman])
139 - virtio_vga_rutabaga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
140 - if_false: files('acpi-vga-stub.c'))
137 + virtio_vga_rutabaga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'))
138 hw_display_modules += {'virtio-vga-rutabaga': virtio_vga_rutabaga_ss}
139 endif
140 endif
meson.build
+1 -1
@@ -3781,7 +3781,7 @@ util_ss = util_ss.apply({})
3781 libqemuutil = static_library('qemuutil',
3782 build_by_default: false,
3783 sources: util_ss.sources() + stub_ss.sources() + genh,
3784 - dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt])
3784 + dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt, pixman, opengl])
3785 qemuutil = declare_dependency(link_with: libqemuutil,
3786 sources: genh + version_res,
3787 dependencies: [event_loop_base])