Module: Mesa
Branch: main
Commit: c6a7d0ead25014f742f4c39aadc0ed6e65f2ae7e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6a7d0ead25014f742f4c39aadc0ed6e65f2ae7e

Author: Italo Nicola <[email protected]>
Date:   Tue Aug 29 21:31:04 2023 +0000

panfrost: fix untracked dependency when converting resource modifier

Signed-off-by: Italo Nicola <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>

---

 src/gallium/drivers/panfrost/pan_resource.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c 
b/src/gallium/drivers/panfrost/pan_resource.c
index 011a5386785..fc9c6b60e89 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -1328,6 +1328,9 @@ pan_resource_modifier_convert(struct panfrost_context 
*ctx,
       .filter = PIPE_TEX_FILTER_NEAREST,
    };
 
+   /* data_valid is not valid until flushed */
+   panfrost_flush_writer(ctx, rsrc, "AFBC decompressing blit");
+
    for (int i = 0; i <= rsrc->base.last_level; i++) {
       if (BITSET_TEST(rsrc->valid.data, i)) {
          blit.dst.level = blit.src.level = i;
@@ -1343,6 +1346,11 @@ pan_resource_modifier_convert(struct panfrost_context 
*ctx,
       }
    }
 
+   /* we lose track of tmp_rsrc after this point, and the BO migration
+    * (from tmp_rsrc to rsrc) doesn't transfer the last_writer to rsrc
+    */
+   panfrost_flush_writer(ctx, tmp_rsrc, "AFBC decompressing blit");
+
    panfrost_bo_unreference(rsrc->image.data.bo);
 
    rsrc->image.data.bo = tmp_rsrc->image.data.bo;

Reply via email to