diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-10-05 06:33:37 -0400 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-10-07 09:52:31 -0400 |
commit | 9e84fc73bef549c5e291de1ccfb860be3b83a693 (patch) | |
tree | 8c919bdacc1c9cb1ca135dcde0d54044d4a4ad86 /src/mesa/main | |
parent | 941c70a28a8db3a852ca5245354effa2bf1e7cf8 (diff) |
mesa: unlock texture on error path in glEGLImageTargetTexStorageEXT
The texture mutex was not properly unlocked on error path, leading to deadlocks
Fixes: 6a3f5c65 ("mesa: simplify st_egl_image binding process for texture storage")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7422
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18964>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/teximage.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4b1ad59aa11..5a7b4f17497 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3546,8 +3546,10 @@ egl_image_target_texture(struct gl_context *ctx, struct st_egl_image stimg; bool native_supported; if (!st_get_egl_image(ctx, image, PIPE_BIND_SAMPLER_VIEW, caller, - &stimg, &native_supported)) + &stimg, &native_supported)) { + _mesa_unlock_texture(ctx, texObj); return; + } if (tex_storage) { /* EXT_EGL_image_storage @@ -3560,6 +3562,7 @@ egl_image_target_texture(struct gl_context *ctx, !(target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s(texture is imported from dmabuf)", caller); + _mesa_unlock_texture(ctx, texObj); return; } st_bind_egl_image(ctx, texObj, texImage, &stimg, true, native_supported); |