mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
panfrost: Make sure we always add a reader -> write dependency when needed
We shouldn't reset the ->writer field when a reader comes in because we want subsequent readers to have a dependency on the writer too. Let's add a new field encoding the last access type and use it to replace the writer != NULL test. Reported-by: Roman Elshin Fixes:c6ebff3ecd("panfrost: Remove panfrost_bo_access type") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7831> (cherry picked from commit387221e4f2)
This commit is contained in:
parent
c865522912
commit
93ac6a935f
2 changed files with 6 additions and 4 deletions
|
|
@ -301,7 +301,7 @@
|
|||
"description": "panfrost: Make sure we always add a reader -> write dependency when needed",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "c6ebff3ecdde46ef7925326522395b4a50dd65a3"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
* better GPU utilization.
|
||||
*
|
||||
* Each accessed BO has a corresponding entry in the ->accessed_bos hash table.
|
||||
* A BO is either being written or read at any time (see if writer != NULL).
|
||||
* A BO is either being written or read at any time (see last_is_write).
|
||||
* When the last access is a write, the batch writing the BO might have read
|
||||
* dependencies (readers that have not been executed yet and want to read the
|
||||
* previous BO content), and when the last access is a read, all readers might
|
||||
|
|
@ -60,6 +60,7 @@
|
|||
struct panfrost_bo_access {
|
||||
struct util_dynarray readers;
|
||||
struct panfrost_batch_fence *writer;
|
||||
bool last_is_write;
|
||||
};
|
||||
|
||||
static struct panfrost_batch_fence *
|
||||
|
|
@ -399,7 +400,7 @@ panfrost_batch_update_bo_access(struct panfrost_batch *batch,
|
|||
entry = _mesa_hash_table_search(ctx->accessed_bos, bo);
|
||||
access = entry ? entry->data : NULL;
|
||||
if (access) {
|
||||
old_writes = access->writer != NULL;
|
||||
old_writes = access->last_is_write;
|
||||
} else {
|
||||
access = rzalloc(ctx, struct panfrost_bo_access);
|
||||
util_dynarray_init(&access->readers, access);
|
||||
|
|
@ -479,7 +480,6 @@ panfrost_batch_update_bo_access(struct panfrost_batch *batch,
|
|||
util_dynarray_append(&access->readers,
|
||||
struct panfrost_batch_fence *,
|
||||
batch->out_sync);
|
||||
access->writer = NULL;
|
||||
}
|
||||
} else {
|
||||
/* We already accessed this BO before, so we should already be
|
||||
|
|
@ -504,6 +504,8 @@ panfrost_batch_update_bo_access(struct panfrost_batch *batch,
|
|||
if (access->writer)
|
||||
panfrost_batch_add_dep(batch, access->writer);
|
||||
}
|
||||
|
||||
access->last_is_write = writes;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue