Mesa (master): panfrost: Add checksum fields to SFBD descriptor

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 6 15:56:26 UTC 2019


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

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Fri Jul 12 12:38:50 2019 +0200

panfrost: Add checksum fields to SFBD descriptor

During tests on T720, these fields were discovered.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_sfbd.c | 12 ++++++++++++
 src/panfrost/include/panfrost-job.h     |  5 ++++-
 src/panfrost/pandecode/decode.c         |  6 ++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_sfbd.c b/src/gallium/drivers/panfrost/pan_sfbd.c
index b5e18f07045..882c9990a30 100644
--- a/src/gallium/drivers/panfrost/pan_sfbd.c
+++ b/src/gallium/drivers/panfrost/pan_sfbd.c
@@ -147,5 +147,17 @@ panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws)
         if (batch->requirements & PAN_REQ_MSAA)
                 fb.format |= MALI_FRAMEBUFFER_MSAA_A | MALI_FRAMEBUFFER_MSAA_B;
 
+        struct pipe_surface *surf = batch->key.cbufs[0];
+        struct panfrost_resource *rsrc = pan_resource(surf->texture);
+        struct panfrost_bo *bo = rsrc->bo;
+
+        if (rsrc->checksummed) {
+                unsigned level = surf->u.tex.level;
+                struct panfrost_slice *slice = &rsrc->slices[level];
+
+                fb.checksum_stride = slice->checksum_stride;
+                fb.checksum = bo->gpu + slice->checksum_offset;
+        }
+
         return panfrost_upload_transient(batch, &fb, sizeof(fb)) | MALI_SFBD;
 }
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 286c663e41e..dba8d3306b0 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1447,7 +1447,10 @@ struct mali_single_framebuffer {
         u16 width;
         u16 height;
 
-        u32 zero3[8];
+        u32 zero3[4];
+        mali_ptr checksum;
+        u32 checksum_stride;
+        u32 zero5;
 
         /* By default, the framebuffer is upside down from OpenGL's
          * perspective. Set framebuffer to the end and negate the stride to
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index a310582ebe8..4d3d04248d0 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -660,6 +660,11 @@ pandecode_sfbd(uint64_t gpu_va, int job_no, bool is_fragment)
         pandecode_prop("width = MALI_POSITIVE(%" PRId16 ")", info.width);
         pandecode_prop("height = MALI_POSITIVE(%" PRId16 ")", info.height);
 
+        MEMORY_PROP(s, checksum);
+
+        if (s->checksum_stride)
+                pandecode_prop("checksum_stride = %d", s->checksum_stride);
+
         MEMORY_PROP(s, framebuffer);
         pandecode_prop("stride = %d", s->stride);
 
@@ -709,6 +714,7 @@ pandecode_sfbd(uint64_t gpu_va, int job_no, bool is_fragment)
         pandecode_prop("zero1 = 0x%" PRIx64, s->zero1);
         pandecode_prop("zero2 = 0x%" PRIx32, s->zero2);
         pandecode_prop("zero4 = 0x%" PRIx32, s->zero4);
+        pandecode_prop("zero5 = 0x%" PRIx32, s->zero4);
 
         printf(".zero3 = {");
 




More information about the mesa-commit mailing list