Mesa (staging/22.1): zink: use only the extents for buffer unmap flushes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 17 16:05:10 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: c549cb7aa1ca519a1330fe40ea41745db3a868b7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c549cb7aa1ca519a1330fe40ea41745db3a868b7

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jun 16 14:56:32 2022 -0400

zink: use only the extents for buffer unmap flushes

flush_region is relative to the map, so passing in the offsets again
breaks the flush (if the flush hook is implemented correctly)

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit 28d23c9e2614fef5b468674ca9cd6b430d869d95)

---

 .pick_status.json                        | 2 +-
 src/gallium/drivers/zink/zink_resource.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 4572920a812..91100d5b859 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -103,7 +103,7 @@
         "description": "zink: use only the extents for buffer unmap flushes",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 269efbe4d6c..c2198b8e6a4 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -1860,7 +1860,10 @@ transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
    struct zink_transfer *trans = (struct zink_transfer *)ptrans;
 
    if (!(trans->base.b.usage & (PIPE_MAP_FLUSH_EXPLICIT | PIPE_MAP_COHERENT))) {
-      zink_transfer_flush_region(pctx, ptrans, &ptrans->box);
+      /* flush_region is relative to the mapped region: use only the extents */
+      struct pipe_box box = ptrans->box;
+      box.x = box.y = box.z = 0;
+      zink_transfer_flush_region(pctx, ptrans, &box);
    }
 
    if ((trans->base.b.usage & PIPE_MAP_PERSISTENT) && !(trans->base.b.usage & PIPE_MAP_COHERENT))



More information about the mesa-commit mailing list