[PATCH RFC 6/6] drm/mediatek: Re-enable AFBC support on MediaTek DRM driver

CK Hu (胡俊光) ck.hu at mediatek.com
Mon Feb 2 18:50:50 PST 2026


On Tue, 2025-12-30 at 11:03 -0300, Nícolas F. R. A. Prado wrote:
> Commit 9882a4064003 ("drm/mediatek: Disable AFBC support on Mediatek DRM
> driver") disabled AFBC support on the MediaTek DRM driver since it was
> broken.
> 
> With the bugs in the AFBC support now fixed, re-enable the support.
> 

Reviewed-by: CK Hu <ck.hu at mediatek.com>

> Signed-off-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_plane.c | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
> index 8fb08768e8ce..38dd94cdd665 100644
> --- a/drivers/gpu/drm/mediatek/mtk_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_plane.c
> @@ -22,6 +22,9 @@
>  
>  static const u64 modifiers[] = {
>  	DRM_FORMAT_MOD_LINEAR,
> +	DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> +				AFBC_FORMAT_MOD_SPLIT |
> +				AFBC_FORMAT_MOD_SPARSE),
>  	DRM_FORMAT_MOD_INVALID,
>  };
>  
> @@ -69,7 +72,26 @@ static bool mtk_plane_format_mod_supported(struct drm_plane *plane,
>  					   uint32_t format,
>  					   uint64_t modifier)
>  {
> -	return modifier == DRM_FORMAT_MOD_LINEAR;
> +	if (modifier == DRM_FORMAT_MOD_LINEAR)
> +		return true;
> +
> +	if (modifier != DRM_FORMAT_MOD_ARM_AFBC(
> +				AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> +				AFBC_FORMAT_MOD_SPLIT |
> +				AFBC_FORMAT_MOD_SPARSE))
> +		return false;
> +
> +	if (format != DRM_FORMAT_XRGB8888 &&
> +	    format != DRM_FORMAT_ARGB8888 &&
> +	    format != DRM_FORMAT_BGRX8888 &&
> +	    format != DRM_FORMAT_BGRA8888 &&
> +	    format != DRM_FORMAT_ABGR8888 &&
> +	    format != DRM_FORMAT_XBGR8888 &&
> +	    format != DRM_FORMAT_RGB888 &&
> +	    format != DRM_FORMAT_BGR888)
> +		return false;
> +
> +	return true;
>  }
>  
>  static void mtk_plane_destroy_state(struct drm_plane *plane,
> 



More information about the linux-arm-kernel mailing list