drm/edid: Store all supported hdmi deep color modes in drm_display_info
authorMario Kleiner <mario.kleiner.de@gmail.com>
Thu, 5 Jun 2014 13:52:10 +0000 (09:52 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Jun 2014 02:06:49 +0000 (22:06 -0400)
HDMI deep color setup must know which modes are supported if
it needs to degrade gracefully, as only 12 bpc / dc_36 is
guaranteed, but 10 bpc / dc_30 is optional. The maximum bpc
is not sufficient for this.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_edid.c
include/drm/drm_crtc.h

index 7be21781d3bdf82a79973a41cba38fe7abb9b507..dfa9769b26b5c57db0731361478639a9600b65b3 100644 (file)
@@ -3471,18 +3471,21 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,
 
                        if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
                                dc_bpc = 10;
+                               info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_30;
                                DRM_DEBUG("%s: HDMI sink does deep color 30.\n",
                                                  connector->name);
                        }
 
                        if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
                                dc_bpc = 12;
+                               info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_36;
                                DRM_DEBUG("%s: HDMI sink does deep color 36.\n",
                                                  connector->name);
                        }
 
                        if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
                                dc_bpc = 16;
+                               info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_48;
                                DRM_DEBUG("%s: HDMI sink does deep color 48.\n",
                                                  connector->name);
                        }
index a7fac5686915f21c728315a9c6533cb25cf9879a..251b75e6bf7a173243a9623d8a013e8606c6ae62 100644 (file)
@@ -121,6 +121,9 @@ struct drm_display_info {
        enum subpixel_order subpixel_order;
        u32 color_formats;
 
+       /* Mask of supported hdmi deep color modes */
+       u8 edid_hdmi_dc_modes;
+
        u8 cea_rev;
 };