Mesa (main): panfrost: Eliminate redundant flushes with AFBC
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 19:10:18 UTC 2021
Module: Mesa
Branch: main
Commit: 12c057315bab0fafc71516b6c88a346a7f60406f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=12c057315bab0fafc71516b6c88a346a7f60406f
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Fri May 28 18:29:03 2021 -0400
panfrost: Eliminate redundant flushes with AFBC
We have all the information we need easily available.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
---
src/gallium/drivers/panfrost/pan_resource.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 41ce9ff5ada..594c5b51962 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -840,14 +840,11 @@ panfrost_ptr_map(struct pipe_context *pctx,
assert(transfer->staging.rsrc != NULL);
- /* TODO: Eliminate this flush. It's only there to determine if
- * we're initialized or not, when the initialization could come
- * from a pending batch XXX */
- panfrost_flush_batches_accessing_rsrc(ctx, rsrc);
+ bool valid = BITSET_TEST(rsrc->valid.data, level);
- if ((usage & PIPE_MAP_READ) && BITSET_TEST(rsrc->valid.data, level)) {
+ if ((usage & PIPE_MAP_READ) && (valid || rsrc->track.writer)) {
pan_blit_to_staging(pctx, transfer);
- panfrost_flush_batches_accessing_rsrc(ctx, staging);
+ panfrost_flush_writer(ctx, staging);
panfrost_bo_wait(staging->image.data.bo, INT64_MAX, false);
}
More information about the mesa-commit
mailing list