public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: Jonas Karlman <jonas@kwiboo.se>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Christian Hewitt <christianshewitt@gmail.com>,
	Diederik de Haas <diederik@cknow-tech.com>,
	"linux-rockchip@lists.infradead.org"
	<linux-rockchip@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 12/13] drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update()
Date: Wed, 29 Apr 2026 11:46:47 +0200	[thread overview]
Message-ID: <t6tzNvxITwKmJ_hq7-0DLA@collabora.com> (raw)
In-Reply-To: <4f69e6f2-fb26-4b41-b1a7-d6f16f0191bc@kwiboo.se>

On Tuesday, 28 April 2026 23:47:40 Central European Summer Time Jonas Karlman wrote:
> Hi Nicolas,
> 
> On 4/28/2026 1:53 PM, Nicolas Frattaroli wrote:
> > On Friday, 3 April 2026 20:52:58 Central European Summer Time 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.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >> ---
> >> v3: Reworked 'Update EDID during hotplug processing' patch
> >> ---
> >>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 24 +++++++++++++----------
> >>  1 file changed, 14 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> >> index 0d42fdf9a386..5b5654ef6015 100644
> >> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> >> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> >> @@ -2474,33 +2474,36 @@ dw_hdmi_connector_status_update(struct drm_connector *connector,
> >>  	struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector);
> >>  	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(connector, status);
> >>  
> >>  	return status;
> >>  }
> >>  
> >>  static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
> >>  {
> >> -	dw_hdmi_connector_status_update(connector, connector->status);
> >> -
> >>  	return drm_edid_connector_add_modes(connector);
> >>  }
> > 
> > Are we absolutely sure status_update is called before this, so that the
> > EDID doesn't need to be re-read? E.g. drm_connector_helper_get_modes
> > does do an EDID read beforehand.
> 
> With the change to re-read EDID at .detect() we should not need to
> re-read EDID at .get_modes(). This also closely match how the bridge
> connector handle EDID update at .detect() and not .get_modes() for hdmi
> bridges.
> 
> At least following call paths should ensure EDID have been re-read:
> 
> drm_helper_probe_single_connector_modes():
>  -> connector->funcs->force()
>     -> dw_hdmi_connector_force()
>        -> dw_hdmi_connector_status_update()
>           -> drm_edid_connector_update()             <<-- here
>  -> drm_helper_probe_detect()
>     -> detect_connector_status()
>        -> connector->funcs->detect();
>           -> dw_hdmi_connector_detect()
>              -> dw_hdmi_connector_status_update()
>                 -> drm_edid_connector_update()       <<-- or here
>  -> drm_helper_probe_get_modes()
>     -> connector_funcs->get_modes()
>        -> dw_hdmi_connector_get_modes()              <<-- now updated
> 
> drm_helper_hpd_irq_event():
>  -> detect_connector_status()
>     -> connector->funcs->detect();
>        -> dw_hdmi_connector_detect()
>           -> dw_hdmi_connector_status_update()
>              -> drm_edid_connector_update()          <<-- also after HPD
> 
> > Speaking of which: if we had connector->ddc set, we could just use
> > drm_connector_helper_get_modes for this callback. But maybe it's not
> > worth spending the time refactoring the resource handling around
> > hdmi->ddc when the eventual goal is to refactor this all into using
> > a bridge connector anyway.
> 
> Correct, hopefully all connector related functions can be dropped from
> dw-hdmi in a near future when dw-hdmi is converted to a hdmi bridge.
> 
> I currently have a work-in-progress snapshot at [1] where dw-hdmi have
> been converted to a hdmi bridge and a bridge connector is used instead.
> 
> The changes in this series only aim to align dw-hdmi to the hdmi bridge
> where possible to reduce any functional change in such future series.
> 
> I will likely keep this as-is in a v4 unless there is some objections.

With that explanation, I'm on board with this. So:

Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

Kind regards,
Nicolas Frattaroli

> 
> [1] https://github.com/Kwiboo/linux-rockchip/commits/next-20260427-rk-hdmi-v2/
> 
> Regards,
> Jonas
> 
> >>  
> >> @@ -2530,14 +2533,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(connector, connector->status);
> >>  }
> >>  
> >>  static const struct drm_connector_funcs dw_hdmi_connector_funcs = {
> >>
> > 
> > 
> > 
> > 
> 
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2026-04-29  9:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 18:52 [PATCH v3 00/13] drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 01/13] drm: bridge: dw_hdmi: Disable scrambler feature when not supported Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 02/13] drm: bridge: dw_hdmi: Only notify connected status on HPD interrupt Jonas Karlman
2026-04-27 18:04   ` Nicolas Frattaroli
2026-04-03 18:52 ` [PATCH v3 03/13] drm: bridge: dw_hdmi: Call poweron/poweroff from atomic enable/disable Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 04/13] drm: bridge: dw_hdmi: Use passed mode instead of stored previous_mode Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 05/13] drm: bridge: dw_hdmi: Fold poweron and setup functions Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 06/13] drm: bridge: dw_hdmi: Remove previous_mode and mode_set Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 07/13] drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 08/13] drm: bridge: dw_hdmi: Remove cec_notifier_mutex Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 09/13] drm: bridge: dw_hdmi: Use delayed_work to debounce hotplug event Jonas Karlman
2026-04-27 18:27   ` Nicolas Frattaroli
2026-04-28 22:12     ` Jonas Karlman
2026-04-28 12:38   ` Dmitry Baryshkov
2026-04-28 19:34     ` Jonas Karlman
2026-04-29  1:57       ` Dmitry Baryshkov
2026-04-03 18:52 ` [PATCH v3 10/13] drm: bridge: dw_hdmi: Use drm_connector_helper_hpd_irq_event() Jonas Karlman
2026-04-28 12:40   ` Dmitry Baryshkov
2026-04-28 18:59     ` Jonas Karlman
2026-04-03 18:52 ` [PATCH v3 11/13] drm: bridge: dw_hdmi: Extract dw_hdmi_connector_status_update() Jonas Karlman
2026-04-28 11:42   ` Nicolas Frattaroli
2026-04-03 18:52 ` [PATCH v3 12/13] drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update() Jonas Karlman
2026-04-28 11:53   ` Nicolas Frattaroli
2026-04-28 21:47     ` Jonas Karlman
2026-04-29  9:46       ` Nicolas Frattaroli [this message]
2026-04-28 12:42   ` Dmitry Baryshkov
2026-04-28 18:53     ` Jonas Karlman
2026-04-29  1:54       ` Dmitry Baryshkov
2026-04-03 18:52 ` [PATCH v3 13/13] drm: bridge: dw_hdmi: Use display_info is_hdmi and has_audio Jonas Karlman
2026-04-28 12:01   ` Nicolas Frattaroli
2026-04-12 15:52 ` [PATCH v3 00/13] drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup Bob McChesney
2026-04-12 16:36 ` Bob McChesney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=t6tzNvxITwKmJ_hq7-0DLA@collabora.com \
    --to=nicolas.frattaroli@collabora.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=christianshewitt@gmail.com \
    --cc=diederik@cknow-tech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox