Mesa (master): panfrost: Allow bpp24 tiling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 21 20:05:36 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue May 19 17:52:29 2020 -0400

panfrost: Allow bpp24 tiling

It's dumb that we have to but it does help RGB8 nontrivially. Alas.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5124>

---

 src/gallium/drivers/panfrost/pan_resource.c | 2 +-
 src/panfrost/shared/pan_tiling.c            | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 3e68cbdbef4..983292f9fb7 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -411,7 +411,7 @@ panfrost_resource_create_bo(struct panfrost_device *dev, struct panfrost_resourc
 
         unsigned bpp = util_format_get_blocksizebits(res->format);
         bool is_2d = (res->target == PIPE_TEXTURE_2D);
-        bool is_sane_bpp = bpp == 8 || bpp == 16 || bpp == 32 || bpp == 64 || bpp == 128;
+        bool is_sane_bpp = bpp == 8 || bpp == 16 || bpp == 24 || bpp == 32 || bpp == 64 || bpp == 128;
         bool should_tile = (res->usage != PIPE_USAGE_STREAM);
         bool must_tile = (res->bind & PIPE_BIND_DEPTH_STENCIL) && (dev->quirks & MIDGARD_SFBD);
         bool can_tile = is_2d && is_sane_bpp && ((res->bind & ~valid_binding) == 0);
diff --git a/src/panfrost/shared/pan_tiling.c b/src/panfrost/shared/pan_tiling.c
index ad7b202faa2..1275fdcf62a 100644
--- a/src/panfrost/shared/pan_tiling.c
+++ b/src/panfrost/shared/pan_tiling.c
@@ -143,6 +143,11 @@ typedef struct {
 } __attribute__((packed)) pan_uint128_t;
 #endif
 
+typedef struct {
+  uint16_t lo;
+  uint8_t hi;
+} __attribute__((packed)) pan_uint24_t;
+
 /* Optimized routine to tile an aligned (w & 0xF == 0) texture. Explanation:
  *
  * dest_start precomputes the offset to the beginning of the first horizontal
@@ -235,6 +240,8 @@ TILED_ACCESS_TYPE(pan_uint128_t, 4);
       TILED_UNALIGNED_TYPE(uint8_t, store, shift) \
    else if (bpp == 16) \
       TILED_UNALIGNED_TYPE(uint16_t, store, shift) \
+   else if (bpp == 24) \
+      TILED_UNALIGNED_TYPE(pan_uint24_t, store, shift) \
    else if (bpp == 32) \
       TILED_UNALIGNED_TYPE(uint32_t, store, shift) \
    else if (bpp == 64) \
@@ -283,7 +290,7 @@ panfrost_access_tiled_image(void *dst, void *src,
 {
    const struct util_format_description *desc = util_format_description(format);
 
-   if (desc->block.width > 1) {
+   if (desc->block.width > 1 || desc->block.bits == 24) {
       panfrost_access_tiled_image_generic(dst, (void *) src,
             x, y, w, h,
             dst_stride, src_stride, desc, is_store);



More information about the mesa-commit mailing list