mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-15 05:10:18 +01:00
i965,meta: Stop unlocking the texture to try and prevent deadlocks.
Unlocking the texture is not safe: another thread could come in and grab it. Now that we use a recursive mutex, this should work. This also fixes texture lock deadlocks in the new meta fast clear path. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Tested-by: Chris Forbes <chrisf@ijw.co.nz>
This commit is contained in:
parent
0871028188
commit
d682ebec0b
2 changed files with 0 additions and 22 deletions
|
|
@ -2773,7 +2773,6 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims,
|
|||
GLint x, GLint y,
|
||||
GLsizei width, GLsizei height)
|
||||
{
|
||||
struct gl_texture_object *texObj = texImage->TexObject;
|
||||
GLuint fbo;
|
||||
bool success = false;
|
||||
GLbitfield mask;
|
||||
|
|
@ -2782,8 +2781,6 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims,
|
|||
if (!ctx->Extensions.ARB_framebuffer_object)
|
||||
return false;
|
||||
|
||||
_mesa_unlock_texture(ctx, texObj);
|
||||
|
||||
_mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
|
||||
|
||||
_mesa_GenFramebuffers(1, &fbo);
|
||||
|
|
@ -2834,7 +2831,6 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims,
|
|||
success = mask == 0x0;
|
||||
|
||||
out:
|
||||
_mesa_lock_texture(ctx, texObj);
|
||||
_mesa_DeleteFramebuffers(1, &fbo);
|
||||
_mesa_meta_end(ctx);
|
||||
return success;
|
||||
|
|
@ -2852,7 +2848,6 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
|
|||
GLint x, GLint y,
|
||||
GLsizei width, GLsizei height)
|
||||
{
|
||||
struct gl_texture_object *texObj = texImage->TexObject;
|
||||
GLenum format, type;
|
||||
GLint bpp;
|
||||
void *buf;
|
||||
|
|
@ -2897,8 +2892,6 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
|
|||
return;
|
||||
}
|
||||
|
||||
_mesa_unlock_texture(ctx, texObj); /* need to unlock first */
|
||||
|
||||
/*
|
||||
* Read image from framebuffer (disable pixel transfer ops)
|
||||
*/
|
||||
|
|
@ -2927,8 +2920,6 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
|
|||
|
||||
_mesa_meta_end(ctx);
|
||||
|
||||
_mesa_lock_texture(ctx, texObj); /* re-lock */
|
||||
|
||||
free(buf);
|
||||
}
|
||||
|
||||
|
|
@ -3206,12 +3197,9 @@ _mesa_meta_GetTexImage(struct gl_context *ctx,
|
|||
struct gl_texture_image *texImage)
|
||||
{
|
||||
if (_mesa_is_format_compressed(texImage->TexFormat)) {
|
||||
struct gl_texture_object *texObj = texImage->TexObject;
|
||||
GLuint slice;
|
||||
bool result;
|
||||
|
||||
/* Need to unlock the texture here to prevent deadlock... */
|
||||
_mesa_unlock_texture(ctx, texObj);
|
||||
for (slice = 0; slice < texImage->Depth; slice++) {
|
||||
void *dst;
|
||||
if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY
|
||||
|
|
@ -3236,8 +3224,6 @@ _mesa_meta_GetTexImage(struct gl_context *ctx,
|
|||
if (!result)
|
||||
break;
|
||||
}
|
||||
/* ... and relock it */
|
||||
_mesa_lock_texture(ctx, texObj);
|
||||
|
||||
if (result)
|
||||
return;
|
||||
|
|
@ -3539,15 +3525,11 @@ _mesa_meta_ClearTexSubImage(struct gl_context *ctx,
|
|||
{
|
||||
bool res;
|
||||
|
||||
_mesa_unlock_texture(ctx, texImage->TexObject);
|
||||
|
||||
res = cleartexsubimage_using_fbo(ctx, texImage,
|
||||
xoffset, yoffset, zoffset,
|
||||
width, height, depth,
|
||||
clearValue);
|
||||
|
||||
_mesa_lock_texture(ctx, texImage->TexObject);
|
||||
|
||||
if (res)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -266,8 +266,6 @@ brw_blorp_copytexsubimage(struct brw_context *brw,
|
|||
int dst_slice = slice + dst_image->TexObject->MinLayer + dst_image->Face;
|
||||
int dst_level = dst_image->Level + dst_image->TexObject->MinLevel;
|
||||
|
||||
_mesa_unlock_texture(ctx, dst_image->TexObject);
|
||||
|
||||
brw_blorp_blit_miptrees(brw,
|
||||
src_mt, src_irb->mt_level, src_irb->mt_layer,
|
||||
dst_mt, dst_level, dst_slice,
|
||||
|
|
@ -275,8 +273,6 @@ brw_blorp_copytexsubimage(struct brw_context *brw,
|
|||
dstX0, dstY0, dstX1, dstY1,
|
||||
GL_NEAREST, false, mirror_y);
|
||||
|
||||
_mesa_lock_texture(ctx, dst_image->TexObject);
|
||||
|
||||
/* If we're copying to a packed depth stencil texture and the source
|
||||
* framebuffer has separate stencil, we need to also copy the stencil data
|
||||
* over.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue