Re: [PATCH v5 04/16] drm/atomic: Introduce helper to lookup connector by encoder
From: Herve Codina
Date: Thu Mar 06 2025 - 03:21:15 EST
Hi Maxime,
Hi Maxime,
On Tue, 04 Mar 2025 12:10:47 +0100
Maxime Ripard <mripard@xxxxxxxxxx> wrote:
> With the bridges switching over to drm_bridge_connector, the direct
> association between a bridge driver and its connector was lost.
>
> This is mitigated for atomic bridge drivers by the fact you can access
> the encoder, and then call drm_atomic_get_old_connector_for_encoder() or
> drm_atomic_get_new_connector_for_encoder() with drm_atomic_state.
>
> This was also made easier by providing drm_atomic_state directly to all
> atomic hooks bridges can implement.
>
> However, bridge drivers don't have a way to access drm_atomic_state
> outside of the modeset path, like from the hotplug interrupt path or any
> interrupt handler.
>
> Let's introduce a function to retrieve the connector currently assigned
> to an encoder, without using drm_atomic_state, to make these drivers'
> life easier.
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
> Co-developed-by: Simona Vetter <simona.vetter@xxxxxxxx>
> Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
> ---
> drivers/gpu/drm/drm_atomic.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
> include/drm/drm_atomic.h | 3 +++
> 2 files changed, 48 insertions(+)
>
Tested the drm_atomic_get_connector_for_encoder() in the context of the
ti-sn65dsi83 driver recovery process (later modification in this series).
Tested-by: Herve Codina <herve.codina@xxxxxxxxxxx>
Best regards,
Hervé