All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ast: Return value when do not get edid
@ 2021-07-16  9:55 ainux.wang
  2021-07-16 12:00 ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: ainux.wang @ 2021-07-16  9:55 UTC (permalink / raw)
  To: airlied, tzimmermann, airlied, daniel, ainux.wang
  Cc: sterlingteng, chenhuacai, dri-devel

From: "Ainux.Wang" <ainux.wang@gmail.com>

There is should a status when do not get edid.

Signed-off-by: Ainux.Wang <ainux.wang@gmail.com>
---
 drivers/gpu/drm/ast/ast_mode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index e5996ae03c49..05df48b3d223 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
 		ret = drm_add_edid_modes(connector, edid);
 		kfree(edid);
 		return ret;
-	} else
+	} else {
 		drm_connector_update_edid_property(&ast_connector->base, NULL);
+		return -ENXIO;
+	}
 	return 0;
 }
 
-- 
2.18.1


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

* Re: [PATCH] drm/ast: Return value when do not get edid
  2021-07-16  9:55 [PATCH] drm/ast: Return value when do not get edid ainux.wang
@ 2021-07-16 12:00 ` Thomas Zimmermann
  2021-07-17  1:14   ` Ainux Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2021-07-16 12:00 UTC (permalink / raw)
  To: ainux.wang, airlied, airlied, daniel; +Cc: sterlingteng, chenhuacai, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1932 bytes --]

Hi

Am 16.07.21 um 11:55 schrieb ainux.wang@gmail.com:
> From: "Ainux.Wang" <ainux.wang@gmail.com>
> 
> There is should a status when do not get edid.

Well, not really.

So, the problem is that VGA is not hotplug-able. It's supposed to be 
connected when the computer gets switched on. And there's no interface 
for sensing the connection state.

But in practice, the cable can be attached/detached at any time. Reading 
out the EDID is the non-official way for detecting the connection state. 
You either get EDID data or garbage, where the latter is interpreted as 
'disconnected'.

But really old monitors (maybe mid-90s and before) don't provide EDID 
data. For those, DRM adds standard VGA modes IIRC. And they would likely 
be detected as 'disconnected'.

I'll merge your original patch '(r <= 0)' and anyone who's stuck with 
such an old monitor can probably specify a compatible EDID on the kernel 
command line.

(I'd like to hear other people's opinion about this TBH.)

Best regards
Thomas

> 
> Signed-off-by: Ainux.Wang <ainux.wang@gmail.com>
> ---
>   drivers/gpu/drm/ast/ast_mode.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index e5996ae03c49..05df48b3d223 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
>   		ret = drm_add_edid_modes(connector, edid);
>   		kfree(edid);
>   		return ret;
> -	} else
> +	} else {
>   		drm_connector_update_edid_property(&ast_connector->base, NULL);
> +		return -ENXIO;
> +	}
>   	return 0;
>   }
>   
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [PATCH] drm/ast: Return value when do not get edid
  2021-07-16 12:00 ` Thomas Zimmermann
@ 2021-07-17  1:14   ` Ainux Wang
  2021-07-20  9:09     ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: Ainux Wang @ 2021-07-17  1:14 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: airlied, teng sterling, Huacai Chen, dri-devel, airlied

Thomas Zimmermann <tzimmermann@suse.de> 于2021年7月16日周五 下午8:00写道:
>
> Hi
>
> Am 16.07.21 um 11:55 schrieb ainux.wang@gmail.com:
> > From: "Ainux.Wang" <ainux.wang@gmail.com>
> >
> > There is should a status when do not get edid.
>
> Well, not really.
>
> So, the problem is that VGA is not hotplug-able. It's supposed to be
> connected when the computer gets switched on. And there's no interface
> for sensing the connection state.
>
> But in practice, the cable can be attached/detached at any time. Reading
> out the EDID is the non-official way for detecting the connection state.
> You either get EDID data or garbage, where the latter is interpreted as
> 'disconnected'.
>
> But really old monitors (maybe mid-90s and before) don't provide EDID
> data. For those, DRM adds standard VGA modes IIRC. And they would likely
> be detected as 'disconnected'.
>
> I'll merge your original patch '(r <= 0)' and anyone who's stuck with
> such an old monitor can probably specify a compatible EDID on the kernel
> command line.
>
> (I'd like to hear other people's opinion about this TBH.)
>
> Best regards
> Thomas
>
Hi,
Thank you for your review and reply, and what is the ‘IIRC’, i do not
find it in the
kernel document.

Best regards
Ainux
> >
> > Signed-off-by: Ainux.Wang <ainux.wang@gmail.com>
> > ---
> >   drivers/gpu/drm/ast/ast_mode.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> > index e5996ae03c49..05df48b3d223 100644
> > --- a/drivers/gpu/drm/ast/ast_mode.c
> > +++ b/drivers/gpu/drm/ast/ast_mode.c
> > @@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
> >               ret = drm_add_edid_modes(connector, edid);
> >               kfree(edid);
> >               return ret;
> > -     } else
> > +     } else {
> >               drm_connector_update_edid_property(&ast_connector->base, NULL);
> > +             return -ENXIO;
> > +     }
> >       return 0;
> >   }
> >
> >
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
>

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

* Re: [PATCH] drm/ast: Return value when do not get edid
  2021-07-17  1:14   ` Ainux Wang
@ 2021-07-20  9:09     ` Thomas Zimmermann
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2021-07-20  9:09 UTC (permalink / raw)
  To: Ainux Wang; +Cc: airlied, teng sterling, Huacai Chen, dri-devel, airlied


[-- Attachment #1.1: Type: text/plain, Size: 2680 bytes --]



Am 17.07.21 um 03:14 schrieb Ainux Wang:
> Thomas Zimmermann <tzimmermann@suse.de> 于2021年7月16日周五 下午8:00写道:
>>
>> Hi
>>
>> Am 16.07.21 um 11:55 schrieb ainux.wang@gmail.com:
>>> From: "Ainux.Wang" <ainux.wang@gmail.com>
>>>
>>> There is should a status when do not get edid.
>>
>> Well, not really.
>>
>> So, the problem is that VGA is not hotplug-able. It's supposed to be
>> connected when the computer gets switched on. And there's no interface
>> for sensing the connection state.
>>
>> But in practice, the cable can be attached/detached at any time. Reading
>> out the EDID is the non-official way for detecting the connection state.
>> You either get EDID data or garbage, where the latter is interpreted as
>> 'disconnected'.
>>
>> But really old monitors (maybe mid-90s and before) don't provide EDID
>> data. For those, DRM adds standard VGA modes IIRC. And they would likely
>> be detected as 'disconnected'.
>>
>> I'll merge your original patch '(r <= 0)' and anyone who's stuck with
>> such an old monitor can probably specify a compatible EDID on the kernel
>> command line.
>>
>> (I'd like to hear other people's opinion about this TBH.)
>>
>> Best regards
>> Thomas
>>
> Hi,
> Thank you for your review and reply, and what is the ‘IIRC’, i do not

IIRC stands for 'if I remember correctly'

> find it in the
> kernel document.
> 
> Best regards
> Ainux
>>>
>>> Signed-off-by: Ainux.Wang <ainux.wang@gmail.com>
>>> ---
>>>    drivers/gpu/drm/ast/ast_mode.c | 4 +++-
>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
>>> index e5996ae03c49..05df48b3d223 100644
>>> --- a/drivers/gpu/drm/ast/ast_mode.c
>>> +++ b/drivers/gpu/drm/ast/ast_mode.c
>>> @@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
>>>                ret = drm_add_edid_modes(connector, edid);
>>>                kfree(edid);
>>>                return ret;
>>> -     } else
>>> +     } else {
>>>                drm_connector_update_edid_property(&ast_connector->base, NULL);
>>> +             return -ENXIO;
>>> +     }
>>>        return 0;
>>>    }
>>>
>>>
>>
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Maxfeldstr. 5, 90409 Nürnberg, Germany
>> (HRB 36809, AG Nürnberg)
>> Geschäftsführer: Felix Imendörffer
>>

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

end of thread, other threads:[~2021-07-20  9:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16  9:55 [PATCH] drm/ast: Return value when do not get edid ainux.wang
2021-07-16 12:00 ` Thomas Zimmermann
2021-07-17  1:14   ` Ainux Wang
2021-07-20  9:09     ` Thomas Zimmermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.