Module: Mesa Branch: main Commit: d25bb73bb66cc3c3a554954abd06041d7d240513 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d25bb73bb66cc3c3a554954abd06041d7d240513
Author: Alyssa Rosenzweig <[email protected]> Date: Sat Apr 16 10:26:49 2022 -0400 panfrost: Use panfrost_afbc_superblock_width ..instead of panfrost_block_dim. This is clearer, and gets rid of block dim users. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991> --- src/panfrost/lib/pan_cs.c | 4 ++-- src/panfrost/lib/pan_layout.c | 3 +-- src/panfrost/lib/pan_texture.c | 2 +- src/panfrost/lib/pan_texture.h | 3 --- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/panfrost/lib/pan_cs.c b/src/panfrost/lib/pan_cs.c index c52285a87fc..d0f67c495e5 100644 --- a/src/panfrost/lib/pan_cs.c +++ b/src/panfrost/lib/pan_cs.c @@ -451,7 +451,7 @@ pan_prepare_rt(const struct pan_fb_info *fb, unsigned idx, cfg->afbc.row_stride = slice->afbc.row_stride / AFBC_HEADER_BYTES_PER_TILE; cfg->afbc.afbc_wide_block_enable = - panfrost_block_dim(rt->image->layout.modifier, true, 0) > 16; + panfrost_afbc_superblock_width(rt->image->layout.modifier) > 16; #else cfg->afbc.chunk_size = 9; cfg->afbc.sparse = true; @@ -584,7 +584,7 @@ pan_force_clean_write_rt(const struct pan_image_view *rt, unsigned tile_size) if (!drm_is_afbc(rt->image->layout.modifier)) return false; - unsigned superblock = panfrost_block_dim(rt->image->layout.modifier, true, 0); + unsigned superblock = panfrost_afbc_superblock_width(rt->image->layout.modifier); assert(superblock >= 16); assert(tile_size <= 16*16); diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c index 18c8a9dc289..8bad94aa995 100644 --- a/src/panfrost/lib/pan_layout.c +++ b/src/panfrost/lib/pan_layout.c @@ -95,8 +95,7 @@ panfrost_afbc_superblock_height(uint64_t modifier) * extract the dimensions of a block-based format and use that to calculate the * line stride as such. */ - -unsigned +static inline unsigned panfrost_block_dim(uint64_t modifier, bool width, unsigned plane) { if (!drm_is_afbc(modifier)) { diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index ce65ff52ebf..0ef88f11d59 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -82,7 +82,7 @@ panfrost_compression_tag(const struct util_format_description *desc, flags |= MALI_AFBC_SURFACE_FLAG_PREFETCH; /* Wide blocks (> 16x16) */ - if (panfrost_block_dim(modifier, true, 0) > 16) + if (panfrost_afbc_superblock_width(modifier) > 16) flags |= MALI_AFBC_SURFACE_FLAG_WIDE_BLOCK; /* Used to make sure AFBC headers don't point outside the AFBC diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 8a60e07cf31..607b8a2724b 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -177,9 +177,6 @@ unsigned panfrost_afbc_superblock_width(uint64_t modifier); unsigned panfrost_afbc_superblock_height(uint64_t modifier); -unsigned -panfrost_block_dim(uint64_t modifier, bool width, unsigned plane); - #ifdef PAN_ARCH unsigned GENX(panfrost_estimate_texture_payload_size)(const struct pan_image_view *iview);
