mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
panfrost: fix a GPU/CPU synchronization problem
Remove a premature optimization. When PIPE_MAP_DISCARD_WHOLE_RESOURCE
is set we were setting create_new_bo, and then if that was set we skipped
a set of tests which if passed would cause a panfrost_flush_writer.
In fact we need that flush in some cases (e.g. when any batch is
reading the resource). Moreover, we should sometimes copy the resource
(set the copy_resource flag) and that again was being skipped if
create_new_bo was initially true due to PIPE_MAP_DISCARD_WHOLE_RESOURCE
being set.
Cc: mesa-stable
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28406>
(cherry picked from commit e3d123b7a6)
This commit is contained in:
parent
062a764258
commit
7afd8e495a
2 changed files with 2 additions and 2 deletions
|
|
@ -2614,7 +2614,7 @@
|
|||
"description": "panfrost: fix a GPU/CPU synchronization problem",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1181,7 +1181,7 @@ panfrost_ptr_map(struct pipe_context *pctx, struct pipe_resource *resource,
|
|||
bool create_new_bo = usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE;
|
||||
bool copy_resource = false;
|
||||
|
||||
if (!create_new_bo && !(usage & PIPE_MAP_UNSYNCHRONIZED) &&
|
||||
if (!(usage & PIPE_MAP_UNSYNCHRONIZED) &&
|
||||
!(resource->flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT) &&
|
||||
(usage & PIPE_MAP_WRITE) && panfrost_any_batch_reads_rsrc(ctx, rsrc)) {
|
||||
/* When a resource to be modified is already being used by a
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue