pan: Rename/move panfrost_format_supports_mtk_tiled()
Use pan_ instead of panfrost_ as a prefix, and move the function to pan_format.h, since this modifier has nothing to do with AFBC. We keep it in pan_format.h since the amount of code doesn't justify having a separate file for MTK tiling. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com> Reviewed-by: Olivia Lee <olivia.lee@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34767>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user