drm/edid: Fix parsing of EDID 1.4 Established Timings III descriptor
Subsystems (2)
PATCH 1/1 drm/edid: Fix parsing of EDID 1.4 Established Timings III descriptor
The EDID 1.4 specification section 3.10.3.9 defines an Established Timings III descriptor (tag #F7h). The parsing of this descriptor by drm_est3_modes() is off by one byte: the offset of the first timing bitmap is 6, not 5.
---
drivers/gpu/drm/drm_edid.c +1 -1
@@ -2215,7 +2215,7 @@ {int i, j, m, modes =0 ;struct drm_display_mode *mode; -u8 *est = ((u8 *)timing) +5 ; +u8 *est = ((u8 *)timing) +6 ;for (i =0 ; i <6 ; i++) {for (j =7 ; j >=0 ; j--) {
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Paul Parsons
The EDID 1.4 specification section 3.10.3.9 defines an Established Timings III descriptor (tag #F7h). The parsing of this descriptor by
drm_est3_modes()is off by one byte: the offset of the first timing bitmap is 6, not 5.Signed-off-by Paul Parsons <[email protected]>
I'm not all that familiar with the EDID parsing code, but this seems right.
I'd appreciate an extra set of eyeballs on this one still.
Makes you wonder about the implications though. We've been reading the revision number as a bitmask and otherwise been off by one byte. The interpretation of Established Timings III would have been pretty much random. Where are the bugs?
BR,
Jani.
Quoted 21 lines
---
diff -ru
a/drivers/gpu/drm/drm_edid.cb/drivers/gpu/drm/drm_edid.cdrivers/gpu/drm/drm_edid.c +1
-1@@ -2215,7 +2215,7 @@ {int i, j, m, modes =0 ;struct drm_display_mode *mode; -u8 *est = ((u8 *)timing) +5 ; +u8 *est = ((u8 *)timing) +6 ;for (i =0 ; i <6 ; i++) {for (j =7 ; j >=0 ; j--) {_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Paul Parsons
The EDID 1.4 specification section 3.10.3.9 defines an Established Timings III descriptor (tag #F7h). The parsing of this descriptor by
drm_est3_modes()is off by one byte: the offset of the first timing bitmap is 6, not 5.Signed-off-by Paul Parsons <[email protected]>---
diff -ru
a/drivers/gpu/drm/drm_edid.cb/drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_edid.c line 2218
Quoted 5 lines
drivers/gpu/drm/drm_edid.c +1
-1@@ -2215,7 +2215,7 @@ {int i, j, m, modes =0 ;struct drm_display_mode *mode; -u8 *est = ((u8 *)timing) +5 ; +u8 *est = ((u8 *)timing) +6 ;
Hmm. The code is very hard to follow due to the weird structs and whatnot. But yeah this looks correct.
Oh and I suppose you could also fix up the EDID version check to check for 1.4+ before even considering the est3 descriptor as valid.
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +0
-0for (i =0 ; i <6 ; i++) {for (j =7 ; j >=0 ; j--) {_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula
AppliedQuoted 21 lines · Ville Syrjälä
Quoted 11 lines · Paul Parsons
The EDID 1.4 specification section 3.10.3.9 defines an Established Timings III descriptor (tag #F7h). The parsing of this descriptor by
drm_est3_modes()is off by one byte: the offset of the first timing bitmap is 6, not 5.Signed-off-by Paul Parsons <[email protected]>---
diff -ru
a/drivers/gpu/drm/drm_edid.cb/drivers/gpu/drm/drm_edid.cdrivers/gpu/drm/drm_edid.c line 2218
Quoted 5 lines
drivers/gpu/drm/drm_edid.c +1
-1@@ -2215,7 +2215,7 @@ {int i, j, m, modes =0 ;struct drm_display_mode *mode; -u8 *est = ((u8 *)timing) +5 ; +u8 *est = ((u8 *)timing) +6 ;Hmm. The code is very hard to follow due to the weird structs and whatnot. But yeah this looks correct.
Quoted 1 line
Reviewed-by Ville Syrjälä <[email protected]>
Pushed to our topic/drm-fixes, thanks for the patch and review.
BR,
Jani.
Quoted 15 lines
Oh and I suppose you could also fix up the EDID version check to check for 1.4+ before even considering the est3 descriptor as valid.
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +0
-0for (i =0 ; i <6 ; i++) {for (j =7 ; j >=0 ; j--) {_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel