summaryrefslogtreecommitdiffstats
path: root/ui/egl-headless.c
diff options
context:
space:
mode:
authorMarc-André Lureau2022-02-16 16:33:37 +0100
committerMarc-André Lureau2022-03-14 12:16:01 +0100
commita62c4a178fb154a3b810870502cb4c63a6b4cf28 (patch)
treec548b0ce1df3ec573a03a2335e8d17fd04289084 /ui/egl-headless.c
parentui/console: move check for compatible GL context (diff)
downloadqemu-a62c4a178fb154a3b810870502cb4c63a6b4cf28.tar.gz
qemu-a62c4a178fb154a3b810870502cb4c63a6b4cf28.tar.xz
qemu-a62c4a178fb154a3b810870502cb4c63a6b4cf28.zip
ui/console: move dcl compatiblity check to a callback
As expected from the "compatible_dcl" comment, a simple comparison of ops isn't enough. The following patch will fix a regression introduced by this limited check by extending the compatibility callback for egl-headless. For now, this patch simply replaces the the "compatible_dcl" ops pointer with a "dpy_gl_ctx_is_compatible_ctx" callback. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/egl-headless.c')
-rw-r--r--ui/egl-headless.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 94082a9da9..9aff115280 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -166,8 +166,15 @@ static const DisplayChangeListenerOps egl_ops = {
.dpy_gl_update = egl_scanout_flush,
};
+static bool
+egl_is_compatible_dcl(DisplayGLCtx *dgc,
+ DisplayChangeListener *dcl)
+{
+ return dcl->ops == &egl_ops;
+}
+
static const DisplayGLCtxOps eglctx_ops = {
- .compatible_dcl = &egl_ops,
+ .dpy_gl_ctx_is_compatible_dcl = egl_is_compatible_dcl,
.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,