From: Gurchetan Singh <gurchetansingh@chromium.org>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, philmd@linaro.org, david@redhat.com,
stefanha@redhat.com, kraxel@redhat.com,
marcandre.lureau@redhat.com, akihiko.odaki@gmail.com,
dmitry.osipenko@collabora.com, ray.huang@amd.com,
alex.bennee@linaro.org
Subject: [RFC PATCH 09/13] gfxstream + rutabaga: add required meson changes
Date: Thu, 20 Apr 2023 18:12:19 -0700 [thread overview]
Message-ID: <20230421011223.718-10-gurchetansingh@chromium.org> (raw)
In-Reply-To: <20230421011223.718-1-gurchetansingh@chromium.org>
- Add meson detection of rutabaga_gfx
- Compile stubs when rutabaga_gfx_ffi is not installed
- Compile stubs when virglrenderer is not installed
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
hw/display/meson.build | 40 ++++++++++++++++++++------
hw/display/virtio-gpu-rutabaga-stubs.c | 8 ++++++
hw/display/virtio-gpu-virgl-stubs.c | 8 ++++++
include/hw/virtio/virtio-gpu.h | 5 +++-
meson.build | 8 ++++++
meson_options.txt | 2 ++
scripts/meson-buildoptions.sh | 3 ++
7 files changed, 64 insertions(+), 10 deletions(-)
create mode 100644 hw/display/virtio-gpu-rutabaga-stubs.c
create mode 100644 hw/display/virtio-gpu-virgl-stubs.c
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 4191694380..48785cfcb6 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -63,6 +63,8 @@ softmmu_ss.add(when: 'CONFIG_ARTIST', if_true: files('artist.c'))
softmmu_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_true: files('ati.c', 'ati_2d.c', 'ati_dbg.c'))
+virgl_found = virgl.found() and opengl.found()
+rutabaga_found = rutabaga.found()
if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
virtio_gpu_ss = ss.source_set()
@@ -73,12 +75,27 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c'))
hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
- if virgl.found() and opengl.found()
- virtio_gpu_gl_ss = ss.source_set()
- virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl],
- if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c'), pixman, virgl])
- hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss}
+ virtio_gpu_gl_ss = ss.source_set()
+ if virgl_found or rutabaga_found
+ virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU'],
+ if_true: [files('virtio-gpu-gl.c'), pixman])
endif
+
+ if virgl_found
+ virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU'],
+ if_true: [files('virtio-gpu-virgl.c'), virgl])
+ else
+ virtio_gpu_gl_ss.add([files('virtio-gpu-virgl-stubs.c')])
+ endif
+
+ if rutabaga_found
+ virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU'],
+ if_true: [files('virtio-gpu-rutabaga.c'), rutabaga])
+ else
+ virtio_gpu_gl_ss.add([files('virtio-gpu-rutabaga-stubs.c')])
+ endif
+
+ hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss}
endif
if config_all_devices.has_key('CONFIG_VIRTIO_PCI')
@@ -89,9 +106,10 @@ if config_all_devices.has_key('CONFIG_VIRTIO_PCI')
if_true: files('vhost-user-gpu-pci.c'))
hw_display_modules += {'virtio-gpu-pci': virtio_gpu_pci_ss}
- if virgl.found() and opengl.found()
+
+ if virgl_found or rutabaga_found
virtio_gpu_pci_gl_ss = ss.source_set()
- virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', virgl, opengl],
+ virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI'],
if_true: [files('virtio-gpu-pci-gl.c'), pixman])
hw_display_modules += {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss}
endif
@@ -108,8 +126,12 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
hw_display_modules += {'virtio-vga': virtio_vga_ss}
virtio_vga_gl_ss = ss.source_set()
- virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
- if_true: [files('virtio-vga-gl.c'), pixman])
+
+ if virgl_found or rutabaga_found
+ virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA'],
+ if_true: [files('virtio-vga-gl.c'), pixman])
+ endif
+
virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
if_false: files('acpi-vga-stub.c'))
hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
diff --git a/hw/display/virtio-gpu-rutabaga-stubs.c b/hw/display/virtio-gpu-rutabaga-stubs.c
new file mode 100644
index 0000000000..26c38d3892
--- /dev/null
+++ b/hw/display/virtio-gpu-rutabaga-stubs.c
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qemu/osdep.h"
+#include "hw/virtio/virtio-gpu.h"
+
+void virtio_gpu_rutabaga_device_realize(DeviceState *qdev, Error **errp)
+{
+ /* nothing (stub) */
+}
diff --git a/hw/display/virtio-gpu-virgl-stubs.c b/hw/display/virtio-gpu-virgl-stubs.c
new file mode 100644
index 0000000000..b29e35f990
--- /dev/null
+++ b/hw/display/virtio-gpu-virgl-stubs.c
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qemu/osdep.h"
+#include "hw/virtio/virtio-gpu.h"
+
+void virtio_gpu_virgl_device_realize(DeviceState *qdev, Error **errp)
+{
+ /* nothing (stub) */
+}
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index a35ade3608..034c71e8f5 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -300,7 +300,10 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,
struct virtio_gpu_framebuffer *fb,
struct virtio_gpu_rect *r);
-/* virtio-gpu-3d.c */
+/* virtio-gpu-virgl.c or virtio-gpu-virgl-stubs.c */
void virtio_gpu_virgl_device_realize(DeviceState *qdev, Error **errp);
+/* virtio-gpu-rutabaga.c or virtio-gpu-rutabaga-stubs.c */
+void virtio_gpu_rutabaga_device_realize(DeviceState *qdev, Error **errp);
+
#endif
diff --git a/meson.build b/meson.build
index c44d05a13f..ba1c1905fb 100644
--- a/meson.build
+++ b/meson.build
@@ -777,6 +777,13 @@ if not get_option('virglrenderer').auto() or have_system or have_vhost_user_gpu
required: get_option('virglrenderer'),
kwargs: static_kwargs)
endif
+rutabaga = not_found
+if not get_option('rutabaga_gfx').auto() or have_system or have_vhost_user_gpu
+ rutabaga = dependency('rutabaga_gfx_ffi',
+ method: 'pkg-config',
+ required: get_option('rutabaga_gfx'),
+ kwargs: static_kwargs)
+endif
blkio = not_found
if not get_option('blkio').auto() or have_block
blkio = dependency('blkio',
@@ -3963,6 +3970,7 @@ summary_info += {'PAM': pam}
summary_info += {'iconv support': iconv}
summary_info += {'curses support': curses}
summary_info += {'virgl support': virgl}
+summary_info += {'rutabaga support': rutabaga}
summary_info += {'blkio support': blkio}
summary_info += {'curl support': curl}
summary_info += {'Multipath support': mpathpersist}
diff --git a/meson_options.txt b/meson_options.txt
index fc9447d267..3b4249c2fe 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -213,6 +213,8 @@ option('vmnet', type : 'feature', value : 'auto',
description: 'vmnet.framework network backend support')
option('virglrenderer', type : 'feature', value : 'auto',
description: 'virgl rendering support')
+option('rutabaga_gfx', type : 'feature', value : 'auto',
+ description: 'rutabaga_gfx support')
option('png', type : 'feature', value : 'auto',
description: 'PNG support with libpng')
option('vnc', type : 'feature', value : 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 009fab1515..ce35c44926 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -144,6 +144,7 @@ meson_options_help() {
printf "%s\n" ' rbd Ceph block device driver'
printf "%s\n" ' rdma Enable RDMA-based migration'
printf "%s\n" ' replication replication support'
+ printf "%s\n" ' rutabaga-gfx rutabaga_gfx support'
printf "%s\n" ' sdl SDL user interface'
printf "%s\n" ' sdl-image SDL Image support for icons'
printf "%s\n" ' seccomp seccomp support'
@@ -394,6 +395,8 @@ _meson_option_parse() {
--disable-replication) printf "%s" -Dreplication=disabled ;;
--enable-rng-none) printf "%s" -Drng_none=true ;;
--disable-rng-none) printf "%s" -Drng_none=false ;;
+ --enable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=enabled ;;
+ --disable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=disabled ;;
--enable-sdl) printf "%s" -Dsdl=enabled ;;
--disable-sdl) printf "%s" -Dsdl=disabled ;;
--enable-sdl-image) printf "%s" -Dsdl_image=enabled ;;
--
2.40.0.634.g4ca3ef3211-goog
next prev parent reply other threads:[~2023-04-21 1:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 1:12 [RFC PATCH 00/13] gfxstream + rutabaga_gfx: a surprising delight or startling epiphany? Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 01/13] virtio: Add shared memory capability Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 02/13] virtio-gpu: hostmem Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 03/13] virtio-gpu blob prep: improve decoding and add memory region Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 04/13] virtio-gpu: CONTEXT_INIT feature Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 05/13] gfxstream + rutabaga prep: virtio_gpu_gl -> virtio_gpu_virgl Gurchetan Singh
2023-04-21 9:40 ` Philippe Mathieu-Daudé
2023-04-21 1:12 ` [RFC PATCH 06/13] gfxstream + rutabaga prep: make GL device more library agnostic Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 07/13] gfxstream + rutabaga prep: define callbacks in realize function Gurchetan Singh
2023-04-21 9:53 ` Philippe Mathieu-Daudé
2023-04-21 1:12 ` [RFC PATCH 08/13] gfxstream + rutabaga prep: added need defintions, fields, and options Gurchetan Singh
2023-04-22 14:54 ` Akihiko Odaki
2023-04-21 1:12 ` Gurchetan Singh [this message]
2023-04-21 1:12 ` [RFC PATCH 10/13] gfxstream + rutabaga: add initial support for gfxstream Gurchetan Singh
2023-04-22 15:37 ` Akihiko Odaki
2023-04-21 1:12 ` [RFC PATCH 11/13] gfxstream + rutabaga: enable rutabaga Gurchetan Singh
2023-04-21 1:12 ` [RFC PATCH 12/13] HACK: use memory region API to inject memory to guest Gurchetan Singh
2023-04-22 15:46 ` Akihiko Odaki
2023-04-25 0:08 ` Gurchetan Singh
2023-04-22 19:22 ` Peter Maydell
2023-04-21 1:12 ` [RFC PATCH 13/13] HACK: schedule fence return on main AIO context Gurchetan Singh
2023-04-21 15:59 ` Stefan Hajnoczi
2023-04-21 23:20 ` Gurchetan Singh
2023-04-25 12:04 ` Stefan Hajnoczi
2023-04-21 16:02 ` [RFC PATCH 00/13] gfxstream + rutabaga_gfx: a surprising delight or startling epiphany? Stefan Hajnoczi
2023-04-21 23:54 ` Gurchetan Singh
2023-04-22 16:41 ` Akihiko Odaki
2023-04-25 0:16 ` Gurchetan Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230421011223.718-10-gurchetansingh@chromium.org \
--to=gurchetansingh@chromium.org \
--cc=akihiko.odaki@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=david@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=ray.huang@amd.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).