Re: [PATCH v2 33/46] drm/mediatek: Add support for Display Controller exDMA component

From: CK Hu (胡俊光)

Date: Thu Dec 03 2026 - 00:11:27 EST


On Tue, 2026-07-14 at 13:44 +0200, AngeloGioacchino Del Regno wrote:
> Add support for the Display Overlay extended DMA engine (exDMA) as
> found in the MediaTek Kompanio Ultra MT8196, Genio Pro 5100 MT8894,
> Dimensity 9400 MT6991 and others.
>
> This is a DMA engine and its purpose is to configure the Display
> Controller to read data from DRAM and also includes color transfer
> functions to process pixels into a consistent color domain.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
> ---

[snip]

>
> +static const struct mtk_ddp_comp_funcs ddp_exdma = {
> + .clk_enable = mtk_exdma_clk_enable,
> + .clk_disable = mtk_exdma_clk_disable,
> + .config = mtk_exdma_config,
> + .start = mtk_exdma_start,
> + .stop = mtk_exdma_stop,
> + .layer_config = mtk_exdma_layer_config,
> + .layer_nr = mtk_exdma_layer_nr,

In mtk_crtc_init_comp_planes(), the component which layer_nr > 0 would get its blend mode,
but exDMA does not support get_blend_modes.
So fix this.

> + .get_formats = mtk_exdma_get_formats,
> + .get_num_formats = mtk_exdma_get_num_formats,
> +};
> +

[snip]

> +
> +static int mtk_disp_exdma_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct mtk_disp_exdma *priv;
> + int ret = 0;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->regs = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(priv->regs))
> + return dev_err_probe(dev, PTR_ERR(priv->regs), "Cannot get reg resource\n");
> +
> + priv->clk = devm_clk_get(dev, NULL);
> + if (IS_ERR(priv->clk))
> + return dev_err_probe(dev, PTR_ERR(priv->clk), "Cannot get clocks\n");
> +
> +#if IS_REACHABLE(CONFIG_MTK_CMDQ)
> + ret = cmdq_dev_get_client_reg(dev, &priv->cmdq_reg, 0);

There is no mediatek,gce-client-reg in device node,
but mtk_ddp_write() would call cmdq_pkt_write() which need subsys id.
So now just use CPU to write register.
You may need add mediatek,gce-client-reg in device node,
or modify mtk_ddp_write() to call cmdq_pkt_write_pa().

Regards,
CK

> + if (ret)
> + dev_dbg(dev, "No mediatek,gce-client-reg\n");
> +#endif
> + platform_set_drvdata(pdev, priv);
> +
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
> + ret = component_add(dev, &mtk_disp_exdma_component_ops);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to add component\n");
> +
> + return 0;
> +}
> +