* [Qemu-devel] [PULL 0/2] ui patch queue @ 2017-02-20 13:24 Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 1/2] spice: allow to specify drm rendernode Gerd Hoffmann ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Gerd Hoffmann @ 2017-02-20 13:24 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann Hi, Two little patches for opengl support. please pull, Gerd The following changes since commit ad584d37f2a86b392c25f3f00cc1f1532676c2d1: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-02-16 17:46:52 +0000) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-ui-20170220-1 for you to fetch changes up to 0ea1523fb6703aa0dcd65e66b59e96fec028e60a: egl-helpers: Support newer MESA versions (2017-02-20 12:46:09 +0100) ---------------------------------------------------------------- ui: opengl fixes, for spice and egl-helpers. ---------------------------------------------------------------- Frediano Ziglio (1): egl-helpers: Support newer MESA versions Marc-André Lureau (1): spice: allow to specify drm rendernode include/ui/egl-helpers.h | 3 +-- qemu-options.hx | 6 +++++- ui/egl-helpers.c | 14 +++++++++++--- ui/spice-core.c | 5 ++++- 4 files changed, 21 insertions(+), 7 deletions(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 1/2] spice: allow to specify drm rendernode 2017-02-20 13:24 [Qemu-devel] [PULL 0/2] ui patch queue Gerd Hoffmann @ 2017-02-20 13:24 ` Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 2/2] egl-helpers: Support newer MESA versions Gerd Hoffmann 2017-02-20 17:42 ` [Qemu-devel] [PULL 0/2] ui patch queue Peter Maydell 2 siblings, 0 replies; 6+ messages in thread From: Gerd Hoffmann @ 2017-02-20 13:24 UTC (permalink / raw) To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann From: Marc-André Lureau <marcandre.lureau@redhat.com> When multiple GPU are available, picking the first one isn't always the best choice. Learn to specify a device rendernode. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170212112118.16044-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- include/ui/egl-helpers.h | 3 +-- qemu-options.hx | 6 +++++- ui/egl-helpers.c | 10 +++++++--- ui/spice-core.c | 5 ++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index 03fcf4b..88a13e8 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -14,8 +14,7 @@ extern int qemu_egl_rn_fd; extern struct gbm_device *qemu_egl_rn_gbm_dev; extern EGLContext qemu_egl_rn_ctx; -int qemu_egl_rendernode_open(void); -int egl_rendernode_init(void); +int egl_rendernode_init(const char *rendernode); int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc); #endif diff --git a/qemu-options.hx b/qemu-options.hx index 5633d39..809b2b0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1066,7 +1066,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n" " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n" " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" - " [,gl=[on|off]]\n" + " [,gl=[on|off]][,rendernode=<file>]\n" " enable spice\n" " at least one of {port, tls-port} is mandatory\n", QEMU_ARCH_ALL) @@ -1161,6 +1161,10 @@ Enable/disable spice seamless migration. Default is off. @item gl=[on|off] Enable/disable OpenGL 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) + @end table ETEXI diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index cd24568..417462b 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -44,13 +44,17 @@ int qemu_egl_rn_fd; struct gbm_device *qemu_egl_rn_gbm_dev; EGLContext qemu_egl_rn_ctx; -int qemu_egl_rendernode_open(void) +static int qemu_egl_rendernode_open(const char *rendernode) { DIR *dir; struct dirent *e; int r, fd; char *p; + if (rendernode) { + return open(rendernode, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK); + } + dir = opendir("/dev/dri"); if (!dir) { return -1; @@ -85,11 +89,11 @@ int qemu_egl_rendernode_open(void) return fd; } -int egl_rendernode_init(void) +int egl_rendernode_init(const char *rendernode) { qemu_egl_rn_fd = -1; - qemu_egl_rn_fd = qemu_egl_rendernode_open(); + qemu_egl_rn_fd = qemu_egl_rendernode_open(rendernode); if (qemu_egl_rn_fd == -1) { error_report("egl: no drm render node available"); goto err; diff --git a/ui/spice-core.c b/ui/spice-core.c index 1452e77..39ccab7 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -501,6 +501,9 @@ static QemuOptsList qemu_spice_opts = { },{ .name = "gl", .type = QEMU_OPT_BOOL, + },{ + .name = "rendernode", + .type = QEMU_OPT_STRING, #endif }, { /* end of list */ } @@ -833,7 +836,7 @@ void qemu_spice_init(void) "incompatible with -spice port/tls-port"); exit(1); } - if (egl_rendernode_init() != 0) { + if (egl_rendernode_init(qemu_opt_get(opts, "rendernode")) != 0) { error_report("Failed to initialize EGL render node for SPICE GL"); exit(1); } -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/2] egl-helpers: Support newer MESA versions 2017-02-20 13:24 [Qemu-devel] [PULL 0/2] ui patch queue Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 1/2] spice: allow to specify drm rendernode Gerd Hoffmann @ 2017-02-20 13:24 ` Gerd Hoffmann 2017-02-20 17:42 ` [Qemu-devel] [PULL 0/2] ui patch queue Peter Maydell 2 siblings, 0 replies; 6+ messages in thread From: Gerd Hoffmann @ 2017-02-20 13:24 UTC (permalink / raw) To: qemu-devel; +Cc: Frediano Ziglio, Gerd Hoffmann From: Frediano Ziglio <fziglio@redhat.com> According to https://www.khronos.org/registry/EGL/extensions/MESA/EGL_MESA_platform_gbm.txt if MESA_platform_gbm is supported display should be initialized from a GBM handle using eglGetPlatformDisplayEXT. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Message-id: 20170220095055.4234-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- ui/egl-helpers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 417462b..584dd1b 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -223,7 +223,11 @@ int qemu_egl_init_dpy(EGLNativeDisplayType dpy, bool gles, bool debug) } egl_dbg("eglGetDisplay (dpy %p) ...\n", dpy); +#ifdef EGL_MESA_platform_gbm + qemu_egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, dpy, NULL); +#else qemu_egl_display = eglGetDisplay(dpy); +#endif if (qemu_egl_display == EGL_NO_DISPLAY) { error_report("egl: eglGetDisplay failed"); return -1; -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] ui patch queue 2017-02-20 13:24 [Qemu-devel] [PULL 0/2] ui patch queue Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 1/2] spice: allow to specify drm rendernode Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 2/2] egl-helpers: Support newer MESA versions Gerd Hoffmann @ 2017-02-20 17:42 ` Peter Maydell 2 siblings, 0 replies; 6+ messages in thread From: Peter Maydell @ 2017-02-20 17:42 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: QEMU Developers On 20 February 2017 at 13:24, Gerd Hoffmann <kraxel@redhat.com> wrote: > Hi, > > Two little patches for opengl support. > > please pull, > Gerd > > The following changes since commit ad584d37f2a86b392c25f3f00cc1f1532676c2d1: > > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-02-16 17:46:52 +0000) > > are available in the git repository at: > > > git://git.kraxel.org/qemu tags/pull-ui-20170220-1 > > for you to fetch changes up to 0ea1523fb6703aa0dcd65e66b59e96fec028e60a: > > egl-helpers: Support newer MESA versions (2017-02-20 12:46:09 +0100) > > ---------------------------------------------------------------- > ui: opengl fixes, for spice and egl-helpers. > Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 0/2] ui patch queue @ 2016-01-08 12:47 Gerd Hoffmann 2016-01-08 13:18 ` Peter Maydell 0 siblings, 1 reply; 6+ messages in thread From: Gerd Hoffmann @ 2016-01-08 12:47 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann Hi, Flushing the ui patch queue with two older patches. The curses patch arrived during the 2.5 freeze. The sdl2 virgl patch is even older and was held back due to testing problems. Those went magically away meanwhile, so it most likely was either a bug somewhere else or some issue with the test setup. So going forward merging it now. please pull, Gerd The following changes since commit a7e00e2536941a6e570b45b7ab4afec4505ff67e: petalogix-ml605: Set the MicroBlaze CPU version to 8.10.a (2016-01-07 14:57:26 +0100) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-ui-20160108-1 for you to fetch changes up to cb47dc9ab9f55083017291b2b8fbae639c576ec2: sdl2/opengl: add opengl context and scanout support (2016-01-08 12:20:15 +0100) ---------------------------------------------------------------- sdl2/opengl: add opengl context and scanout support ui/curses: Fix color attribute of monitor for curses ---------------------------------------------------------------- Gerd Hoffmann (1): sdl2/opengl: add opengl context and scanout support OGAWA Hirofumi (1): ui/curses: Fix color attribute of monitor for curses hw/display/jazz_led.c | 6 ++- hw/display/vga.c | 3 +- include/ui/console.h | 15 ++++++ include/ui/sdl2.h | 22 +++++++- ui/console.c | 101 +++++++++++++++++-------------------- ui/curses.c | 13 +++-- ui/sdl2-gl.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++ ui/sdl2.c | 7 +++ 8 files changed, 239 insertions(+), 63 deletions(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] ui patch queue 2016-01-08 12:47 Gerd Hoffmann @ 2016-01-08 13:18 ` Peter Maydell 0 siblings, 0 replies; 6+ messages in thread From: Peter Maydell @ 2016-01-08 13:18 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: QEMU Developers On 8 January 2016 at 12:47, Gerd Hoffmann <kraxel@redhat.com> wrote: > Hi, > > Flushing the ui patch queue with two older patches. The curses patch > arrived during the 2.5 freeze. The sdl2 virgl patch is even older and > was held back due to testing problems. Those went magically away > meanwhile, so it most likely was either a bug somewhere else or > some issue with the test setup. So going forward merging it now. > > please pull, > Gerd > > The following changes since commit a7e00e2536941a6e570b45b7ab4afec4505ff67e: > > petalogix-ml605: Set the MicroBlaze CPU version to 8.10.a (2016-01-07 14:57:26 +0100) > > are available in the git repository at: > > git://git.kraxel.org/qemu tags/pull-ui-20160108-1 > > for you to fetch changes up to cb47dc9ab9f55083017291b2b8fbae639c576ec2: > > sdl2/opengl: add opengl context and scanout support (2016-01-08 12:20:15 +0100) > > ---------------------------------------------------------------- > sdl2/opengl: add opengl context and scanout support > ui/curses: Fix color attribute of monitor for curses > > ---------------------------------------------------------------- Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-20 17:42 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-02-20 13:24 [Qemu-devel] [PULL 0/2] ui patch queue Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 1/2] spice: allow to specify drm rendernode Gerd Hoffmann 2017-02-20 13:24 ` [Qemu-devel] [PULL 2/2] egl-helpers: Support newer MESA versions Gerd Hoffmann 2017-02-20 17:42 ` [Qemu-devel] [PULL 0/2] ui patch queue Peter Maydell -- strict thread matches above, loose matches on Subject: below -- 2016-01-08 12:47 Gerd Hoffmann 2016-01-08 13:18 ` Peter Maydell
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).