aboutsummaryrefslogtreecommitdiff
path: root/ui/egl-headless.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-11-29 13:35:02 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-01-10 08:55:10 +0100
commit952e5d584f5aabe41298c278065fe628f3f7aa7a (patch)
tree1f116d9922750c9c15ba8072bc0df967a6906381 /ui/egl-headless.c
parente59dbbac0364344a3ad84c3497a98c56003d3fb8 (diff)
downloadqemu-952e5d584f5aabe41298c278065fe628f3f7aa7a.zip
qemu-952e5d584f5aabe41298c278065fe628f3f7aa7a.tar.gz
qemu-952e5d584f5aabe41298c278065fe628f3f7aa7a.tar.bz2
egl-headless: add egl_create_context
We must set the correct context (via eglMakeCurrent) before calling qemu_egl_create_context, so we need a thin wrapper and can't hook qemu_egl_create_context directly as ->dpy_gl_ctx_create callback. Reported-by: Frederik Carlier <frederik.carlier@quamotion.mobi> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20181129123502.30129-1-kraxel@redhat.com
Diffstat (limited to 'ui/egl-headless.c')
-rw-r--r--ui/egl-headless.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 4cf3bbc..519e7ba 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -38,6 +38,14 @@ static void egl_gfx_switch(DisplayChangeListener *dcl,
edpy->ds = new_surface;
}
+static QEMUGLContext egl_create_context(DisplayChangeListener *dcl,
+ QEMUGLParams *params)
+{
+ eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
+ qemu_egl_rn_ctx);
+ return qemu_egl_create_context(dcl, params);
+}
+
static void egl_scanout_disable(DisplayChangeListener *dcl)
{
egl_dpy *edpy = container_of(dcl, egl_dpy, dcl);
@@ -150,7 +158,7 @@ static const DisplayChangeListenerOps egl_ops = {
.dpy_gfx_update = egl_gfx_update,
.dpy_gfx_switch = egl_gfx_switch,
- .dpy_gl_ctx_create = qemu_egl_create_context,
+ .dpy_gl_ctx_create = egl_create_context,
.dpy_gl_ctx_destroy = qemu_egl_destroy_context,
.dpy_gl_ctx_make_current = qemu_egl_make_context_current,
.dpy_gl_ctx_get_current = qemu_egl_get_current_context,