Skip to content

Commit

Permalink
virtio-gpu: add 3d mode and virgl rendering support.
Browse files Browse the repository at this point in the history
Add virglrenderer library detection.  Add 3d mode to virtio-gpu,
wire up virglrenderer library.  When in 3d mode render using the
new context management and texture scanout callbacks.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
  • Loading branch information
kraxel committed Oct 8, 2015
1 parent bc79e96 commit 9d9e152
Show file tree
Hide file tree
Showing 6 changed files with 792 additions and 11 deletions.
32 changes: 32 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ gtkabi=""
gnutls=""
gnutls_hash=""
vte=""
virglrenderer=""
tpm="yes"
libssh2=""
vhdx=""
Expand Down Expand Up @@ -1122,6 +1123,10 @@ for opt do
;;
--enable-vte) vte="yes"
;;
--disable-virglrenderer) virglrenderer="no"
;;
--enable-virglrenderer) virglrenderer="yes"
;;
--disable-tpm) tpm="no"
;;
--enable-tpm) tpm="yes"
Expand Down Expand Up @@ -3966,6 +3971,27 @@ EOF
fi
fi

##########################################
# virgl renderer probe

if test "$virglrenderer" != "no" ; then
cat > $TMPC << EOF
#include <virglrenderer.h>
int main(void) { virgl_renderer_poll(); return 0; }
EOF
virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null)
virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null)
if $pkg_config virglrenderer >/dev/null 2>&1 && \
compile_prog "$virgl_cflags" "$virgl_libs" ; then
virglrenderer="yes"
else
if test "$virglrenderer" = "yes" ; then
feature_not_found "virglrenderer"
fi
virglrenderer="no"
fi
fi

##########################################
# check if we have fdatasync

Expand Down Expand Up @@ -4583,6 +4609,7 @@ echo "GNUTLS nettle $gnutls_nettle ${gnutls_nettle+($nettle_version)}"
echo "libtasn1 $tasn1"
echo "VTE support $vte"
echo "curses support $curses"
echo "virgl support $virglrenderer"
echo "curl support $curl"
echo "mingw32 support $mingw32"
echo "Audio drivers $audio_drv_list"
Expand Down Expand Up @@ -4955,6 +4982,11 @@ if test "$vte" = "yes" ; then
echo "CONFIG_VTE=y" >> $config_host_mak
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
fi
if test "$virglrenderer" = "yes" ; then
echo "CONFIG_VIRGL=y" >> $config_host_mak
echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak
echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak
fi
if test "$xen" = "yes" ; then
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
Expand Down
6 changes: 5 additions & 1 deletion hw/display/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ obj-$(CONFIG_VGA) += vga.o

common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o

obj-$(CONFIG_VIRTIO) += virtio-gpu.o
obj-$(CONFIG_VIRTIO) += virtio-gpu.o virtio-gpu-3d.o
obj-$(CONFIG_VIRTIO_PCI) += virtio-gpu-pci.o
obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
virtio-gpu.o-libs += $(VIRGL_LIBS)
virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
Loading

0 comments on commit 9d9e152

Please sign in to comment.