diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index cc16c66fecf..80f92e74813 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1801,7 +1801,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, util_format_description(format); if ((device->debug & PAN_DBG_YUV) && panfrost_format_is_yuv(format) && - !(is_shadow && panfrost_format_supports_mtk_tiled(format)) ) { + !(is_shadow && pan_format_supports_mtk_tiled(format)) ) { if (desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) { iview.swizzle[1] = PIPE_SWIZZLE_0; iview.swizzle[2] = PIPE_SWIZZLE_1; diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 8546680fcda..173a36f5d07 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -276,7 +276,7 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen, continue; if (drm_is_mtk_tiled(supported_mods[i]) && - !panfrost_format_supports_mtk_tiled(format)) + !pan_format_supports_mtk_tiled(format)) continue; if (test_modifier != DRM_FORMAT_MOD_INVALID && diff --git a/src/panfrost/lib/pan_afbc.c b/src/panfrost/lib/pan_afbc.c index f8370563249..d9c3b69c6c2 100644 --- a/src/panfrost/lib/pan_afbc.c +++ b/src/panfrost/lib/pan_afbc.c @@ -211,18 +211,3 @@ panfrost_afbc_can_pack(enum pipe_format format) return desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB; } - -/* check for whether a format can be used with MTK_16L32S format */ - -bool panfrost_format_supports_mtk_tiled(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_NV12: - case PIPE_FORMAT_R8_G8B8_420_UNORM: - case PIPE_FORMAT_R8_UNORM: - case PIPE_FORMAT_R8G8_UNORM: - return true; - default: - return false; - } -} diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index 2da0b44da28..65453db04c3 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -98,6 +98,22 @@ #define drm_is_mtk_tiled(mod) \ ((mod >> 52) == (0 | (DRM_FORMAT_MOD_VENDOR_MTK << 4))) +/* check for whether a format can be used with MTK_16L32S format */ + +static inline bool +pan_format_supports_mtk_tiled(enum pipe_format format) +{ + switch (format) { + case PIPE_FORMAT_NV12: + case PIPE_FORMAT_R8_G8B8_420_UNORM: + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8G8_UNORM: + return true; + default: + return false; + } +} + /* Formats */ typedef uint32_t mali_pixel_format; diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 8505cf9cdbb..334f29f4b8f 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -431,8 +431,6 @@ unsigned panfrost_texture_offset(const struct pan_image_layout *layout, unsigned level, unsigned array_idx, unsigned surface_idx); -bool panfrost_format_supports_mtk_tiled(enum pipe_format format); - struct pan_image_explicit_layout { unsigned offset; unsigned row_stride;