aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <[email protected]>2019-07-12 12:38:50 +0200
committerTomeu Vizoso <[email protected]>2019-11-06 16:17:13 +0100
commit23fe7cd2d6a5bc162c044805223e22b117854e24 (patch)
tree3a4e7349be692a6ee491645cf948ea4de852429f
parentbc80900b6c8970a62e2161bee0ec3053852b1636 (diff)
panfrost: Add checksum fields to SFBD descriptor
During tests on T720, these fields were discovered. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/pan_sfbd.c12
-rw-r--r--src/panfrost/include/panfrost-job.h5
-rw-r--r--src/panfrost/pandecode/decode.c6
3 files changed, 22 insertions, 1 deletions
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 = {");