[PATCH 01/42] drm/mediatek: Rename OVL format naming
CK Hu (胡俊光)
ck.hu at mediatek.com
Thu Jul 2 00:30:25 PDT 2026
On Wed, 2026-07-01 at 14:20 +0200, AngeloGioacchino Del Regno wrote:
> From: Paul-pl Chen <paul-pl.chen at mediatek.com>
>
> Rename format arrays from mt8173_formats[] to mt8173_ovl_formats[]
> to explicitly indicate that these format definitions are specific
> to OVL (Overlay) components.
>
> This naming improvement is necessary because MT8196 introduces new
> display components (EXDMA, BLENDER, OUTPROC) that support different
> format capabilities than OVL. Without clear naming, it becomes
> ambiguous which formats apply to which component type.
>
> Examples of format differences between components:
> - EXDMA supports 10-bit RGB formats that some OVL variants don't
> - BLENDER has different YUV handling requirements
> - Component-specific format conversion capabilities vary
>
> The explicit naming:
> - Prevents confusion when debugging format-related issues
> - Makes it immediately clear which component a format array belongs to
> - Improves code searchability (grep for "ovl_formats")
> - Follows consistent naming convention for component-specific definitions
> - Prepares for adding exdma_formats[], blender_formats[] arrays
>
> This is a preparatory patch for MT8196 component support, which
> requires clear distinction between OVL formats and EXDMA/BLENDER
> formats to avoid applying incorrect format configurations.
Reviewed-by: CK Hu <ck.hu at mediatek.com>
>
> Signed-off-by: Paul-pl Chen <paul-pl.chen at mediatek.com>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 36 ++++++++++++-------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index c4b5a262fa8a..87c2b5e6d6b0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> @@ -101,7 +101,7 @@ static inline bool is_10bit_rgb(u32 fmt)
> return false;
> }
>
> -static const u32 mt8173_formats[] = {
> +static const u32 mt8173_ovl_formats[] = {
> DRM_FORMAT_XRGB8888,
> DRM_FORMAT_ARGB8888,
> DRM_FORMAT_BGRX8888,
> @@ -115,7 +115,7 @@ static const u32 mt8173_formats[] = {
> DRM_FORMAT_YUYV,
> };
>
> -static const u32 mt8195_formats[] = {
> +static const u32 mt8195_ovl_formats[] = {
> DRM_FORMAT_XRGB8888,
> DRM_FORMAT_ARGB8888,
> DRM_FORMAT_XRGB2101010,
> @@ -673,8 +673,8 @@ static const struct mtk_disp_ovl_data mt2701_ovl_driver_data = {
> .gmc_bits = 8,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = false,
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8167_ovl_driver_data = {
> @@ -683,8 +683,8 @@ static const struct mtk_disp_ovl_data mt8167_ovl_driver_data = {
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> .smi_id_en = true,
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8173_ovl_driver_data = {
> @@ -692,8 +692,8 @@ static const struct mtk_disp_ovl_data mt8173_ovl_driver_data = {
> .gmc_bits = 8,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8183_ovl_driver_data = {
> @@ -701,8 +701,8 @@ static const struct mtk_disp_ovl_data mt8183_ovl_driver_data = {
> .gmc_bits = 10,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8183_ovl_2l_driver_data = {
> @@ -710,8 +710,8 @@ static const struct mtk_disp_ovl_data mt8183_ovl_2l_driver_data = {
> .gmc_bits = 10,
> .layer_nr = 2,
> .fmt_rgb565_is_0 = true,
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8192_ovl_driver_data = {
> @@ -723,8 +723,8 @@ static const struct mtk_disp_ovl_data mt8192_ovl_driver_data = {
> .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
> BIT(DRM_MODE_BLEND_COVERAGE) |
> BIT(DRM_MODE_BLEND_PIXEL_NONE),
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8192_ovl_2l_driver_data = {
> @@ -736,8 +736,8 @@ static const struct mtk_disp_ovl_data mt8192_ovl_2l_driver_data = {
> .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
> BIT(DRM_MODE_BLEND_COVERAGE) |
> BIT(DRM_MODE_BLEND_PIXEL_NONE),
> - .formats = mt8173_formats,
> - .num_formats = ARRAY_SIZE(mt8173_formats),
> + .formats = mt8173_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8173_ovl_formats),
> };
>
> static const struct mtk_disp_ovl_data mt8195_ovl_driver_data = {
> @@ -750,8 +750,8 @@ static const struct mtk_disp_ovl_data mt8195_ovl_driver_data = {
> .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
> BIT(DRM_MODE_BLEND_COVERAGE) |
> BIT(DRM_MODE_BLEND_PIXEL_NONE),
> - .formats = mt8195_formats,
> - .num_formats = ARRAY_SIZE(mt8195_formats),
> + .formats = mt8195_ovl_formats,
> + .num_formats = ARRAY_SIZE(mt8195_ovl_formats),
> .supports_clrfmt_ext = true,
> };
>
More information about the linux-arm-kernel
mailing list