[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/2] libxl_dm: honor opengl flag for SDL



From: Chris Patterson <pattersonc@xxxxxxxxxxxx>

It was honored in libxl__build_device_model_args_old(), but did not
transition to libxl__build_device_model_args_new().

The opengl flag is useful for SDL to toggle virgl when using virtio-vga.

To accomplish this, we also switch from the short-hand "-sdl" notation to
"-display sdl", which should be fine compatibility-wise as "-display sdl"
is used as far back as qemu 0.15 [1].

"-display sdl,gl=on" is supported as far back as qemu 2.7 [2].

[1] https://github.com/qemu/qemu/blob/stable-0.15/qemu-options.hx#L617
[2] https://github.com/qemu/qemu/blob/stable-2.7/qemu-options.hx#L929

Signed-off-by: Chris Patterson <pattersonc@xxxxxxxxxxxx>
---
 docs/man/xl.cfg.5.pod.in | 3 +--
 tools/libxl/libxl_dm.c   | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 0d4fd49..a2d3988 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2297,8 +2297,7 @@ Simple DirectMedia Layer). The default is (0) not enabled.
 
 =item B<opengl=BOOLEAN>
 
-Enable OpenGL acceleration of the SDL display. Only effects machines
-using B<device_model_version="qemu-xen-traditional"> and only if the
+Enable OpenGL acceleration of the SDL display.  Only works if the
 device-model was compiled with OpenGL support. Default is (0) false.
 
 =item B<nographic=BOOLEAN>
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 2aaa359..5928214 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1307,7 +1307,10 @@ static int libxl__build_device_model_args_new(libxl__gc 
*gc,
     flexarray_append_pair(dm_args, "-display", "none");
 
     if (sdl) {
-        flexarray_append(dm_args, "-sdl");
+        flexarray_append_pair(dm_args, "-display", GCSPRINTF("sdl%s",
+                              libxl_defbool_val(sdl->opengl) ?
+                              ",gl=on" : ""));
+
         if (sdl->display)
             flexarray_append_pair(dm_envs, "DISPLAY", sdl->display);
         if (sdl->xauthority)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.