From: Elie Tournier <tournier.elie@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, kraxel@redhat.com,
Elie Tournier <tournier.elie@gmail.com>,
Elie Tournier <elie.tournier@collabora.com>
Subject: [Qemu-devel] [RFC 1/2] sdl2: Add gles options
Date: Wed, 17 Jan 2018 14:50:28 +0000 [thread overview]
Message-ID: <20180117145029.28736-2-tournier.elie@gmail.com> (raw)
In-Reply-To: <20180117145029.28736-1-tournier.elie@gmail.com>
This commit add an option to the sdl display: `-display sdl,gles=on`
This will allow the user to create an OpenGL ES context.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
---
qemu-options.hx | 5 ++++-
ui/sdl2.c | 1 +
vl.c | 11 ++++++++++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 678181c599..18a616e339 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1257,7 +1257,7 @@ ETEXI
DEF("display", HAS_ARG, QEMU_OPTION_display,
"-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
- " [,window_close=on|off][,gl=on|off]\n"
+ " [,window_close=on|off][,gl=on|off][,gles=on|off]\n"
"-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
"-display vnc=<display>[,<optargs>]\n"
"-display curses\n"
@@ -1492,6 +1492,9 @@ Enable/disable spice seamless migration. Default is off.
@item gl=[on|off]
Enable/disable OpenGL context. Default is off.
+@item gles=[on|off]
+Enable/disable OpenGL ES context. Default is off.
+
@item rendernode=<file>
DRM render node for OpenGL rendering. If not specified, it will pick
the first available. (Since 2.9)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 89c6a2633c..e78cff1a6f 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -762,6 +762,7 @@ void sdl_display_early_init(int opengl)
case 0: /* off */
break;
case 1: /* on */
+ case 2: /* gles = on */
#ifdef CONFIG_OPENGL
display_opengl = 1;
#endif
diff --git a/vl.c b/vl.c
index 2586f25952..3fe325222e 100644
--- a/vl.c
+++ b/vl.c
@@ -2154,6 +2154,15 @@ static DisplayType select_display(const char *p)
} else {
goto invalid_sdl_args;
}
+ } else if (strstart(opts, ",gles=", &nextopt)) {
+ opts = nextopt;
+ if (strstart(opts, "on", &nextopt)) {
+ request_opengl = 2;
+ } else if (strstart(opts, "off", &nextopt)) {
+ request_opengl = 0;
+ } else {
+ goto invalid_sdl_args;
+ }
} else if (strstart(opts, ",gl=", &nextopt)) {
opts = nextopt;
if (strstart(opts, "on", &nextopt)) {
@@ -4364,7 +4373,7 @@ int main(int argc, char **argv, char **envp)
qemu_console_early_init();
- if (request_opengl == 1 && display_opengl == 0) {
+ if ((request_opengl == 1 || request_opengl == 2) && display_opengl == 0) {
#if defined(CONFIG_OPENGL)
error_report("OpenGL is not supported by the display");
#else
--
2.15.1
next prev parent reply other threads:[~2018-01-17 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 14:50 [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer Elie Tournier
2018-01-17 14:50 ` Elie Tournier [this message]
2018-01-17 14:50 ` [Qemu-devel] [RFC 2/2] sdl2: gles option will create a gles context Elie Tournier
2018-01-17 15:04 ` [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer no-reply
2018-01-29 16:11 ` Elie Tournier
2018-01-29 18:08 ` Gerd Hoffmann
2018-01-30 14:43 ` Elie Tournier
2018-01-30 15:22 ` Gerd Hoffmann
2018-01-30 17:08 ` Elie Tournier
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=20180117145029.28736-2-tournier.elie@gmail.com \
--to=tournier.elie@gmail.com \
--cc=elie.tournier@collabora.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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).