summaryrefslogtreecommitdiffstats
path: root/src/panfrost/shared/pan_tiling.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-01 07:39:22 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-01 07:40:19 -0700
commit9fe4fd8a9cf7be47096906d4da3dce70bd02d2a5 (patch)
tree570f1ce647c3c3f5f8c46bc2b5cf9ce3fa51bcae /src/panfrost/shared/pan_tiling.c
parentf2801f77750668fc94cb8b6369477615d30516c8 (diff)
panfrost: Extend software tiling to larger bpp
Should not affect lima. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/shared/pan_tiling.c')
-rw-r--r--src/panfrost/shared/pan_tiling.c58
1 files changed, 49 insertions, 9 deletions
diff --git a/src/panfrost/shared/pan_tiling.c b/src/panfrost/shared/pan_tiling.c
index 08c9561b2ef..72679f3ed80 100644
--- a/src/panfrost/shared/pan_tiling.c
+++ b/src/panfrost/shared/pan_tiling.c
@@ -219,17 +219,57 @@ panfrost_access_tiled_image_generic(void *dst, void *src,
uint8_t *out = is_store ? dest : source;
uint8_t *in = is_store ? source : dest;
- /* Write out 1-4 bytes. Written like this rather than a loop so the
- * compiler doesn't need to do branching (just some predication) */
+ uint16_t *out16 = (uint16_t *) out;
+ uint16_t *in16 = (uint16_t *) in;
- out[0] = in[0];
- if (bpp > 1) {
- out[1] = in[1];
- if (bpp > 2) {
+ uint32_t *out32 = (uint32_t *) out;
+ uint32_t *in32 = (uint32_t *) in;
+
+ uint64_t *out64 = (uint64_t *) out;
+ uint64_t *in64 = (uint64_t *) in;
+
+ /* Write out 1-16 bytes. Written like this rather than a loop so the
+ * compiler can see what's going on */
+
+ switch (bpp) {
+ case 1:
+ out[0] = in[0];
+ break;
+
+ case 2:
+ out16[0] = in16[0];
+ break;
+
+ case 3:
+ out16[0] = in16[0];
out[2] = in[2];
- if (bpp > 3)
- out[3] = in[3];
- }
+ break;
+
+ case 4:
+ out32[0] = in32[0];
+ break;
+
+ case 6:
+ out32[0] = in32[0];
+ out16[2] = in16[2];
+ break;
+
+ case 8:
+ out64[0] = in64[0];
+ break;
+
+ case 12:
+ out64[0] = in64[0];
+ out32[2] = in32[2];
+ break;
+
+ case 16:
+ out64[0] = in64[0];
+ out64[1] = in64[1];
+ break;
+
+ default:
+ unreachable("Invalid bpp in software tiling");
}
}
}