Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee58808d authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Dave Airlie
Browse files

drm: Fix EDID color format parsing



The code should obviously check the EDID feature field for EDID feature flags
and not the color_formats field of the drm_display_info struct. Also update the
color_formats field with new modes instead of overwriting the current mode.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d1b45d5f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1699,10 +1699,10 @@ static void drm_add_display_info(struct edid *edid,
	}

	info->color_formats = DRM_COLOR_FORMAT_RGB444;
	if (info->color_formats & DRM_EDID_FEATURE_RGB_YCRCB444)
		info->color_formats = DRM_COLOR_FORMAT_YCRCB444;
	if (info->color_formats & DRM_EDID_FEATURE_RGB_YCRCB422)
		info->color_formats = DRM_COLOR_FORMAT_YCRCB422;
	if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
		info->color_formats |= DRM_COLOR_FORMAT_YCRCB444;
	if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
		info->color_formats |= DRM_COLOR_FORMAT_YCRCB422;

	/* Get data from CEA blocks if present */
	edid_ext = drm_find_cea_extension(edid);