On 18/05/2026 20:01, Jonas Karlman wrote:
> Update connector EDID and CEC phys addr from detect and force funcs to
> ensure that userspace always have access to latest read EDID after a
> sink use a HPD low voltage pulse to indicate that EDID has changed.
> 
> With EDID being updated in detect and force funcs, there should no
> longer be a need to re-read EDID in get_modes funcs, so drop it.
> 
> This change make the dw-hdmi connector work more closely like the bridge
> connector does with a hdmi bridge.
> 
> Reviewed-by: Nicolas Frattaroli <[email protected]>
> Tested-by: Diederik de Haas <[email protected]>  # Rock64, RockPro64, 
> Quartz64-B
> Signed-off-by: Jonas Karlman <[email protected]>

Acked-by: Hans Verkuil <[email protected]>

Regards,

        Hans

> ---
> v7: No change
> v6: Pass struct dw_hdmi as a parameter,
>     Collect t-b tag
> v5: No change
> v4: Move last_connector_result assign in force ops to this patch,
>     Collect r-b tag
> v3: Reworked 'Update EDID during hotplug processing' patch
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 28 ++++++++++++-----------
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index a056e147731b..a4ecf830103d 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2473,36 +2473,36 @@ dw_hdmi_connector_status_update(struct dw_hdmi *hdmi,
>  {
>       const struct drm_edid *drm_edid;
>  
> +     if (status == connector_status_disconnected) {
> +             drm_edid_connector_update(connector, NULL);
> +             cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);
> +             return;
> +     }
> +
>       drm_edid = dw_hdmi_edid_read(hdmi, connector);
>       drm_edid_connector_update(connector, drm_edid);
>       drm_edid_free(drm_edid);
>  
> -     cec_notifier_set_phys_addr(hdmi->cec_notifier,
> -                                
> connector->display_info.source_physical_address);
> +     if (status == connector_status_connected)
> +             cec_notifier_set_phys_addr(hdmi->cec_notifier,
> +                             
> connector->display_info.source_physical_address);
>  }
>  
>  static enum drm_connector_status
>  dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
>  {
> -     struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
> -                                          connector);
> +     struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, 
> connector);
>       enum drm_connector_status status;
>  
>       status = dw_hdmi_detect(hdmi);
>  
> -     if (status == connector_status_disconnected)
> -             cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);
> +     dw_hdmi_connector_status_update(hdmi, connector, status);
>  
>       return status;
>  }
>  
>  static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
>  {
> -     struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
> -                                          connector);
> -
> -     dw_hdmi_connector_status_update(hdmi, connector, connector->status);
> -
>       return drm_edid_connector_add_modes(connector);
>  }
>  
> @@ -2532,13 +2532,15 @@ static int dw_hdmi_connector_atomic_check(struct 
> drm_connector *connector,
>  
>  static void dw_hdmi_connector_force(struct drm_connector *connector)
>  {
> -     struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
> -                                          connector);
> +     struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, 
> connector);
>  
>       mutex_lock(&hdmi->mutex);
>       hdmi->force = connector->force;
> +     hdmi->last_connector_result = connector->status;
>       dw_hdmi_update_phy_mask(hdmi);
>       mutex_unlock(&hdmi->mutex);
> +
> +     dw_hdmi_connector_status_update(hdmi, connector, connector->status);
>  }
>  
>  static void dw_hdmi_connector_destroy(struct drm_connector *connector)

Reply via email to