diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c index dc1a850dc2b..f8ada703900 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.c +++ b/src/gallium/drivers/freedreno/freedreno_batch.c @@ -135,8 +135,6 @@ fd_batch_create(struct fd_context *ctx, bool nondraw) batch->ctx = ctx; batch->nondraw = nondraw; - simple_mtx_init(&batch->submit_lock, mtx_plain); - batch->resources = _mesa_set_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal); batch->dependents = @@ -321,8 +319,6 @@ __fd_batch_destroy(struct fd_batch *batch) batch_fini(batch); - simple_mtx_destroy(&batch->submit_lock); - free(batch); } diff --git a/src/gallium/drivers/freedreno/freedreno_batch.h b/src/gallium/drivers/freedreno/freedreno_batch.h index c6edab46ef1..c74e5e862f2 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.h +++ b/src/gallium/drivers/freedreno/freedreno_batch.h @@ -65,11 +65,6 @@ struct fd_batch { struct fd_context *ctx; - /* emit_lock serializes cmdstream emission and flush. Acquire before - * screen->lock. - */ - simple_mtx_t submit_lock; - /* do we need to mem2gmem before rendering. We don't, if for example, * there was a glClear() that invalidated the entire previous buffer * contents. Keep track of which buffer(s) are cleared, or needs @@ -307,7 +302,6 @@ fd_batch_reference(struct fd_batch **ptr, struct fd_batch *batch) static inline void fd_batch_unlock_submit(struct fd_batch *batch) { - simple_mtx_unlock(&batch->submit_lock); } /** @@ -317,11 +311,7 @@ fd_batch_unlock_submit(struct fd_batch *batch) static inline bool MUST_CHECK fd_batch_lock_submit(struct fd_batch *batch) { - simple_mtx_lock(&batch->submit_lock); - bool ret = !batch->flushed; - if (!ret) - fd_batch_unlock_submit(batch); - return ret; + return !batch->flushed; } /**