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: f1efe037df ("egl/dri2: Add display lock")

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24487>
(cherry picked from commit a0a5d0f02e)
This commit is contained in:
Sylvain Munaut 2023-08-03 22:18:36 +02:00 committed by Eric Engestrom
parent 228033916a
commit 73aeb45443
2 changed files with 6 additions and 3 deletions

View file

@ -8095,7 +8095,7 @@
"description": "egl/dri2: Add a couple of missing mutex release in error path",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f1efe037dfd82d95b025a3ddf58b669758b8d69a"
},

View file

@ -2963,7 +2963,8 @@ dri2_export_drm_image_mesa(_EGLDisplay *disp, _EGLImage *img,
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,
@ -3054,8 +3055,10 @@ dri2_export_dma_buf_image_mesa(_EGLDisplay *disp, _EGLImage *img,
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