drm/edid: Make EDID header fixup threshold configurable
Subsystems (3)
PATCH 1/2 drm/edid: Make EDID header fixup threshold configurable
--- Documentation/kernel-parameters.txt | 4 ++++ drivers/gpu/drm/drm_edid.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletions(-)
Documentation/kernel-parameters.txt +4 -0
@@ -713,6 +713,10 @@ and is between 256 and 4096 characters. It is defined in the file edd= [EDD] Format: {"off" | "on" | "skip[mbr]"} + edid_threshold=<int> [DRM] + Set the minimum number of bytes of an EDID header + that must be valid, out of 8. The default is 6. + eisa_irq_edge= [PARISC,HW] See header of drivers/parisc/eisa.c.
drivers/gpu/drm/drm_edid.c +4 -1
@@ -62,6 +62,9 @@/* use +hsync +vsync for detailed mode */ #define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6) +static unsigned int edid_threshold =6 ; +MODULE_PARM_DESC (edid_threshold,"EDID header fixup threshold (default: 6)" ); +module_param_named (edid_threshold, edid_threshold, int,0600 );#define LEVEL_DMT 0#define LEVEL_GTF 1
@@ -135,7 +138,7 @@ drm_edid_block_valid(u8 *raw_edid) score++;if (score ==8 ) ; -else if (score >=6 ) { +else if (score >= edid_threshold) {DRM_DEBUG ("Fixing EDID header, your hardware may be failing\n" );memcpy (raw_edid, edid_header,sizeof (edid_header)); }else {
Signature · 1 line
1.7.0.1
PATCH 2/2 drm/edid: Add option to forcibly correct EDID checksums
So much broken hardware, so few bullets.
--- Documentation/kernel-parameters.txt | 3 +++ drivers/gpu/drm/drm_edid.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-)
Documentation/kernel-parameters.txt +3 -0
@@ -713,6 +713,9 @@ and is between 256 and 4096 characters. It is defined in the file edd= [EDD] Format: {"off" | "on" | "skip[mbr]"} + edid_force_checksum=<bool> [DRM] + Forcibly correct EDID checksum errors. Default is off. + edid_threshold=<int> [DRM] Set the minimum number of bytes of an EDID header that must be valid, out of 8. The default is 6.
drivers/gpu/drm/drm_edid.c +10 -2
@@ -66,6 +66,10 @@ static unsigned int edid_threshold = 6;MODULE_PARM_DESC (edid_threshold,"EDID header fixup threshold (default: 6)" );module_param_named (edid_threshold, edid_threshold, int,0600 ); +static bool edid_force_checksum =0 ; +MODULE_PARM_DESC (edid_force_checksum,"Forcibly correct EDID checksum" ); +module_param_named (edid_force_checksum, edid_force_checksum, int,0600 ); +#define LEVEL_DMT 0#define LEVEL_GTF 1#define LEVEL_GTF2 2
@@ -149,8 +153,12 @@ drm_edid_block_valid(u8 *raw_edid)for (i =0 ; i <EDID_LENGTH ; i++) csum += raw_edid[i];if (csum) { -DRM_ERROR ("EDID checksum is invalid, remainder is %d\n" , csum); - goto bad; +if (edid_force_checksum) { + raw_edid[0x7f ] -= csum; + }else { +DRM_ERROR ("EDID checksum is invalid (%d)\n" , csum); + goto bad; + } }/* per-block-type checks */
Signature · 1 line
1.7.0.1
Dave Airlie
maintainerQuoted 1 line · Adam Jackson
Signed-off-by Adam Jackson <[email protected]>
not sure about the kernel-parameters additions, since the option would be drm.edid_threshhold= and its a module option, though now that we can accept module options on the command line, we could start adding them to parameters file. However you'd need to add the drm. bit to the front of the option.
How much broken hw we seeing that this fixes? maybe some bug references, as I hate having special options that people have to know just to see somehting on screen.
Dave.
Quoted 51 lines
---
Documentation/kernel-parameters.txt | 4 ++++
drivers/gpu/drm/drm_edid.c | 5 ++++-2 files changed, 8 insertions(+), 1 deletions(-)Documentation/kernel-parameters.txt +0
-0@@ -713,6 +713,10 @@ and is between 256 and 4096 characters. It is defined in the fileedd= [EDD]
Format: {"off" | "on" | "skip[mbr]"}+ edid_threshold=<int> [DRM]
+ Set the minimum number of bytes of an EDID header
+ that must be valid, out of 8. The default is 6. +
eisa_irq_edge= [PARISC,HW]
See header ofdrivers/parisc/eisa.c.drivers/gpu/drm/drm_edid.c +4
-2@@ -62,6 +62,9 @@ /* use +hsync +vsync for detailed mode */ #define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6) +static unsigned int edid_threshold =6 ; +MODULE_PARM_DESC (edid_threshold,"EDID header fixup threshold (default: 6)" ); +module_param_named (edid_threshold, edid_threshold, int,0600 ); #define LEVEL_DMT 0 #define LEVEL_GTF 1@@ -135,7 +138,7 @@ drm_edid_block_valid(u8 *raw_edid) score++; if (score == 8) ; - else if (score >= 6) { + else if (score >= edid_threshold) { DRM_DEBUG("Fixing EDID header, your hardware may be failing\n"); memcpy(raw_edid, edid_header, sizeof(edid_header)); } else { --1.7.0.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Dave Airlie
Quoted 1 line · Adam Jackson
Signed-off-by Adam Jackson <[email protected]>not sure about the kernel-parameters additions, since the option would be drm.edid_threshhold= and its a module option, though now that we can accept module options on the command line, we could start adding them to parameters file. However you'd need to add the drm. bit to the front of the option.
The doc already kind of mentions that, but it's kind of wrong. It only talks about "passing options with modprobe" and "passing options to built-in modules on kcmdline", but not about "passing options to loadable modules on kcmdline". I'll follow up on that to lkml.
Quoted 3 lines
How much broken hw we seeing that this fixes? maybe some bug references, as I hate having special options that people have to know just to see somehting on screen.
I've seen at least two cases in bug reports. I could dig up a reference I suppose.
That's a valid point though: we currently don't distinguish between "connected but with broken EDID" and "disconnected". I think it sounds reasonable to treat the former as connector_status_unknown instead. That way, if nothing else is connected, X will still light you up at the fallback size. Sound right?
- ajax
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 19 lines · Adam Jackson
Quoted 8 lines · Dave Airlie
Quoted 1 line · Adam Jackson
Signed-off-by Adam Jackson <[email protected]>not sure about the kernel-parameters additions, since the option would be drm.edid_threshhold= and its a module option, though now that we can accept module options on the command line, we could start adding them to parameters file. However you'd need to add the drm. bit to the front of the option.
The doc already kind of mentions that, but it's kind of wrong. It only talks about "passing options with modprobe" and "passing options to built-in modules on kcmdline", but not about "passing options to loadable modules on kcmdline". I'll follow up on that to lkml.
Quoted 3 lines
How much broken hw we seeing that this fixes? maybe some bug references, as I hate having special options that people have to know just to see somehting on screen.
Quoted 9 lines
I've seen at least two cases in bug reports. I could dig up a reference I suppose.
That's a valid point though: we currently don't distinguish between "connected but with broken EDID" and "disconnected". I think it sounds reasonable to treat the former as
connector_status_unknowninstead. That way, if nothing else is connected, X will still light you up at the fallback size. Sound right?
Or maybe just mention the EDID is bad and may cause problems, but then use as much of it as possible. That has the best chance of a satisfied user and a native mode being selected.
Alex
Quoted 8 lines
- ajax
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 10 lines · Alex Deucher
Quoted 5 lines · Adam Jackson
That's a valid point though: we currently don't distinguish between "connected but with broken EDID" and "disconnected". I think it sounds reasonable to treat the former as
connector_status_unknowninstead. That way, if nothing else is connected, X will still light you up at the fallback size. Sound right?Or maybe just mention the EDID is bad and may cause problems, but then use as much of it as possible. That has the best chance of a satisfied user and a native mode being selected.
That would require a lot more parser work to make it robust in the face of suspicious-looking subsections. Not that we should never do that, but that I think it's the wrong strategy in general. I've really tended to shy away from being too permissive in what we accept from EDID, because the failure mode is picking a mode that the display doesn't support and coming up blank. I'd much rather play it safe if we're not 100% sure, especially since you can jam the correct mode in later with RANDR if you come up in a conservative mode.
One thing that _would_ be cool is figuring out the common ways of writing to EDID EEPROMs and exposing some I-know-what-I'm-doing way of trying them, so we could repair bad displays. Also, DDC/CI sometimes gives you a way of knowing whether the monitor has synced, which would let us know whether a given mode was bad or not.
- ajax
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel