Re: [PATCH v10 22/69] drm/display: hdmi-state-helper: Sync SCDC state on hotplug

Maxime Ripard <[email protected]>
Newsgroups org.infradead.lists.linux-rockchip,dev.linux.lists.linux-sunxi,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <20260820-accomplished-curly-bandicoot-cc36ba@houat>
On Fri, Jul 31, 2026 at 07:19:29PM +0300, Cristian Ciocaltea wrote:
> drm_atomic_helper_connector_hdmi_hotplug() does not currently
> synchronize SCDC status on hotplug events, leaving the scrambler state
> potentially inconsistent after (re)connect.
> 
> Hook drm_connector_hdmi_sync_scdc() into both the connect and disconnect
> paths, replacing the existing TODOs around missing scrambler handling.
> 
> Tested-by: Maud Spierings <[email protected]>
> Tested-by: Diederik de Haas <[email protected]>  # NanoPC-T6 LTS, Rock 5B
> Signed-off-by: Cristian Ciocaltea <[email protected]>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 4a93c279c9a7..3377ea936120 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -1205,13 +1205,16 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>  					enum drm_connector_status status)
>  {
>  	const struct drm_edid *drm_edid;
> +	int ret = 0;
>  
>  	if (status == connector_status_disconnected) {
> -		// TODO: also handle scramber, HDMI sink disconnected.
> -		drm_connector_hdmi_audio_plugged_notify(connector, false);
> -		drm_edid_connector_update(connector, NULL);
> -		drm_connector_cec_phys_addr_invalidate(connector);
> -		return 0;
> +		ret = drm_connector_hdmi_sync_scdc(connector, false, ctx);
> +		if (ret != -EDEADLK) {
> +			drm_connector_hdmi_audio_plugged_notify(connector, false);
> +			drm_edid_connector_update(connector, NULL);
> +			drm_connector_cec_phys_addr_invalidate(connector);
> +		}

If there's a deadlock, shouldn't we restart the whole sequence there?
Ie, we should return ret all the time anyway? And if we do that, we
should return ret for drm_edid_connector_update() too.

Either way, a comment on why we're doing it this way would be nice.

Maxime

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
signature.asc (application/pgp-signature, 273 B)
-----BEGIN PGP SIGNATURE-----

iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaobAewAKCRAnX84Zoj2+
dsmXAX9ZDU9lPiTQM27i5k7mRJDVntMtGwshaDMSDOnYE2AAllfcjI+ZdG0n6mHZ
R8zCkiIBfRWAvboi0YPym8+kt7BmG5tIQeVj0csBP/DfUERW2sf6oKOJGu9EZTzz
Mx2ECE+5xg==
=ZQWH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.