[3/3] DEBUG: print panel vendor

Submitted by José Roberto de Souza on Feb. 9, 2019, 1 a.m.

Details

Message ID 20190209010005.14862-3-jose.souza@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX - Try Bot

Not browsing as part of any series.

Commit Message

José Roberto de Souza Feb. 9, 2019, 1 a.m.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b91b9700755f..d1d287522c83 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4099,11 +4099,24 @@  static void intel_dp_get_dsc_sink_cap(struct intel_dp *intel_dp)
 	}
 }
 
+static struct edid *intel_dp_get_edid(struct intel_dp *intel_dp);
+
+static void edid_vendor(const struct edid *edid, char vendor[3])
+{
+	vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
+	vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
+		     ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
+	vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';
+}
+
+#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
+
 static bool
 intel_edp_init_dpcd(struct intel_dp *intel_dp)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(dp_to_dig_port(intel_dp)->base.base.dev);
+	struct edid *edid;
 
 	/* this function is meant to be called only once */
 	WARN_ON(intel_dp->dpcd[DP_DPCD_REV] != 0);
@@ -4114,6 +4127,16 @@  intel_edp_init_dpcd(struct intel_dp *intel_dp)
 	drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
 			 drm_dp_is_branch(intel_dp->dpcd));
 
+	edid = intel_dp_get_edid(intel_dp);
+	if (edid) {
+		char vendor[3];
+
+		edid_vendor(edid, vendor);
+		DRM_DEBUG_KMS("eDP panel vendor %s prod %u\n", vendor, EDID_PRODUCT_ID(edid));
+	} else {
+		DRM_DEBUG_KMS("Unable to get EDID of eDP\n");
+	}
+
 	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
 		dev_priv->no_aux_handshake = intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
 			DP_NO_AUX_HANDSHAKE_LINK_TRAINING;