Re: [PATCH v7 10/15] drm/imx: dc-ed: Support getting source selection
From: Alexander Stein
Date: Mon Oct 26 2026 - 06:42:17 EST
Hi,
thanks for the patch and adding me.
Am Montag, 26. Oktober 2026, 11:05:15 Mitteleuropäische Normalzeit schrieb Liu Ying:
> Add a helper to get ExtDst source selection. This is needed by
> disabling CRTC at boot in an upcoming commit which tries to get
> the source selection.
>
> Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> Acked-by: Maxime Ripard <mripard@xxxxxxxxxx>
> Signed-off-by: Liu Ying <victor.liu@xxxxxxx>
> --
> v7:
> - Collect Maxime's A-b tag.
> - Check regmap_read()'s return valure. (Sashiko AI bot)
>
> v2:
> - Collect Frank's R-b tag.
> ---
> drivers/gpu/drm/imx/dc/dc-ed.c | 29 +++++++++++++++++++++++++++++
> drivers/gpu/drm/imx/dc/dc-pe.h | 1 +
> 2 files changed, 30 insertions(+)
>
> diff --git a/drivers/gpu/drm/imx/dc/dc-ed.c b/drivers/gpu/drm/imx/dc/dc-ed.c
> index de1b71315eab..67163dca1363 100644
> --- a/drivers/gpu/drm/imx/dc/dc-ed.c
> +++ b/drivers/gpu/drm/imx/dc/dc-ed.c
> @@ -149,6 +149,35 @@ void dc_ed_pec_src_sel(struct dc_ed *ed, enum dc_link_id src)
> }
> }
>
> +int dc_ed_pec_src_sel_get(struct dc_ed *ed, enum dc_link_id *src)
> +{
> + u32 val;
> + int ret;
> +
> + ret = regmap_read(ed->reg_pec, PIXENGCFG_DYNAMIC, &val);
> + if (ret)
> + return -EINVAL;
Shouldn't you return ret here instead? With that fixed:
Reviewed-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
Best regards
Alexander
> +
> + switch (val) {
> + case LINK_ID_NONE:
> + case LINK_ID_CONSTFRAME0:
> + case LINK_ID_CONSTFRAME4:
> + case LINK_ID_CONSTFRAME1:
> + case LINK_ID_CONSTFRAME5:
> + case LINK_ID_FETCHWARP2:
> + case LINK_ID_FETCHLAYER0:
> + case LINK_ID_LAYERBLEND0:
> + case LINK_ID_LAYERBLEND1:
> + case LINK_ID_LAYERBLEND2:
> + case LINK_ID_LAYERBLEND3:
> + *src = val;
> + dev_dbg(ed->dev, "get source selection: 0x%02x\n", val);
> + return 0;
> + default:
> + return -EINVAL;
> + }
> +}
> +
> void dc_ed_pec_sync_trigger(struct dc_ed *ed)
> {
> regmap_write(ed->reg_pec, PIXENGCFG_TRIGGER, SYNC_TRIGGER);
> diff --git a/drivers/gpu/drm/imx/dc/dc-pe.h b/drivers/gpu/drm/imx/dc/dc-pe.h
> index f5e01a6eb9e9..0b81dc6b251c 100644
> --- a/drivers/gpu/drm/imx/dc/dc-pe.h
> +++ b/drivers/gpu/drm/imx/dc/dc-pe.h
> @@ -85,6 +85,7 @@ void dc_cf_init(struct dc_cf *cf);
>
> /* External Destination Unit */
> void dc_ed_pec_src_sel(struct dc_ed *ed, enum dc_link_id src);
> +int dc_ed_pec_src_sel_get(struct dc_ed *ed, enum dc_link_id *src);
> void dc_ed_pec_sync_trigger(struct dc_ed *ed);
> void dc_ed_init(struct dc_ed *ed);
>
>
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/