Commit d52c454a authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Gerd Hoffmann
Browse files

contrib: add vhost-user-gpu



Add a vhost-user gpu backend, based on virtio-gpu/3d device. It is
associated with a vhost-user-gpu device.

Various TODO and nice to have items:
- multi-head support
- crash & resume handling
- accelerated rendering/display that avoids the waiting round trips
- edid support

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190524130946.31736-6-marcandre.lureau@redhat.com
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent b213fee8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1681,6 +1681,8 @@ M: Marc-André Lureau <marcandre.lureau@redhat.com>
M: Gerd Hoffmann <kraxel@redhat.com>
S: Maintained
F: docs/interop/vhost-user-gpu.rst
F: contrib/vhost-user-gpu
F: hw/display/vhost-user-*

Cirrus VGA
M: Gerd Hoffmann <kraxel@redhat.com>
+23 −1
Original line number Diff line number Diff line
@@ -314,8 +314,20 @@ $(call set-vpath, $(SRC_PATH))

LIBS+=-lz $(LIBS_TOOLS)

vhost-user-json-y =
HELPERS-y =

HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)

ifdef CONFIG_LINUX
ifdef CONFIG_VIRGL
ifdef CONFIG_GBM
HELPERS-y += vhost-user-gpu$(EXESUF)
vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
endif
endif
endif

ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
@@ -409,6 +421,7 @@ dummy := $(call unnest-vars,, \
                vhost-user-scsi-obj-y \
                vhost-user-blk-obj-y \
                vhost-user-input-obj-y \
                vhost-user-gpu-obj-y \
                qga-vss-dll-obj-y \
                block-obj-y \
                block-obj-m \
@@ -426,7 +439,7 @@ dummy := $(call unnest-vars,, \

include $(SRC_PATH)/tests/Makefile.include

all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules
all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules $(vhost-user-json-y)

qemu-version.h: FORCE
	$(call quiet-command, \
@@ -619,6 +632,9 @@ rdmacm-mux$(EXESUF): LIBS += "-libumad"
rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
	$(call LINK, $^)

vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
	$(call LINK, $^)

ifdef CONFIG_VHOST_USER_INPUT
ifdef CONFIG_LINUX
vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqemuutil.a
@@ -827,6 +843,12 @@ endif
ifneq ($(HELPERS-y),)
	$(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
endif
ifneq ($(vhost-user-json-y),)
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/vhost-user/"
	for x in $(vhost-user-json-y); do \
		$(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)/vhost-user/"; \
	done
endif
ifdef CONFIG_TRACE_SYSTEMTAP
	$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
endif
+1 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ vhost-user-scsi-obj-y = contrib/vhost-user-scsi/
vhost-user-blk-obj-y = contrib/vhost-user-blk/
rdmacm-mux-obj-y = contrib/rdmacm-mux/
vhost-user-input-obj-y = contrib/vhost-user-input/
vhost-user-gpu-obj-y = contrib/vhost-user-gpu/

######################################################################
trace-events-subdirs =
+17 −0
Original line number Diff line number Diff line
@@ -4099,6 +4099,13 @@ libs_softmmu="$libs_softmmu $fdt_libs"
##########################################
# opengl probe (for sdl2, gtk, milkymist-tmu2)

gbm="no"
if $pkg_config gbm; then
    gbm_cflags="$($pkg_config --cflags gbm)"
    gbm_libs="$($pkg_config --libs gbm)"
    gbm="yes"
fi

if test "$opengl" != "no" ; then
  opengl_pkgs="epoxy gbm"
  if $pkg_config $opengl_pkgs; then
@@ -6964,6 +6971,13 @@ if test "$opengl" = "yes" ; then
  fi
fi

if test "$gbm" = "yes" ; then
    echo "CONFIG_GBM=y" >> $config_host_mak
    echo "GBM_LIBS=$gbm_libs" >> $config_host_mak
    echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak
fi


if test "$malloc_trim" = "yes" ; then
  echo "CONFIG_MALLOC_TRIM=y" >> $config_host_mak
fi
@@ -7859,6 +7873,9 @@ echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak

done # for target in $targets

echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak
echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak

if test -n "$enabled_cross_compilers"; then
    echo
    echo "NOTE: cross-compilers enabled: $enabled_cross_compilers"
+5 −0
Original line number Diff line number Diff line
{
  "description": "QEMU vhost-user-gpu",
  "type": "gpu",
  "binary": "@libexecdir@/vhost-user-gpu",
}
Loading