Commit a3a97621 authored by Emil Velikov's avatar Emil Velikov Committed by Georges Basile Stavracas Neto

renderer/native: add missing eglTerminate in EGLDevice error path

Currently the EGLDevice code gets the display and calls eglInitialize.
As a follow-up it checks the required EGL extensions - technically it
could check the EGL device extensions earlier.

In either case, eglTerminate is missing. Thus the connection to the
display was still bound.

This was highlighted with Mesa commit d6edccee8da ("egl: add
EGL_platform_device support") + amdgpu.

In that case, since the eglTerminate is missing, we end up reusing the
underlying amdgpu_device due to some caching in libdrm_amdgpu. The
latter in itself being a good solution since it allows buffer sharing
across primary and render node of the same device.

Note: we should really get this in branches all the way back to 3.30.


Fixes: 934184e2 ("MetaRendererNative: Add EGLDevice based rendering support")
Cc: Jonas Ådahl <>
Signed-off-by: default avatarEmil Velikov <>

(cherry picked from commit 92135748)
parent 8b79c83a
Pipeline #88113 passed with stages
in 6 minutes and 33 seconds
......@@ -4038,6 +4038,7 @@ create_renderer_gpu_data_egl_device (MetaRendererNative *renderer_native,
"Missing EGL extensions required for EGLDevice renderer: %s",
meta_egl_terminate (egl, egl_display, NULL);
g_free (missing_extensions_str);
g_free (missing_extensions);
return NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment