diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 6c627c43b5b..1e47d6caf80 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1469,7 +1469,7 @@ pan_resource_modifier_convert(struct panfrost_context *ctx, if (template.next) { struct pipe_resource second_template = *template.next; bool fix_stride; - assert(drm_is_mtk_tiled(rsrc->base.format, rsrc->image.layout.modifier)); + assert(drm_is_mtk_tiled(rsrc->image.layout.modifier)); /* fix up the stride */ switch (rsrc->base.format) { case PIPE_FORMAT_R8_G8B8_420_UNORM: @@ -1529,8 +1529,7 @@ pan_resource_modifier_convert(struct panfrost_context *ctx, util_num_layers(&rsrc->base, i), &blit.dst.box); blit.src.box = blit.dst.box; - if (drm_is_mtk_tiled(rsrc->base.format, - rsrc->image.layout.modifier)) + if (drm_is_mtk_tiled(rsrc->image.layout.modifier)) screen->vtbl.mtk_detile(ctx, &blit); else panfrost_blit_no_afbc_legalization(&ctx->base, &blit); @@ -1582,7 +1581,7 @@ pan_legalize_format(struct panfrost_context *ctx, if (!drm_is_afbc(rsrc->image.layout.modifier) && !drm_is_afrc(rsrc->image.layout.modifier) && - !drm_is_mtk_tiled(old_format, rsrc->image.layout.modifier)) + !drm_is_mtk_tiled(rsrc->image.layout.modifier)) return; if (drm_is_afbc(rsrc->image.layout.modifier)) { @@ -1594,7 +1593,7 @@ pan_legalize_format(struct panfrost_context *ctx, struct pan_afrc_format_info new_info = panfrost_afrc_get_format_info(new_format); compatible = !memcmp(&old_info, &new_info, sizeof(old_info)); - } else if (drm_is_mtk_tiled(old_format, rsrc->image.layout.modifier)) { + } else if (drm_is_mtk_tiled(rsrc->image.layout.modifier)) { compatible = false; dest_modifier = DRM_FORMAT_MOD_LINEAR; } diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index f156974d43f..e14df7057f0 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -274,7 +274,7 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen, if (drm_is_afrc(pan_best_modifiers[i]) && !afrc) continue; - if (drm_is_mtk_tiled(format, pan_best_modifiers[i]) && + if (drm_is_mtk_tiled(pan_best_modifiers[i]) && !panfrost_format_supports_mtk_tiled(format)) continue; @@ -286,7 +286,7 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen, modifiers[count] = pan_best_modifiers[i]; if (external_only) - external_only[count] = drm_is_mtk_tiled(format, modifiers[count]); + external_only[count] = drm_is_mtk_tiled(modifiers[count]); } count++; } diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 11e3018d031..0afed2bbb52 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -446,9 +446,8 @@ bool panfrost_format_supports_mtk_tiled(enum pipe_format format); ((mod >> 52) == \ (DRM_FORMAT_MOD_ARM_TYPE_AFRC | (DRM_FORMAT_MOD_VENDOR_ARM << 4))) -#define drm_is_mtk_tiled(format, mod) \ - ((mod >> 52) == \ - (0 | (DRM_FORMAT_MOD_VENDOR_MTK << 4))) +#define drm_is_mtk_tiled(mod) \ + ((mod >> 52) == (0 | (DRM_FORMAT_MOD_VENDOR_MTK << 4))) struct pan_image_explicit_layout { unsigned offset;