[Intel-gfx] [PATCH v6 2/3] drm/bridge_connector: stop filtering events in drm_bridge_connector_hpd_cb()

Janne Grunau j at jannau.net
Fri Jul 28 18:31:35 UTC 2023


On 2023-07-09 23:25:10 +0300, Dmitry Baryshkov wrote:
> In some cases the bridge drivers would like to receive hotplug events
> even in the case new status is equal to the old status. In the DP case
> this is used to deliver "attention" messages to the DP host. Stop
> filtering the events in the drm_bridge_connector_hpd_cb() and let
> drivers decide whether they would like to receive the event or not.

Worth mentioning in the commit message that all current bridges which 
set .hpd_notify appear to be safe w.r.t multiple calls with the same 
status. meson_encoder_hdmi.c will do unnecessary work when called 
repeatedly with status connected. Not sure if it is worth adressing 
since I don't expect multiple calls with connector_status_connected to 
occur for this particular bridge.

Reviewed-By: Janne Grunau <j at jannau.net>

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
> ---
>  drivers/gpu/drm/drm_bridge_connector.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 19ae4a177ac3..84d8d310ef04 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -113,16 +113,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>  	struct drm_bridge_connector *drm_bridge_connector = cb_data;
>  	struct drm_connector *connector = &drm_bridge_connector->base;
>  	struct drm_device *dev = connector->dev;
> -	enum drm_connector_status old_status;
>  
>  	mutex_lock(&dev->mode_config.mutex);
> -	old_status = connector->status;
>  	connector->status = status;
>  	mutex_unlock(&dev->mode_config.mutex);
>  
> -	if (old_status == status)
> -		return;
> -
>  	drm_bridge_connector_hpd_notify(connector, status);
>  
>  	drm_kms_helper_hotplug_event(dev);
> -- 
> 2.39.2
> 


More information about the Intel-gfx mailing list