mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
@ 2025-01-10 22:04 Cristian Ciocaltea
  2025-01-13  9:16 ` Dmitry Baryshkov
  2025-01-13  9:35 ` Maxime Ripard
  0 siblings, 2 replies; 7+ messages in thread
From: Cristian Ciocaltea @ 2025-01-10 22:04 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Dmitry Baryshkov
  Cc: kernel, dri-devel, linux-kernel

The recently introduced hotplug event handler in the HDMI Connector
framework attempts to unconditionally read the EDID data, leading to a
bunch of non-harmful, yet quite annoying DDC/I2C related errors being
reported.

Ensure the operation is performed only for connectors having the status
connected or unknown.

Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
 	const struct drm_edid *drm_edid;
 
 	if (status == connector_status_disconnected) {
+		drm_edid_connector_update(connector, NULL);
 		// TODO: also handle CEC and scramber, HDMI sink disconnected.
 		drm_connector_hdmi_audio_plugged_notify(connector, false);
+		return;
 	}
 
 	if (connector->hdmi.funcs->read_edid)

---
base-commit: 1854df7087be70ad54e24b2e308d7558ebea9f27
change-id: 20250110-hdmi-conn-edid-read-fix-178513c2b7ea


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-10 22:04 [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors Cristian Ciocaltea
@ 2025-01-13  9:16 ` Dmitry Baryshkov
  2025-01-13 11:39   ` Cristian Ciocaltea
  2025-01-13  9:35 ` Maxime Ripard
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-01-13  9:16 UTC (permalink / raw)
  To: Cristian Ciocaltea
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, kernel, dri-devel, linux-kernel

On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
> The recently introduced hotplug event handler in the HDMI Connector
> framework attempts to unconditionally read the EDID data, leading to a
> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
> reported.
> 
> Ensure the operation is performed only for connectors having the status
> connected or unknown.
> 
> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>  	const struct drm_edid *drm_edid;
>  
>  	if (status == connector_status_disconnected) {
> +		drm_edid_connector_update(connector, NULL);
>  		// TODO: also handle CEC and scramber, HDMI sink disconnected.
>  		drm_connector_hdmi_audio_plugged_notify(connector, false);
> +		return;

I think, it should be other way around: plugged_notify before
drm_edid_connector_update(). At least that would follow current logic of
the function.

>  	}
>  
>  	if (connector->hdmi.funcs->read_edid)
> 
> ---
> base-commit: 1854df7087be70ad54e24b2e308d7558ebea9f27
> change-id: 20250110-hdmi-conn-edid-read-fix-178513c2b7ea
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-10 22:04 [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors Cristian Ciocaltea
  2025-01-13  9:16 ` Dmitry Baryshkov
@ 2025-01-13  9:35 ` Maxime Ripard
  2025-01-13 12:00   ` Cristian Ciocaltea
  1 sibling, 1 reply; 7+ messages in thread
From: Maxime Ripard @ 2025-01-13  9:35 UTC (permalink / raw)
  To: Cristian Ciocaltea
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, Dmitry Baryshkov, kernel, dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
> The recently introduced hotplug event handler in the HDMI Connector
> framework attempts to unconditionally read the EDID data, leading to a
> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
> reported.
> 
> Ensure the operation is performed only for connectors having the status
> connected or unknown.
> 
> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>  	const struct drm_edid *drm_edid;
>  
>  	if (status == connector_status_disconnected) {
> +		drm_edid_connector_update(connector, NULL);

Why is this needed? It's not mentionned in your commit log.

>  		// TODO: also handle CEC and scramber, HDMI sink disconnected.
>  		drm_connector_hdmi_audio_plugged_notify(connector, false);
> +		return;
>  	}
>  
>  	if (connector->hdmi.funcs->read_edid)

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-13  9:16 ` Dmitry Baryshkov
@ 2025-01-13 11:39   ` Cristian Ciocaltea
  0 siblings, 0 replies; 7+ messages in thread
From: Cristian Ciocaltea @ 2025-01-13 11:39 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, kernel, dri-devel, linux-kernel

Hi Dmitry,

On 1/13/25 11:16 AM, Dmitry Baryshkov wrote:
> On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
>> The recently introduced hotplug event handler in the HDMI Connector
>> framework attempts to unconditionally read the EDID data, leading to a
>> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
>> reported.
>>
>> Ensure the operation is performed only for connectors having the status
>> connected or unknown.
>>
>> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
>> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>>  	const struct drm_edid *drm_edid;
>>  
>>  	if (status == connector_status_disconnected) {
>> +		drm_edid_connector_update(connector, NULL);
>>  		// TODO: also handle CEC and scramber, HDMI sink disconnected.
>>  		drm_connector_hdmi_audio_plugged_notify(connector, false);
>> +		return;
> 
> I think, it should be other way around: plugged_notify before
> drm_edid_connector_update(). At least that would follow current logic of
> the function.

Yeah, I wasn't really sure about the order here. Will get this fixed in v2.

Thanks,
Cristian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-13  9:35 ` Maxime Ripard
@ 2025-01-13 12:00   ` Cristian Ciocaltea
  2025-01-13 12:06     ` Dmitry Baryshkov
  0 siblings, 1 reply; 7+ messages in thread
From: Cristian Ciocaltea @ 2025-01-13 12:00 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, Dmitry Baryshkov, kernel, dri-devel, linux-kernel

Hi Maxime,

On 1/13/25 11:35 AM, Maxime Ripard wrote:
> On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
>> The recently introduced hotplug event handler in the HDMI Connector
>> framework attempts to unconditionally read the EDID data, leading to a
>> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
>> reported.
>>
>> Ensure the operation is performed only for connectors having the status
>> connected or unknown.
>>
>> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
>> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>>  	const struct drm_edid *drm_edid;
>>  
>>  	if (status == connector_status_disconnected) {
>> +		drm_edid_connector_update(connector, NULL);
> 
> Why is this needed? It's not mentionned in your commit log.

The original implementation has it after reading the EDID, but I'm not
sure if we need the explicit reset in this case.

I was going to submit a new revision switching the order, as Dmitry
suggested, or should we simply drop it?

Thanks,
Cristian

> 
>>  		// TODO: also handle CEC and scramber, HDMI sink disconnected.
>>  		drm_connector_hdmi_audio_plugged_notify(connector, false);
>> +		return;
>>  	}
>>  
>>  	if (connector->hdmi.funcs->read_edid)
> 
> Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-13 12:00   ` Cristian Ciocaltea
@ 2025-01-13 12:06     ` Dmitry Baryshkov
  2025-01-13 12:13       ` Cristian Ciocaltea
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-01-13 12:06 UTC (permalink / raw)
  To: Cristian Ciocaltea
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Simona Vetter, kernel, dri-devel, linux-kernel

On Mon, 13 Jan 2025 at 14:00, Cristian Ciocaltea
<cristian.ciocaltea@collabora.com> wrote:
>
> Hi Maxime,
>
> On 1/13/25 11:35 AM, Maxime Ripard wrote:
> > On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
> >> The recently introduced hotplug event handler in the HDMI Connector
> >> framework attempts to unconditionally read the EDID data, leading to a
> >> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
> >> reported.
> >>
> >> Ensure the operation is performed only for connectors having the status
> >> connected or unknown.
> >>
> >> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
> >> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> >> ---
> >>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> >> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
> >> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> >> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> >> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
> >>      const struct drm_edid *drm_edid;
> >>
> >>      if (status == connector_status_disconnected) {
> >> +            drm_edid_connector_update(connector, NULL);
> >
> > Why is this needed? It's not mentionned in your commit log.
>
> The original implementation has it after reading the EDID, but I'm not
> sure if we need the explicit reset in this case.
>
> I was going to submit a new revision switching the order, as Dmitry
> suggested, or should we simply drop it?

If the EDID is not available, it needs to be reset.

>
> Thanks,
> Cristian
>
> >
> >>              // TODO: also handle CEC and scramber, HDMI sink disconnected.
> >>              drm_connector_hdmi_audio_plugged_notify(connector, false);
> >> +            return;
> >>      }
> >>
> >>      if (connector->hdmi.funcs->read_edid)
> >
> > Maxime
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors
  2025-01-13 12:06     ` Dmitry Baryshkov
@ 2025-01-13 12:13       ` Cristian Ciocaltea
  0 siblings, 0 replies; 7+ messages in thread
From: Cristian Ciocaltea @ 2025-01-13 12:13 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Simona Vetter, kernel, dri-devel, linux-kernel

On 1/13/25 2:06 PM, Dmitry Baryshkov wrote:
> On Mon, 13 Jan 2025 at 14:00, Cristian Ciocaltea
> <cristian.ciocaltea@collabora.com> wrote:
>>
>> Hi Maxime,
>>
>> On 1/13/25 11:35 AM, Maxime Ripard wrote:
>>> On Sat, Jan 11, 2025 at 12:04:09AM +0200, Cristian Ciocaltea wrote:
>>>> The recently introduced hotplug event handler in the HDMI Connector
>>>> framework attempts to unconditionally read the EDID data, leading to a
>>>> bunch of non-harmful, yet quite annoying DDC/I2C related errors being
>>>> reported.
>>>>
>>>> Ensure the operation is performed only for connectors having the status
>>>> connected or unknown.
>>>>
>>>> Fixes: ab716b74dc9d ("drm/display/hdmi: implement hotplug functions")
>>>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>>>> ---
>>>>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
>>>>  1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>>>> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..8e4b30e09b53b84cfd36199d56db3221a00085b0 100644
>>>> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>>>> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>>>> @@ -786,8 +786,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>>>>      const struct drm_edid *drm_edid;
>>>>
>>>>      if (status == connector_status_disconnected) {
>>>> +            drm_edid_connector_update(connector, NULL);
>>>
>>> Why is this needed? It's not mentionned in your commit log.
>>
>> The original implementation has it after reading the EDID, but I'm not
>> sure if we need the explicit reset in this case.
>>
>> I was going to submit a new revision switching the order, as Dmitry
>> suggested, or should we simply drop it?
> 
> If the EDID is not available, it needs to be reset.

Thanks for the confirmation - I will mention this in the commit description.

Regards,
Cristian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-13 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-10 22:04 [PATCH] drm/display: hdmi: Do not read EDID on disconnected connectors Cristian Ciocaltea
2025-01-13  9:16 ` Dmitry Baryshkov
2025-01-13 11:39   ` Cristian Ciocaltea
2025-01-13  9:35 ` Maxime Ripard
2025-01-13 12:00   ` Cristian Ciocaltea
2025-01-13 12:06     ` Dmitry Baryshkov
2025-01-13 12:13       ` Cristian Ciocaltea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®