Skip to content

Commit 7344bad

Browse files
committed
drm/edid: fix CEA extension byte #3 parsing
Only an EDID CEA extension has byte #3, while the CTA DisplayID Data Block does not. Don't interpret bogus data for color formats. For most displays it's probably an unlikely scenario you'd have a CTA DisplayID Data Block without a CEA extension, but they do exist. Fixes: e28ad54 ("drm/edid: parse CEA blocks embedded in DisplayID") Cc: <[email protected]> Cc: Shawn C Lee <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5662abf commit 7344bad

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/drm_edid.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5188,10 +5188,14 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
51885188

51895189
/* The existence of a CEA block should imply RGB support */
51905190
info->color_formats = DRM_COLOR_FORMAT_RGB444;
5191-
if (edid_ext[3] & EDID_CEA_YCRCB444)
5192-
info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
5193-
if (edid_ext[3] & EDID_CEA_YCRCB422)
5194-
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
5191+
5192+
/* CTA DisplayID Data Block does not have byte #3 */
5193+
if (edid_ext[0] == CEA_EXT) {
5194+
if (edid_ext[3] & EDID_CEA_YCRCB444)
5195+
info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
5196+
if (edid_ext[3] & EDID_CEA_YCRCB422)
5197+
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
5198+
}
51955199

51965200
if (cea_db_offsets(edid_ext, &start, &end))
51975201
return;

0 commit comments

Comments
 (0)