From a0a5d0f02e0dba0df651c3d31ae2c4e5c8d183c0 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Thu, 3 Aug 2023 22:18:36 +0200 Subject: [PATCH] egl/dri2: Add a couple of missing mutex release in error path This is causing a hang in the intel compute runtime when trying to cl/gl share an unsupported texture format. Fixes: f1efe037dfd82d95b025 ("egl/dri2: Add display lock") Signed-off-by: Sylvain Munaut Reviewed-by: Eric Engestrom Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 456cdb1b783..6b3c6c905f0 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2951,7 +2951,8 @@ dri2_export_drm_image_mesa(_EGLDisplay *disp, _EGLImage *img, EGLint *name, if (name && !dri2_dpy->image->queryImage(dri2_img->dri_image, __DRI_IMAGE_ATTRIB_NAME, name)) - return _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa"); + return dri2_egl_error_unlock(dri2_dpy, EGL_BAD_ALLOC, + "dri2_export_drm_image_mesa"); if (handle) dri2_dpy->image->queryImage(dri2_img->dri_image, @@ -3040,8 +3041,10 @@ dri2_export_dma_buf_image_mesa(_EGLDisplay *disp, _EGLImage *img, int *fds, struct dri2_egl_image *dri2_img = dri2_egl_image(img); EGLint nplanes; - if (!dri2_can_export_dma_buf_image(disp, img)) + if (!dri2_can_export_dma_buf_image(disp, img)) { + mtx_unlock(&dri2_dpy->lock); return EGL_FALSE; + } /* EGL_MESA_image_dma_buf_export spec says: * "If the number of fds is less than the number of planes, then