[PATCH v4 2/2] drm: rcar-du: Add RZ/G2L DSI driver

Sam Ravnborg sam at ravnborg.org
Fri Jul 22 20:01:34 UTC 2022


Hi Biju,

driver looks good - you can add my:
Acked-by: Sam Ravnborg <sam at ravnborg.org>


I have one general question - that is not related to this driver, but is
directed to the bridge people on this mail.

> +static void rzg2l_mipi_dsi_atomic_enable(struct drm_bridge *bridge,
> +					 struct drm_bridge_state *old_bridge_state)
> +{
> +	struct drm_atomic_state *state = old_bridge_state->base.state;
> +	struct rzg2l_mipi_dsi *dsi = bridge_to_rzg2l_mipi_dsi(bridge);
> +	const struct drm_display_mode *mode;
> +	struct drm_connector *connector;
> +	struct drm_crtc *crtc;
> +	int ret;
> +
> +	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
> +	crtc = drm_atomic_get_new_connector_state(state, connector)->crtc;
> +	mode = &drm_atomic_get_new_crtc_state(state, crtc)->adjusted_mode;

It is relative often we see the need to access the new crtc_state in
the atomic_enable() operation. Could we add it as a parameter to
atomic_enable() and fish it out in the caller?
That would save some boilerplate code.

I once had a helper cooked up for the above and could dig it up
again - but the parameter idea seems better?!?

	Sam


More information about the dri-devel mailing list