[PATCH v3 09/12] drm/i915: Read DP branch device id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Read device ID for DisplayPort branch devices. The device
ID is defined in DPCD register 0x503 and it is mandatory field
for DP branch devices.

Signed-off-by: Mika Kahola <mika.kahola@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_dp.c | 6 ++++++
 include/drm/drm_dp_helper.h     | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 5e16063..2b768da 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3458,6 +3458,12 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
 	if (drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_OUI, buf, 3) == 3)
 		DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
 			      buf[0], buf[1], buf[2]);
+
+	if (intel_dp->bd.present) {
+		if (drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_ID, intel_dp->bd.id,
+				     sizeof(intel_dp->bd.id)) == sizeof(intel_dp->bd.id))
+			DRM_DEBUG_KMS("Device ID: %s\n", intel_dp->bd.id);
+	}
 }
 
 static bool
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index ee4084d..f1fc4e2 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -457,6 +457,7 @@
 #define DP_SOURCE_OUI			    0x300
 #define DP_SINK_OUI			    0x400
 #define DP_BRANCH_OUI			    0x500
+#define DP_BRANCH_ID                        0x503
 
 #define DP_SET_POWER                        0x600
 # define DP_SET_POWER_D0                    0x1
@@ -869,6 +870,7 @@ struct drm_dp_bd {
 	bool present;
 	int type;
 	bool hpd;
+	uint8_t id[6];
 	union {
 		struct drm_dp_vga vga;
 		struct drm_dp_dvi dvi;
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux