xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chris Patterson <cjp256@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
	Chris Patterson <pattersonc@ainfosec.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 2/2] libxl_dm: honor opengl flag for SDL
Date: Thu,  4 Apr 2019 15:36:51 -0400	[thread overview]
Message-ID: <1554406611-11262-2-git-send-email-cjp256@gmail.com> (raw)
In-Reply-To: <1554406611-11262-1-git-send-email-cjp256@gmail.com>

From: Chris Patterson <pattersonc@ainfosec.com>

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@ainfosec.com>
---
 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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-04-04 19:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 19:36 [PATCH 1/2] libxl: Add virtio vga interface support for qemu Chris Patterson
2019-04-04 19:36 ` Chris Patterson [this message]
2019-04-11  0:02 ` Chris Patterson
2019-04-11  0:02   ` [Xen-devel] " Chris Patterson
2019-04-17 17:55   ` Rich Persaud
2019-04-17 17:55     ` [Xen-devel] " Rich Persaud

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=1554406611-11262-2-git-send-email-cjp256@gmail.com \
    --to=cjp256@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=pattersonc@ainfosec.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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).