Skip to contentSkip to conversation

drm/ast: Return value when do not get edid

PATCH In review [email protected] 2 participants 4 messages Jul 16, 2021 – Jul 20, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ast: Return value when do not get edid

From: "Ainux.Wang" <[email protected]>

There is should a status when do not get edid.

---
 drivers/gpu/drm/ast/ast_mode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +3 -1
index e5996ae03c49..05df48b3d223 100644
@@ -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;
 }
 
Signature · 1 line
2.18.1
#1 lore raw

Hi

Am 16.07.21 um 11:55 schrieb [email protected]:

Quoted 3 lines

From: "Ainux.Wang" <[email protected]>

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

Quoted 23 lines
---
  drivers/gpu/drm/ast/ast_mode.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +3 -1
index e5996ae03c49..05df48b3d223 100644
@@ -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;
  }
 
Signature · 6 lines
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
author
#2 lore raw
Quoted 23 lines · Thomas Zimmermann <[email protected]> 于2021年7月16日周五 下午8:00写道:

Hi

Am 16.07.21 um 11:55 schrieb [email protected]:

Quoted 3 lines

From: "Ainux.Wang" <[email protected]>

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'.

Quoted 9 lines

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

Quoted 32 lines
Quoted 13 lines
---
  drivers/gpu/drm/ast/ast_mode.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +0 -0
index e5996ae03c49..05df48b3d223 100644
@@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
              ret = drm_add_edid_modes(connector, edid);

drivers/gpu/drm/ast/ast_mode.c static int ast_get_modes(struct drm_connector *connector) · line 1240

Quoted 10 lines
drivers/gpu/drm/ast/ast_mode.c +3 -1
              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

#3 lore raw

Am 17.07.21 um 03:14 schrieb Ainux Wang:

Quoted 28 lines
Quoted 27 lines · Thomas Zimmermann <[email protected]> 于2021年7月16日周五 下午8:00写道:

Hi

Am 16.07.21 um 11:55 schrieb [email protected]:

Quoted 3 lines

From: "Ainux.Wang" <[email protected]>

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.

Quoted 7 lines
Quoted 5 lines

(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'

Quoted 37 lines

find it in the
kernel document.

Best regards
Ainux

Quoted 32 lines
Quoted 13 lines
---
   drivers/gpu/drm/ast/ast_mode.c | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_mode.c +0 -0
index e5996ae03c49..05df48b3d223 100644
@@ -1231,8 +1231,10 @@ static int ast_get_modes(struct drm_connector *connector)
               ret = drm_add_edid_modes(connector, edid);

drivers/gpu/drm/ast/ast_mode.c static int ast_get_modes(struct drm_connector *connector) · line 1240

Quoted 10 lines
drivers/gpu/drm/ast/ast_mode.c +3 -1
               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

Signature · 6 lines
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