Merge drm/drm-next into drm-misc-next
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_edid.c
index 190b1d7..04e818e 100644 (file)
@@ -4937,7 +4937,8 @@ bool drm_detect_monitor_audio(const struct edid *edid)
        if (!edid_ext)
                goto end;
 
-       has_audio = ((edid_ext[3] & EDID_BASIC_AUDIO) != 0);
+       has_audio = (edid_ext[0] == CEA_EXT &&
+                   (edid_ext[3] & EDID_BASIC_AUDIO) != 0);
 
        if (has_audio) {
                DRM_DEBUG_KMS("Monitor has basic audio support\n");
@@ -5265,10 +5266,14 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 
        /* The existence of a CEA block should imply RGB support */
        info->color_formats = DRM_COLOR_FORMAT_RGB444;
-       if (edid_ext[3] & EDID_CEA_YCRCB444)
-               info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
-       if (edid_ext[3] & EDID_CEA_YCRCB422)
-               info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
+
+       /* CTA DisplayID Data Block does not have byte #3 */
+       if (edid_ext[0] == CEA_EXT) {
+               if (edid_ext[3] & EDID_CEA_YCRCB444)
+                       info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
+               if (edid_ext[3] & EDID_CEA_YCRCB422)
+                       info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
+       }
 
        if (cea_db_offsets(edid_ext, &start, &end))
                return;
@@ -5447,6 +5452,7 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
        if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
                goto out;
 
+       info->color_formats |= DRM_COLOR_FORMAT_RGB444;
        drm_parse_cea_ext(connector, edid);
 
        /*
@@ -5495,7 +5501,6 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
        DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
                          connector->name, info->bpc);
 
-       info->color_formats |= DRM_COLOR_FORMAT_RGB444;
        if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
                info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
        if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)