diff mbox

[v4,10/11] drm/i915: Update bits per component for display info

Message ID 1465219753-3737-11-git-send-email-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kahola June 6, 2016, 1:29 p.m. UTC
DisplayPort branch device may define max supported bits per
component. Update display info based on this value if bpc
is defined.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1b94347..ad3ff37 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3932,6 +3932,17 @@  intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 {
 	uint8_t *dpcd = intel_dp->dpcd;
 	uint8_t type;
+	uint8_t cap[4];
+
+	if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT) {
+		int bpc;
+
+		drm_dp_downstream_port_cap(&intel_dp->aux, dpcd, cap);
+		bpc = drm_dp_downstream_max_bpc(dpcd, cap);
+
+		if (bpc > 0)
+			intel_dp->attached_connector->base.display_info.bpc = bpc;
+	}
 
 	if (!intel_dp_get_dpcd(intel_dp))
 		return connector_status_disconnected;
@@ -3969,6 +3980,7 @@  intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 			return connector_status_unknown;
 	}
 
+
 	/* Anything else is out of spec, warn and ignore */
 	DRM_DEBUG_KMS("Broken DP branch device, ignoring\n");
 	return connector_status_disconnected;