drm: Fix EDID color format parsing
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 16 Apr 2012 13:16:18 +0000 (15:16 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 20 Apr 2012 11:44:49 +0000 (12:44 +0100)
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: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_edid.c

index 5a18b0df82850a046608c57c7fedb4cf75d03e4b..8a4580c2a1d0295af01a75e9e271e335be5ea6da 100644 (file)
@@ -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);