From 5fad83bdf8be62e448dd3d60fa39daca6f1c7c0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 8 Aug 2014 16:53:53 -0700 Subject: [PATCH] mesa: Use _mesa_lock_context_textures in _mesa_GetTexParameterfv() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GetTexParamterfv() doesnt change texture state, so instead of _mesa_lock_texture() we can use _mesa_lock_context_textures(), which doesn't increase the texture stamp. With this change, _mesa_update_state_locked() is now only called from under _mesa_lock_context_textures(), which is right thing to do. Right now it's the same mutex, but if we made texture locking more fine grained locking one day, just locking one texture here would be wrong. This all ignores the fact that texture locking seem a bit flaky and broken, but we're trying to not blatantly make it worse. This change allows us to reliably unlock the context textures in the dd::UpdateState callback as is necessary for meta color resolves. Signed-off-by: Kristian Høgsberg Acked-by: Kenneth Graunke --- src/mesa/main/texparam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 30dd0b9b3bb..e40fb249e6a 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1384,7 +1384,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) if (!obj) return; - _mesa_lock_texture(ctx, obj); + _mesa_lock_context_textures(ctx); switch (pname) { case GL_TEXTURE_MAG_FILTER: *params = ENUM_TO_FLOAT(obj->Sampler.MagFilter); @@ -1591,11 +1591,11 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) } /* no error if we get here */ - _mesa_unlock_texture(ctx, obj); + _mesa_unlock_context_textures(ctx); return; invalid_pname: - _mesa_unlock_texture(ctx, obj); + _mesa_unlock_context_textures(ctx); _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname); } -- 2.30.2