[PATCH v6 5/9] drm/imx: Add support for i.MX94 DCIF

Luca Ceresoli luca.ceresoli at bootlin.com
Tue Nov 11 07:34:39 PST 2025


On Mon Nov 3, 2025 at 4:30 PM CET, Laurentiu Palcu wrote:
> From: Sandor Yu <sandor.yu at nxp.com>
>
> The i.MX94 Display Control Interface features:
>  * Up to maximum 3 layers of alpha blending:
>     - 1 background layer(Layer 0);
>     - 1 foreground layer(Layer 1);
>     - A programmable constant color behind the background layer;
>  * Each layer supports:
>     - programmable plane size;
>     - programmable background color;
>     - embedded alpha and global alpha;
>  * Data output with CRC checksum for 4 programmable regions;
>
> Signed-off-by: Sandor Yu <sandor.yu at nxp.com>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu at oss.nxp.com>

[...]

> +static struct drm_bridge *dcif_crtc_get_bridge(struct drm_crtc *crtc,
> +					       struct drm_crtc_state *crtc_state)
> +{
> +	struct drm_connector_state *conn_state;
> +	struct drm_encoder *encoder;
> +	struct drm_connector *conn;
> +	struct drm_bridge *bridge;
> +	int i;
> +
> +	for_each_new_connector_in_state(crtc_state->state, conn, conn_state, i) {
> +		if (crtc != conn_state->crtc)
> +			continue;
> +
> +		encoder = conn_state->best_encoder;
> +
> +		bridge = drm_bridge_chain_get_first_bridge(encoder);
> +		if (bridge)
> +			return bridge;
> +	}
> +
> +	return NULL;
> +}
> +
> +static void dcif_crtc_query_output_bus_format(struct drm_crtc *crtc,
> +					      struct drm_crtc_state *crtc_state)
> +{
> +	struct dcif_crtc_state *dcif_state = to_dcif_crtc_state(crtc_state);
> +	struct drm_bridge *bridge __free(drm_bridge_put) = NULL;
> +	struct drm_bridge_state *bridge_state;
> +
> +	dcif_state->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
> +	dcif_state->bus_flags = 0;
> +
> +	bridge = dcif_crtc_get_bridge(crtc, crtc_state);
> +	if (!bridge)
> +		return;
> +
> +	bridge_state = drm_atomic_get_new_bridge_state(crtc_state->state, bridge);
> +	if (!bridge_state)
> +		return;
> +
> +	dcif_state->bus_format = bridge_state->input_bus_cfg.format;
> +	dcif_state->bus_flags = bridge_state->input_bus_cfg.flags;
> +}

I haven't reviewed the entire patch in detail, but the refcounting is
correct now:

Reviewed-by: Luca Ceresoli <luca.ceresoli at bootlin.com> # bridge refcounting

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list