Mesa (master): panfrost: Add checksum BOs to batch

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 7 17:28:39 UTC 2020


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

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Mon May  4 09:01:19 2020 +0200

panfrost: Add checksum BOs to batch

So they don't get released before the last frame finishes rendering.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4944>

---

 src/gallium/drivers/panfrost/pan_job.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 461d29aeaa0..5b02701392a 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -580,6 +580,18 @@ panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo,
         panfrost_batch_update_bo_access(batch, bo, flags, old_flags != 0);
 }
 
+static void
+panfrost_batch_add_resource_bos(struct panfrost_batch *batch,
+                                struct panfrost_resource *rsrc,
+                                uint32_t flags)
+{
+        panfrost_batch_add_bo(batch, rsrc->bo, flags);
+
+        for (unsigned i = 0; i < MAX_MIP_LEVELS; i++)
+                if (rsrc->slices[i].checksum_bo)
+                        panfrost_batch_add_bo(batch, rsrc->slices[i].checksum_bo, flags);
+}
+
 void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
 {
         uint32_t flags = PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_WRITE |
@@ -588,12 +600,12 @@ void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
 
         for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
                 struct panfrost_resource *rsrc = pan_resource(batch->key.cbufs[i]->texture);
-                panfrost_batch_add_bo(batch, rsrc->bo, flags);
+                panfrost_batch_add_resource_bos(batch, rsrc, flags);
         }
 
         if (batch->key.zsbuf) {
                 struct panfrost_resource *rsrc = pan_resource(batch->key.zsbuf->texture);
-                panfrost_batch_add_bo(batch, rsrc->bo, flags);
+                panfrost_batch_add_resource_bos(batch, rsrc, flags);
         }
 }
 



More information about the mesa-commit mailing list