public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [RFC] drm: Add utility function to check for edp1.4
@ 2014-10-22  6:15 sonika.jindal
  2014-10-29 13:42 ` Thierry Reding
  0 siblings, 1 reply; 7+ messages in thread
From: sonika.jindal @ 2014-10-22  6:15 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: alexdeucher, treding, daniel.vetter

From: Sonika Jindal <sonika.jindal@intel.com>

v2: Reading DP_EDP_REV, only when DISPLAY_CONTROL_CAPABLE field is set (Satheesh)

v3: Moving the utility function to drm_dp_helper (Daniel)

Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
---
 drivers/gpu/drm/drm_dp_helper.c |   15 +++++++++++++++
 include/drm/drm_dp_helper.h     |    2 ++
 2 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 08e33b8..a54a760 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -768,3 +768,18 @@ void drm_dp_aux_unregister(struct drm_dp_aux *aux)
 	i2c_del_adapter(&aux->ddc);
 }
 EXPORT_SYMBOL(drm_dp_aux_unregister);
+
+bool drm_dp_is_edp_v1_4(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE])
+{
+	uint8_t reg;
+
+	if (dpcd[DP_EDP_CONFIGURATION_CAP] &
+		 DP_DPCD_DISPLAY_CONTROL_CAPABLE) {
+
+		if (drm_dp_dpcd_read(aux, DP_EDP_REV, &reg, 1))
+			if (reg == 0x03)
+				return true;
+	}
+	return false;
+}
+EXPORT_SYMBOL(drm_dp_is_edp_v1_4);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 8edeed0..b017e1e 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -102,6 +102,8 @@
 
 #define DP_EDP_CONFIGURATION_CAP            0x00d   /* XXX 1.2? */
 #define DP_TRAINING_AUX_RD_INTERVAL         0x00e   /* XXX 1.2? */
+#define DP_DPCD_DISPLAY_CONTROL_CAPABLE     (1 << 3)
+#define DP_EDP_REV                          0x700
 
 /* Multiple stream transport */
 #define DP_FAUX_CAP			    0x020   /* 1.2 */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-04  5:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22  6:15 [RFC] drm: Add utility function to check for edp1.4 sonika.jindal
2014-10-29 13:42 ` Thierry Reding
2014-10-30  4:14   ` sonika
2014-10-31 16:06   ` Daniel Vetter
2014-11-03  8:25     ` Thierry Reding
2014-11-03  8:28       ` Daniel Vetter
2014-11-04  5:55         ` sonika

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox