mesa: use simple mtx in core mesa
Results from x11perf -copywinwin10 on Eric's SKL: 4.33338% ± 0.905054% (n=40) Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Tested-by: Yogesh Marathe <yogesh.marathe@intel.com>
This commit is contained in:
parent
f98a2768ca
commit
f0857fe87b
|
@ -1696,7 +1696,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
return MESA_GLINTEROP_INVALID_MIP_LEVEL;
|
return MESA_GLINTEROP_INVALID_MIP_LEVEL;
|
||||||
|
|
||||||
/* Validate the OpenGL object and get pipe_resource. */
|
/* Validate the OpenGL object and get pipe_resource. */
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
|
|
||||||
if (target == GL_ARRAY_BUFFER) {
|
if (target == GL_ARRAY_BUFFER) {
|
||||||
/* Buffer objects.
|
/* Buffer objects.
|
||||||
|
@ -1712,14 +1712,14 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
* the size of the buffer is 0."
|
* the size of the buffer is 0."
|
||||||
*/
|
*/
|
||||||
if (!buf || buf->Size == 0) {
|
if (!buf || buf->Size == 0) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OBJECT;
|
return MESA_GLINTEROP_INVALID_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = st_buffer_object(buf)->buffer;
|
res = st_buffer_object(buf)->buffer;
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* this shouldn't happen */
|
/* this shouldn't happen */
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OBJECT;
|
return MESA_GLINTEROP_INVALID_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1740,7 +1740,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
* object or if the width or height of renderbuffer is zero."
|
* object or if the width or height of renderbuffer is zero."
|
||||||
*/
|
*/
|
||||||
if (!rb || rb->Width == 0 || rb->Height == 0) {
|
if (!rb || rb->Width == 0 || rb->Height == 0) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OBJECT;
|
return MESA_GLINTEROP_INVALID_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1749,7 +1749,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
* renderbuffer object."
|
* renderbuffer object."
|
||||||
*/
|
*/
|
||||||
if (rb->NumSamples > 1) {
|
if (rb->NumSamples > 1) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OPERATION;
|
return MESA_GLINTEROP_INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1759,7 +1759,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
*/
|
*/
|
||||||
res = st_renderbuffer(rb)->texture;
|
res = st_renderbuffer(rb)->texture;
|
||||||
if (!res) {
|
if (!res) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_OUT_OF_RESOURCES;
|
return MESA_GLINTEROP_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1789,7 +1789,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
obj->Target != target ||
|
obj->Target != target ||
|
||||||
!obj->_BaseComplete ||
|
!obj->_BaseComplete ||
|
||||||
(in->miplevel > 0 && !obj->_MipmapComplete)) {
|
(in->miplevel > 0 && !obj->_MipmapComplete)) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OBJECT;
|
return MESA_GLINTEROP_INVALID_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1802,19 +1802,19 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
* specification and section 3.7.10 of the OpenGL ES 2.0."
|
* specification and section 3.7.10 of the OpenGL ES 2.0."
|
||||||
*/
|
*/
|
||||||
if (in->miplevel < obj->BaseLevel || in->miplevel > obj->_MaxLevel) {
|
if (in->miplevel < obj->BaseLevel || in->miplevel > obj->_MaxLevel) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_MIP_LEVEL;
|
return MESA_GLINTEROP_INVALID_MIP_LEVEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!st_finalize_texture(ctx, st->pipe, obj, 0)) {
|
if (!st_finalize_texture(ctx, st->pipe, obj, 0)) {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_OUT_OF_RESOURCES;
|
return MESA_GLINTEROP_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = st_get_texobj_resource(obj);
|
res = st_get_texobj_resource(obj);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* Incomplete texture buffer object? This shouldn't really occur. */
|
/* Incomplete texture buffer object? This shouldn't really occur. */
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return MESA_GLINTEROP_INVALID_OBJECT;
|
return MESA_GLINTEROP_INVALID_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1854,7 +1854,7 @@ dri2_interop_export_object(__DRIcontext *_ctx,
|
||||||
|
|
||||||
success = screen->resource_get_handle(screen, st->pipe, res, &whandle,
|
success = screen->resource_get_handle(screen, st->pipe, res, &whandle,
|
||||||
usage);
|
usage);
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
return MESA_GLINTEROP_OUT_OF_HOST_MEMORY;
|
return MESA_GLINTEROP_OUT_OF_HOST_MEMORY;
|
||||||
|
|
|
@ -471,7 +471,7 @@ _mesa_delete_buffer_object(struct gl_context *ctx,
|
||||||
bufObj->RefCount = -1000;
|
bufObj->RefCount = -1000;
|
||||||
bufObj->Name = ~0;
|
bufObj->Name = ~0;
|
||||||
|
|
||||||
mtx_destroy(&bufObj->Mutex);
|
simple_mtx_destroy(&bufObj->Mutex);
|
||||||
free(bufObj->Label);
|
free(bufObj->Label);
|
||||||
free(bufObj);
|
free(bufObj);
|
||||||
}
|
}
|
||||||
|
@ -493,11 +493,11 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
|
||||||
GLboolean deleteFlag = GL_FALSE;
|
GLboolean deleteFlag = GL_FALSE;
|
||||||
struct gl_buffer_object *oldObj = *ptr;
|
struct gl_buffer_object *oldObj = *ptr;
|
||||||
|
|
||||||
mtx_lock(&oldObj->Mutex);
|
simple_mtx_lock(&oldObj->Mutex);
|
||||||
assert(oldObj->RefCount > 0);
|
assert(oldObj->RefCount > 0);
|
||||||
oldObj->RefCount--;
|
oldObj->RefCount--;
|
||||||
deleteFlag = (oldObj->RefCount == 0);
|
deleteFlag = (oldObj->RefCount == 0);
|
||||||
mtx_unlock(&oldObj->Mutex);
|
simple_mtx_unlock(&oldObj->Mutex);
|
||||||
|
|
||||||
if (deleteFlag) {
|
if (deleteFlag) {
|
||||||
assert(ctx->Driver.DeleteBuffer);
|
assert(ctx->Driver.DeleteBuffer);
|
||||||
|
@ -510,12 +510,12 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
|
||||||
|
|
||||||
if (bufObj) {
|
if (bufObj) {
|
||||||
/* reference new buffer */
|
/* reference new buffer */
|
||||||
mtx_lock(&bufObj->Mutex);
|
simple_mtx_lock(&bufObj->Mutex);
|
||||||
assert(bufObj->RefCount > 0);
|
assert(bufObj->RefCount > 0);
|
||||||
|
|
||||||
bufObj->RefCount++;
|
bufObj->RefCount++;
|
||||||
*ptr = bufObj;
|
*ptr = bufObj;
|
||||||
mtx_unlock(&bufObj->Mutex);
|
simple_mtx_unlock(&bufObj->Mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ _mesa_initialize_buffer_object(struct gl_context *ctx,
|
||||||
GLuint name)
|
GLuint name)
|
||||||
{
|
{
|
||||||
memset(obj, 0, sizeof(struct gl_buffer_object));
|
memset(obj, 0, sizeof(struct gl_buffer_object));
|
||||||
mtx_init(&obj->Mutex, mtx_plain);
|
simple_mtx_init(&obj->Mutex, mtx_plain);
|
||||||
obj->RefCount = 1;
|
obj->RefCount = 1;
|
||||||
obj->Name = name;
|
obj->Name = name;
|
||||||
obj->Usage = GL_STATIC_DRAW_ARB;
|
obj->Usage = GL_STATIC_DRAW_ARB;
|
||||||
|
@ -870,7 +870,7 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
memset(&DummyBufferObject, 0, sizeof(DummyBufferObject));
|
memset(&DummyBufferObject, 0, sizeof(DummyBufferObject));
|
||||||
mtx_init(&DummyBufferObject.Mutex, mtx_plain);
|
simple_mtx_init(&DummyBufferObject.Mutex, mtx_plain);
|
||||||
DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */
|
DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */
|
||||||
|
|
||||||
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj,
|
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj,
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "util/simple_list.h"
|
#include "util/simple_list.h"
|
||||||
|
|
||||||
|
|
||||||
static mtx_t DynamicIDMutex = _MTX_INITIALIZER_NP;
|
static simple_mtx_t DynamicIDMutex = _SIMPLE_MTX_INITIALIZER_NP;
|
||||||
static GLuint NextDynamicID = 1;
|
static GLuint NextDynamicID = 1;
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,10 +194,10 @@ void
|
||||||
_mesa_debug_get_id(GLuint *id)
|
_mesa_debug_get_id(GLuint *id)
|
||||||
{
|
{
|
||||||
if (!(*id)) {
|
if (!(*id)) {
|
||||||
mtx_lock(&DynamicIDMutex);
|
simple_mtx_lock(&DynamicIDMutex);
|
||||||
if (!(*id))
|
if (!(*id))
|
||||||
*id = NextDynamicID++;
|
*id = NextDynamicID++;
|
||||||
mtx_unlock(&DynamicIDMutex);
|
simple_mtx_unlock(&DynamicIDMutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -702,13 +702,13 @@ debug_pop_group(struct gl_debug_state *debug)
|
||||||
static struct gl_debug_state *
|
static struct gl_debug_state *
|
||||||
_mesa_lock_debug_state(struct gl_context *ctx)
|
_mesa_lock_debug_state(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
mtx_lock(&ctx->DebugMutex);
|
simple_mtx_lock(&ctx->DebugMutex);
|
||||||
|
|
||||||
if (!ctx->Debug) {
|
if (!ctx->Debug) {
|
||||||
ctx->Debug = debug_create();
|
ctx->Debug = debug_create();
|
||||||
if (!ctx->Debug) {
|
if (!ctx->Debug) {
|
||||||
GET_CURRENT_CONTEXT(cur);
|
GET_CURRENT_CONTEXT(cur);
|
||||||
mtx_unlock(&ctx->DebugMutex);
|
simple_mtx_unlock(&ctx->DebugMutex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function may be called from other threads. When that is the
|
* This function may be called from other threads. When that is the
|
||||||
|
@ -727,7 +727,7 @@ _mesa_lock_debug_state(struct gl_context *ctx)
|
||||||
static void
|
static void
|
||||||
_mesa_unlock_debug_state(struct gl_context *ctx)
|
_mesa_unlock_debug_state(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
mtx_unlock(&ctx->DebugMutex);
|
simple_mtx_unlock(&ctx->DebugMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1273,7 +1273,7 @@ _mesa_PopDebugGroup(void)
|
||||||
void
|
void
|
||||||
_mesa_init_debug_output(struct gl_context *ctx)
|
_mesa_init_debug_output(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
mtx_init(&ctx->DebugMutex, mtx_plain);
|
simple_mtx_init(&ctx->DebugMutex, mtx_plain);
|
||||||
|
|
||||||
if (MESA_DEBUG_FLAGS & DEBUG_CONTEXT) {
|
if (MESA_DEBUG_FLAGS & DEBUG_CONTEXT) {
|
||||||
/* If the MESA_DEBUG env is set to "context", we'll turn on the
|
/* If the MESA_DEBUG env is set to "context", we'll turn on the
|
||||||
|
@ -1301,7 +1301,7 @@ _mesa_free_errors_data(struct gl_context *ctx)
|
||||||
ctx->Debug = NULL;
|
ctx->Debug = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_destroy(&ctx->DebugMutex);
|
simple_mtx_destroy(&ctx->DebugMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
|
|
|
@ -276,7 +276,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
|
||||||
|
|
||||||
do_output = should_output(ctx, error, fmtString);
|
do_output = should_output(ctx, error, fmtString);
|
||||||
|
|
||||||
mtx_lock(&ctx->DebugMutex);
|
simple_mtx_lock(&ctx->DebugMutex);
|
||||||
if (ctx->Debug) {
|
if (ctx->Debug) {
|
||||||
do_log = _mesa_debug_is_message_enabled(ctx->Debug,
|
do_log = _mesa_debug_is_message_enabled(ctx->Debug,
|
||||||
MESA_DEBUG_SOURCE_API,
|
MESA_DEBUG_SOURCE_API,
|
||||||
|
@ -287,7 +287,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
|
||||||
else {
|
else {
|
||||||
do_log = GL_FALSE;
|
do_log = GL_FALSE;
|
||||||
}
|
}
|
||||||
mtx_unlock(&ctx->DebugMutex);
|
simple_mtx_unlock(&ctx->DebugMutex);
|
||||||
|
|
||||||
if (do_output || do_log) {
|
if (do_output || do_log) {
|
||||||
char s[MAX_DEBUG_MESSAGE_LENGTH], s2[MAX_DEBUG_MESSAGE_LENGTH];
|
char s[MAX_DEBUG_MESSAGE_LENGTH], s2[MAX_DEBUG_MESSAGE_LENGTH];
|
||||||
|
|
|
@ -89,9 +89,9 @@ delete_dummy_framebuffer(struct gl_framebuffer *fb)
|
||||||
void
|
void
|
||||||
_mesa_init_fbobjects(struct gl_context *ctx)
|
_mesa_init_fbobjects(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
mtx_init(&DummyFramebuffer.Mutex, mtx_plain);
|
simple_mtx_init(&DummyFramebuffer.Mutex, mtx_plain);
|
||||||
mtx_init(&DummyRenderbuffer.Mutex, mtx_plain);
|
simple_mtx_init(&DummyRenderbuffer.Mutex, mtx_plain);
|
||||||
mtx_init(&IncompleteFramebuffer.Mutex, mtx_plain);
|
simple_mtx_init(&IncompleteFramebuffer.Mutex, mtx_plain);
|
||||||
DummyFramebuffer.Delete = delete_dummy_framebuffer;
|
DummyFramebuffer.Delete = delete_dummy_framebuffer;
|
||||||
DummyRenderbuffer.Delete = delete_dummy_renderbuffer;
|
DummyRenderbuffer.Delete = delete_dummy_renderbuffer;
|
||||||
IncompleteFramebuffer.Delete = delete_dummy_framebuffer;
|
IncompleteFramebuffer.Delete = delete_dummy_framebuffer;
|
||||||
|
@ -558,7 +558,7 @@ _mesa_FramebufferRenderbuffer_sw(struct gl_context *ctx,
|
||||||
{
|
{
|
||||||
struct gl_renderbuffer_attachment *att;
|
struct gl_renderbuffer_attachment *att;
|
||||||
|
|
||||||
mtx_lock(&fb->Mutex);
|
simple_mtx_lock(&fb->Mutex);
|
||||||
|
|
||||||
att = get_attachment(ctx, fb, attachment, NULL);
|
att = get_attachment(ctx, fb, attachment, NULL);
|
||||||
assert(att);
|
assert(att);
|
||||||
|
@ -584,7 +584,7 @@ _mesa_FramebufferRenderbuffer_sw(struct gl_context *ctx,
|
||||||
|
|
||||||
invalidate_framebuffer(fb);
|
invalidate_framebuffer(fb);
|
||||||
|
|
||||||
mtx_unlock(&fb->Mutex);
|
simple_mtx_unlock(&fb->Mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3296,7 +3296,7 @@ _mesa_framebuffer_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||||
{
|
{
|
||||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||||
|
|
||||||
mtx_lock(&fb->Mutex);
|
simple_mtx_lock(&fb->Mutex);
|
||||||
if (texObj) {
|
if (texObj) {
|
||||||
if (attachment == GL_DEPTH_ATTACHMENT &&
|
if (attachment == GL_DEPTH_ATTACHMENT &&
|
||||||
texObj == fb->Attachment[BUFFER_STENCIL].Texture &&
|
texObj == fb->Attachment[BUFFER_STENCIL].Texture &&
|
||||||
|
@ -3355,7 +3355,7 @@ _mesa_framebuffer_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||||
|
|
||||||
invalidate_framebuffer(fb);
|
invalidate_framebuffer(fb);
|
||||||
|
|
||||||
mtx_unlock(&fb->Mutex);
|
simple_mtx_unlock(&fb->Mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ _mesa_initialize_window_framebuffer(struct gl_framebuffer *fb,
|
||||||
|
|
||||||
memset(fb, 0, sizeof(struct gl_framebuffer));
|
memset(fb, 0, sizeof(struct gl_framebuffer));
|
||||||
|
|
||||||
mtx_init(&fb->Mutex, mtx_plain);
|
simple_mtx_init(&fb->Mutex, mtx_plain);
|
||||||
|
|
||||||
fb->RefCount = 1;
|
fb->RefCount = 1;
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ _mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name)
|
||||||
fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT;
|
fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT;
|
||||||
fb->_ColorReadBufferIndex = BUFFER_COLOR0;
|
fb->_ColorReadBufferIndex = BUFFER_COLOR0;
|
||||||
fb->Delete = _mesa_destroy_framebuffer;
|
fb->Delete = _mesa_destroy_framebuffer;
|
||||||
mtx_init(&fb->Mutex, mtx_plain);
|
simple_mtx_init(&fb->Mutex, mtx_plain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb)
|
||||||
assert(fb);
|
assert(fb);
|
||||||
assert(fb->RefCount == 0);
|
assert(fb->RefCount == 0);
|
||||||
|
|
||||||
mtx_destroy(&fb->Mutex);
|
simple_mtx_destroy(&fb->Mutex);
|
||||||
|
|
||||||
for (i = 0; i < BUFFER_COUNT; i++) {
|
for (i = 0; i < BUFFER_COUNT; i++) {
|
||||||
struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
|
struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
|
||||||
|
@ -246,11 +246,11 @@ _mesa_reference_framebuffer_(struct gl_framebuffer **ptr,
|
||||||
GLboolean deleteFlag = GL_FALSE;
|
GLboolean deleteFlag = GL_FALSE;
|
||||||
struct gl_framebuffer *oldFb = *ptr;
|
struct gl_framebuffer *oldFb = *ptr;
|
||||||
|
|
||||||
mtx_lock(&oldFb->Mutex);
|
simple_mtx_lock(&oldFb->Mutex);
|
||||||
assert(oldFb->RefCount > 0);
|
assert(oldFb->RefCount > 0);
|
||||||
oldFb->RefCount--;
|
oldFb->RefCount--;
|
||||||
deleteFlag = (oldFb->RefCount == 0);
|
deleteFlag = (oldFb->RefCount == 0);
|
||||||
mtx_unlock(&oldFb->Mutex);
|
simple_mtx_unlock(&oldFb->Mutex);
|
||||||
|
|
||||||
if (deleteFlag)
|
if (deleteFlag)
|
||||||
oldFb->Delete(oldFb);
|
oldFb->Delete(oldFb);
|
||||||
|
@ -259,9 +259,9 @@ _mesa_reference_framebuffer_(struct gl_framebuffer **ptr,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fb) {
|
if (fb) {
|
||||||
mtx_lock(&fb->Mutex);
|
simple_mtx_lock(&fb->Mutex);
|
||||||
fb->RefCount++;
|
fb->RefCount++;
|
||||||
mtx_unlock(&fb->Mutex);
|
simple_mtx_unlock(&fb->Mutex);
|
||||||
*ptr = fb;
|
*ptr = fb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include "main/formats.h" /* MESA_FORMAT_COUNT */
|
#include "main/formats.h" /* MESA_FORMAT_COUNT */
|
||||||
#include "compiler/glsl/list.h"
|
#include "compiler/glsl/list.h"
|
||||||
#include "util/bitscan.h"
|
#include "util/bitscan.h"
|
||||||
|
#include "util/simple_mtx.h"
|
||||||
#include "util/u_dynarray.h"
|
#include "util/u_dynarray.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -969,7 +970,7 @@ typedef enum
|
||||||
*/
|
*/
|
||||||
struct gl_sampler_object
|
struct gl_sampler_object
|
||||||
{
|
{
|
||||||
mtx_t Mutex;
|
simple_mtx_t Mutex;
|
||||||
GLuint Name;
|
GLuint Name;
|
||||||
GLint RefCount;
|
GLint RefCount;
|
||||||
GLchar *Label; /**< GL_KHR_debug */
|
GLchar *Label; /**< GL_KHR_debug */
|
||||||
|
@ -1001,7 +1002,7 @@ struct gl_sampler_object
|
||||||
*/
|
*/
|
||||||
struct gl_texture_object
|
struct gl_texture_object
|
||||||
{
|
{
|
||||||
mtx_t Mutex; /**< for thread safety */
|
simple_mtx_t Mutex; /**< for thread safety */
|
||||||
GLint RefCount; /**< reference count */
|
GLint RefCount; /**< reference count */
|
||||||
GLuint Name; /**< the user-visible texture object ID */
|
GLuint Name; /**< the user-visible texture object ID */
|
||||||
GLchar *Label; /**< GL_KHR_debug */
|
GLchar *Label; /**< GL_KHR_debug */
|
||||||
|
@ -1391,7 +1392,7 @@ typedef enum {
|
||||||
*/
|
*/
|
||||||
struct gl_buffer_object
|
struct gl_buffer_object
|
||||||
{
|
{
|
||||||
mtx_t Mutex;
|
simple_mtx_t Mutex;
|
||||||
GLint RefCount;
|
GLint RefCount;
|
||||||
GLuint Name;
|
GLuint Name;
|
||||||
GLchar *Label; /**< GL_KHR_debug */
|
GLchar *Label; /**< GL_KHR_debug */
|
||||||
|
@ -3215,7 +3216,7 @@ struct gl_sync_object
|
||||||
*/
|
*/
|
||||||
struct gl_shared_state
|
struct gl_shared_state
|
||||||
{
|
{
|
||||||
mtx_t Mutex; /**< for thread safety */
|
simple_mtx_t Mutex; /**< for thread safety */
|
||||||
GLint RefCount; /**< Reference count */
|
GLint RefCount; /**< Reference count */
|
||||||
struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
|
struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
|
||||||
struct _mesa_HashTable *BitmapAtlas; /**< For optimized glBitmap text */
|
struct _mesa_HashTable *BitmapAtlas; /**< For optimized glBitmap text */
|
||||||
|
@ -3299,7 +3300,7 @@ struct gl_shared_state
|
||||||
*/
|
*/
|
||||||
struct gl_renderbuffer
|
struct gl_renderbuffer
|
||||||
{
|
{
|
||||||
mtx_t Mutex; /**< for thread safety */
|
simple_mtx_t Mutex; /**< for thread safety */
|
||||||
GLuint ClassID; /**< Useful for drivers */
|
GLuint ClassID; /**< Useful for drivers */
|
||||||
GLuint Name;
|
GLuint Name;
|
||||||
GLchar *Label; /**< GL_KHR_debug */
|
GLchar *Label; /**< GL_KHR_debug */
|
||||||
|
@ -3377,7 +3378,7 @@ struct gl_renderbuffer_attachment
|
||||||
*/
|
*/
|
||||||
struct gl_framebuffer
|
struct gl_framebuffer
|
||||||
{
|
{
|
||||||
mtx_t Mutex; /**< for thread safety */
|
simple_mtx_t Mutex; /**< for thread safety */
|
||||||
/**
|
/**
|
||||||
* If zero, this is a window system framebuffer. If non-zero, this
|
* If zero, this is a window system framebuffer. If non-zero, this
|
||||||
* is a FBO framebuffer; note that for some devices (i.e. those with
|
* is a FBO framebuffer; note that for some devices (i.e. those with
|
||||||
|
@ -4926,7 +4927,7 @@ struct gl_context
|
||||||
GLuint ErrorDebugCount;
|
GLuint ErrorDebugCount;
|
||||||
|
|
||||||
/* GL_ARB_debug_output/GL_KHR_debug */
|
/* GL_ARB_debug_output/GL_KHR_debug */
|
||||||
mtx_t DebugMutex;
|
simple_mtx_t DebugMutex;
|
||||||
struct gl_debug_state *Debug;
|
struct gl_debug_state *Debug;
|
||||||
|
|
||||||
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
|
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
|
||||||
|
|
|
@ -40,7 +40,7 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
|
||||||
mtx_init(&rb->Mutex, mtx_plain);
|
simple_mtx_init(&rb->Mutex, mtx_plain);
|
||||||
|
|
||||||
rb->ClassID = 0;
|
rb->ClassID = 0;
|
||||||
rb->Name = name;
|
rb->Name = name;
|
||||||
|
@ -101,7 +101,7 @@ _mesa_new_renderbuffer(struct gl_context *ctx, GLuint name)
|
||||||
void
|
void
|
||||||
_mesa_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
_mesa_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
{
|
{
|
||||||
mtx_destroy(&rb->Mutex);
|
simple_mtx_destroy(&rb->Mutex);
|
||||||
free(rb->Label);
|
free(rb->Label);
|
||||||
free(rb);
|
free(rb);
|
||||||
}
|
}
|
||||||
|
@ -201,11 +201,11 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
|
||||||
GLboolean deleteFlag = GL_FALSE;
|
GLboolean deleteFlag = GL_FALSE;
|
||||||
struct gl_renderbuffer *oldRb = *ptr;
|
struct gl_renderbuffer *oldRb = *ptr;
|
||||||
|
|
||||||
mtx_lock(&oldRb->Mutex);
|
simple_mtx_lock(&oldRb->Mutex);
|
||||||
assert(oldRb->RefCount > 0);
|
assert(oldRb->RefCount > 0);
|
||||||
oldRb->RefCount--;
|
oldRb->RefCount--;
|
||||||
deleteFlag = (oldRb->RefCount == 0);
|
deleteFlag = (oldRb->RefCount == 0);
|
||||||
mtx_unlock(&oldRb->Mutex);
|
simple_mtx_unlock(&oldRb->Mutex);
|
||||||
|
|
||||||
if (deleteFlag) {
|
if (deleteFlag) {
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
@ -218,9 +218,9 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
|
||||||
|
|
||||||
if (rb) {
|
if (rb) {
|
||||||
/* reference new renderbuffer */
|
/* reference new renderbuffer */
|
||||||
mtx_lock(&rb->Mutex);
|
simple_mtx_lock(&rb->Mutex);
|
||||||
rb->RefCount++;
|
rb->RefCount++;
|
||||||
mtx_unlock(&rb->Mutex);
|
simple_mtx_unlock(&rb->Mutex);
|
||||||
*ptr = rb;
|
*ptr = rb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ _mesa_GetGraphicsResetStatusARB( void )
|
||||||
*/
|
*/
|
||||||
status = ctx->Driver.GetGraphicsResetStatus(ctx);
|
status = ctx->Driver.GetGraphicsResetStatus(ctx);
|
||||||
|
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
|
|
||||||
/* If this context has not been affected by a GPU reset, check to see if
|
/* If this context has not been affected by a GPU reset, check to see if
|
||||||
* some other context in the share group has been affected by a reset.
|
* some other context in the share group has been affected by a reset.
|
||||||
|
@ -150,7 +150,7 @@ _mesa_GetGraphicsResetStatusARB( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->ShareGroupReset = ctx->Shared->ShareGroupReset;
|
ctx->ShareGroupReset = ctx->Shared->ShareGroupReset;
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != GL_NO_ERROR)
|
if (status != GL_NO_ERROR)
|
||||||
|
|
|
@ -63,7 +63,7 @@ delete_sampler_object(struct gl_context *ctx,
|
||||||
struct gl_sampler_object *sampObj)
|
struct gl_sampler_object *sampObj)
|
||||||
{
|
{
|
||||||
_mesa_delete_sampler_handles(ctx, sampObj);
|
_mesa_delete_sampler_handles(ctx, sampObj);
|
||||||
mtx_destroy(&sampObj->Mutex);
|
simple_mtx_destroy(&sampObj->Mutex);
|
||||||
free(sampObj->Label);
|
free(sampObj->Label);
|
||||||
free(sampObj);
|
free(sampObj);
|
||||||
}
|
}
|
||||||
|
@ -83,11 +83,11 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
|
||||||
GLboolean deleteFlag = GL_FALSE;
|
GLboolean deleteFlag = GL_FALSE;
|
||||||
struct gl_sampler_object *oldSamp = *ptr;
|
struct gl_sampler_object *oldSamp = *ptr;
|
||||||
|
|
||||||
mtx_lock(&oldSamp->Mutex);
|
simple_mtx_lock(&oldSamp->Mutex);
|
||||||
assert(oldSamp->RefCount > 0);
|
assert(oldSamp->RefCount > 0);
|
||||||
oldSamp->RefCount--;
|
oldSamp->RefCount--;
|
||||||
deleteFlag = (oldSamp->RefCount == 0);
|
deleteFlag = (oldSamp->RefCount == 0);
|
||||||
mtx_unlock(&oldSamp->Mutex);
|
simple_mtx_unlock(&oldSamp->Mutex);
|
||||||
|
|
||||||
if (deleteFlag)
|
if (deleteFlag)
|
||||||
delete_sampler_object(ctx, oldSamp);
|
delete_sampler_object(ctx, oldSamp);
|
||||||
|
@ -98,12 +98,12 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
|
||||||
|
|
||||||
if (samp) {
|
if (samp) {
|
||||||
/* reference new sampler */
|
/* reference new sampler */
|
||||||
mtx_lock(&samp->Mutex);
|
simple_mtx_lock(&samp->Mutex);
|
||||||
assert(samp->RefCount > 0);
|
assert(samp->RefCount > 0);
|
||||||
|
|
||||||
samp->RefCount++;
|
samp->RefCount++;
|
||||||
*ptr = samp;
|
*ptr = samp;
|
||||||
mtx_unlock(&samp->Mutex);
|
simple_mtx_unlock(&samp->Mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
|
||||||
static void
|
static void
|
||||||
_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
|
_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
|
||||||
{
|
{
|
||||||
mtx_init(&sampObj->Mutex, mtx_plain);
|
simple_mtx_init(&sampObj->Mutex, mtx_plain);
|
||||||
sampObj->Name = name;
|
sampObj->Name = name;
|
||||||
sampObj->RefCount = 1;
|
sampObj->RefCount = 1;
|
||||||
sampObj->WrapS = GL_REPEAT;
|
sampObj->WrapS = GL_REPEAT;
|
||||||
|
|
|
@ -66,7 +66,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
|
||||||
if (!shared)
|
if (!shared)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mtx_init(&shared->Mutex, mtx_plain);
|
simple_mtx_init(&shared->Mutex, mtx_plain);
|
||||||
|
|
||||||
shared->DisplayList = _mesa_NewHashTable();
|
shared->DisplayList = _mesa_NewHashTable();
|
||||||
shared->BitmapAtlas = _mesa_NewHashTable();
|
shared->BitmapAtlas = _mesa_NewHashTable();
|
||||||
|
@ -435,7 +435,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
|
||||||
_mesa_DeleteHashTable(shared->MemoryObjects);
|
_mesa_DeleteHashTable(shared->MemoryObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_destroy(&shared->Mutex);
|
simple_mtx_destroy(&shared->Mutex);
|
||||||
mtx_destroy(&shared->TexMutex);
|
mtx_destroy(&shared->TexMutex);
|
||||||
|
|
||||||
free(shared);
|
free(shared);
|
||||||
|
@ -459,11 +459,11 @@ _mesa_reference_shared_state(struct gl_context *ctx,
|
||||||
struct gl_shared_state *old = *ptr;
|
struct gl_shared_state *old = *ptr;
|
||||||
GLboolean delete;
|
GLboolean delete;
|
||||||
|
|
||||||
mtx_lock(&old->Mutex);
|
simple_mtx_lock(&old->Mutex);
|
||||||
assert(old->RefCount >= 1);
|
assert(old->RefCount >= 1);
|
||||||
old->RefCount--;
|
old->RefCount--;
|
||||||
delete = (old->RefCount == 0);
|
delete = (old->RefCount == 0);
|
||||||
mtx_unlock(&old->Mutex);
|
simple_mtx_unlock(&old->Mutex);
|
||||||
|
|
||||||
if (delete) {
|
if (delete) {
|
||||||
free_shared_state(ctx, old);
|
free_shared_state(ctx, old);
|
||||||
|
@ -474,9 +474,9 @@ _mesa_reference_shared_state(struct gl_context *ctx,
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
/* reference new state */
|
/* reference new state */
|
||||||
mtx_lock(&state->Mutex);
|
simple_mtx_lock(&state->Mutex);
|
||||||
state->RefCount++;
|
state->RefCount++;
|
||||||
*ptr = state;
|
*ptr = state;
|
||||||
mtx_unlock(&state->Mutex);
|
simple_mtx_unlock(&state->Mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ struct gl_sync_object *
|
||||||
_mesa_get_and_ref_sync(struct gl_context *ctx, GLsync sync, bool incRefCount)
|
_mesa_get_and_ref_sync(struct gl_context *ctx, GLsync sync, bool incRefCount)
|
||||||
{
|
{
|
||||||
struct gl_sync_object *syncObj = (struct gl_sync_object *) sync;
|
struct gl_sync_object *syncObj = (struct gl_sync_object *) sync;
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
if (syncObj != NULL
|
if (syncObj != NULL
|
||||||
&& _mesa_set_search(ctx->Shared->SyncObjects, syncObj) != NULL
|
&& _mesa_set_search(ctx->Shared->SyncObjects, syncObj) != NULL
|
||||||
&& !syncObj->DeletePending) {
|
&& !syncObj->DeletePending) {
|
||||||
|
@ -187,7 +187,7 @@ _mesa_get_and_ref_sync(struct gl_context *ctx, GLsync sync, bool incRefCount)
|
||||||
} else {
|
} else {
|
||||||
syncObj = NULL;
|
syncObj = NULL;
|
||||||
}
|
}
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
return syncObj;
|
return syncObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,17 +198,17 @@ _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj,
|
||||||
{
|
{
|
||||||
struct set_entry *entry;
|
struct set_entry *entry;
|
||||||
|
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
syncObj->RefCount -= amount;
|
syncObj->RefCount -= amount;
|
||||||
if (syncObj->RefCount == 0) {
|
if (syncObj->RefCount == 0) {
|
||||||
entry = _mesa_set_search(ctx->Shared->SyncObjects, syncObj);
|
entry = _mesa_set_search(ctx->Shared->SyncObjects, syncObj);
|
||||||
assert (entry != NULL);
|
assert (entry != NULL);
|
||||||
_mesa_set_remove(ctx->Shared->SyncObjects, entry);
|
_mesa_set_remove(ctx->Shared->SyncObjects, entry);
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
|
|
||||||
ctx->Driver.DeleteSyncObject(ctx, syncObj);
|
ctx->Driver.DeleteSyncObject(ctx, syncObj);
|
||||||
} else {
|
} else {
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,9 +292,9 @@ fence_sync(struct gl_context *ctx, GLenum condition, GLbitfield flags)
|
||||||
|
|
||||||
ctx->Driver.FenceSync(ctx, syncObj, condition, flags);
|
ctx->Driver.FenceSync(ctx, syncObj, condition, flags);
|
||||||
|
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
_mesa_set_add(ctx->Shared->SyncObjects, syncObj);
|
_mesa_set_add(ctx->Shared->SyncObjects, syncObj);
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
|
|
||||||
return (GLsync)syncObj;
|
return (GLsync)syncObj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@ _mesa_initialize_texture_object( struct gl_context *ctx,
|
||||||
|
|
||||||
memset(obj, 0, sizeof(*obj));
|
memset(obj, 0, sizeof(*obj));
|
||||||
/* init the non-zero fields */
|
/* init the non-zero fields */
|
||||||
mtx_init(&obj->Mutex, mtx_plain);
|
simple_mtx_init(&obj->Mutex, mtx_plain);
|
||||||
obj->RefCount = 1;
|
obj->RefCount = 1;
|
||||||
obj->Name = name;
|
obj->Name = name;
|
||||||
obj->Target = target;
|
obj->Target = target;
|
||||||
|
@ -411,7 +411,7 @@ _mesa_delete_texture_object(struct gl_context *ctx,
|
||||||
_mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL);
|
_mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL);
|
||||||
|
|
||||||
/* destroy the mutex -- it may have allocated memory (eg on bsd) */
|
/* destroy the mutex -- it may have allocated memory (eg on bsd) */
|
||||||
mtx_destroy(&texObj->Mutex);
|
simple_mtx_destroy(&texObj->Mutex);
|
||||||
|
|
||||||
free(texObj->Label);
|
free(texObj->Label);
|
||||||
|
|
||||||
|
@ -554,12 +554,12 @@ _mesa_reference_texobj_(struct gl_texture_object **ptr,
|
||||||
assert(valid_texture_object(oldTex));
|
assert(valid_texture_object(oldTex));
|
||||||
(void) valid_texture_object; /* silence warning in release builds */
|
(void) valid_texture_object; /* silence warning in release builds */
|
||||||
|
|
||||||
mtx_lock(&oldTex->Mutex);
|
simple_mtx_lock(&oldTex->Mutex);
|
||||||
assert(oldTex->RefCount > 0);
|
assert(oldTex->RefCount > 0);
|
||||||
oldTex->RefCount--;
|
oldTex->RefCount--;
|
||||||
|
|
||||||
deleteFlag = (oldTex->RefCount == 0);
|
deleteFlag = (oldTex->RefCount == 0);
|
||||||
mtx_unlock(&oldTex->Mutex);
|
simple_mtx_unlock(&oldTex->Mutex);
|
||||||
|
|
||||||
if (deleteFlag) {
|
if (deleteFlag) {
|
||||||
/* Passing in the context drastically changes the driver code for
|
/* Passing in the context drastically changes the driver code for
|
||||||
|
@ -579,12 +579,12 @@ _mesa_reference_texobj_(struct gl_texture_object **ptr,
|
||||||
if (tex) {
|
if (tex) {
|
||||||
/* reference new texture */
|
/* reference new texture */
|
||||||
assert(valid_texture_object(tex));
|
assert(valid_texture_object(tex));
|
||||||
mtx_lock(&tex->Mutex);
|
simple_mtx_lock(&tex->Mutex);
|
||||||
assert(tex->RefCount > 0);
|
assert(tex->RefCount > 0);
|
||||||
|
|
||||||
tex->RefCount++;
|
tex->RefCount++;
|
||||||
*ptr = tex;
|
*ptr = tex;
|
||||||
mtx_unlock(&tex->Mutex);
|
simple_mtx_unlock(&tex->Mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1615,10 +1615,10 @@ bind_texture_object(struct gl_context *ctx, unsigned unit,
|
||||||
*/
|
*/
|
||||||
if (targetIndex != TEXTURE_EXTERNAL_INDEX) {
|
if (targetIndex != TEXTURE_EXTERNAL_INDEX) {
|
||||||
bool early_out;
|
bool early_out;
|
||||||
mtx_lock(&ctx->Shared->Mutex);
|
simple_mtx_lock(&ctx->Shared->Mutex);
|
||||||
early_out = ((ctx->Shared->RefCount == 1)
|
early_out = ((ctx->Shared->RefCount == 1)
|
||||||
&& (texObj == texUnit->CurrentTex[targetIndex]));
|
&& (texObj == texUnit->CurrentTex[targetIndex]));
|
||||||
mtx_unlock(&ctx->Shared->Mutex);
|
simple_mtx_unlock(&ctx->Shared->Mutex);
|
||||||
if (early_out) {
|
if (early_out) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ vbo_get_minmax_cached(struct gl_buffer_object *bufferObj,
|
||||||
if (!vbo_use_minmax_cache(bufferObj))
|
if (!vbo_use_minmax_cache(bufferObj))
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
mtx_lock(&bufferObj->Mutex);
|
simple_mtx_lock(&bufferObj->Mutex);
|
||||||
|
|
||||||
if (bufferObj->MinMaxCacheDirty) {
|
if (bufferObj->MinMaxCacheDirty) {
|
||||||
/* Disable the cache permanently for this BO if the number of hits
|
/* Disable the cache permanently for this BO if the number of hits
|
||||||
|
@ -166,7 +166,7 @@ out_invalidate:
|
||||||
}
|
}
|
||||||
|
|
||||||
out_disable:
|
out_disable:
|
||||||
mtx_unlock(&bufferObj->Mutex);
|
simple_mtx_unlock(&bufferObj->Mutex);
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ vbo_minmax_cache_store(struct gl_context *ctx,
|
||||||
if (!vbo_use_minmax_cache(bufferObj))
|
if (!vbo_use_minmax_cache(bufferObj))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mtx_lock(&bufferObj->Mutex);
|
simple_mtx_lock(&bufferObj->Mutex);
|
||||||
|
|
||||||
if (!bufferObj->MinMaxCache) {
|
if (!bufferObj->MinMaxCache) {
|
||||||
bufferObj->MinMaxCache =
|
bufferObj->MinMaxCache =
|
||||||
|
@ -223,7 +223,7 @@ vbo_minmax_cache_store(struct gl_context *ctx,
|
||||||
free(entry);
|
free(entry);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mtx_unlock(&bufferObj->Mutex);
|
simple_mtx_unlock(&bufferObj->Mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue