freedreno: Remove the submit lock locking.

I think the whole submit lock thing should be possible to remove now, but
just getting rid of the lock since we're no longer sharing batches between
ctxes means another several percent draw overhead improvement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
This commit is contained in:
Emma Anholt 2021-01-25 12:04:48 -08:00 committed by Marge Bot
parent b2349a4671
commit 22486ffa51
2 changed files with 1 additions and 15 deletions

View File

@ -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);
}

View File

@ -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;
}
/**