diff options
author | Alyssa Rosenzweig <alyssa@collabora.com> | 2023-01-14 18:24:32 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-30 23:21:59 +0000 |
commit | e6529d6dccde385e7f39e704b699171b83597c04 (patch) | |
tree | de05506cf0d07f3903ce317ec26b0c89f76f4a54 /src/gallium | |
parent | c224bc6f701285576b008753c657db40da42cabf (diff) |
panfrost: Don't update access with a single batch
drawoverhead test 25 from 462->492
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 171f3dc8d78..a318f753ac6 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -48,6 +48,18 @@ panfrost_batch_idx(struct panfrost_batch *batch) return batch - batch->ctx->batches.slots; } +static bool +panfrost_any_batch_other_than(struct panfrost_context *ctx, unsigned index) +{ + unsigned i; + foreach_batch(ctx, i) { + if (i != index) + return true; + } + + return false; +} + /* Adds the BO backing surface to a batch if the surface is non-null */ static void @@ -235,6 +247,17 @@ panfrost_batch_update_access(struct panfrost_batch *batch, { struct panfrost_context *ctx = batch->ctx; uint32_t batch_idx = panfrost_batch_idx(batch); + + if (writes) { + _mesa_hash_table_insert(ctx->writers, rsrc, batch); + } + + /* The rest of this routine is just about flushing other batches. If there + * aren't any, we can skip a lot of work. + */ + if (!panfrost_any_batch_other_than(ctx, batch_idx)) + return; + struct hash_entry *entry = _mesa_hash_table_search(ctx->writers, rsrc); struct panfrost_batch *writer = entry ? entry->data : NULL; @@ -257,10 +280,6 @@ panfrost_batch_update_access(struct panfrost_batch *batch, panfrost_batch_submit(ctx, batch); } } - - if (writes) { - _mesa_hash_table_insert(ctx->writers, rsrc, batch); - } } static pan_bo_access * |