* [PATCH v5 00/10] drm/i915: DP branch devices
@ 2016-06-10 12:27 Mika Kahola
2016-06-10 12:27 ` [PATCH v5 01/10] drm: Add missing DP downstream port types Mika Kahola
` (10 more replies)
0 siblings, 11 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:27 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Prep work for DP branch device handling
This series of patches reads DPCD register 0x80h for receiver
capabilities for DP branch devices. The branch device types are
converters for the following standards
- DP to VGA
- DP to DVI
- DP to HDMI
- DP++ dual mode
- Wireless WiGig
DPCD register defines max pixel rate for VGA dongles. This
check is carried out during mode validation.
What's new in the series:
- Readout of branch device ID, HW, and SW revisions from DPCD register
v2: DPCD register read outs moved to drm (Ville, Daniel)
v3: Max pixel rate computation moved to drm (Daniel)
v4: Use of drm_dp_helper routines to collect data (Ville)
v5: Remove duplicate code and unnecessary functions from drm_dp_helper (Ville)
Mika Kahola (10):
drm: Add missing DP downstream port types
drm: Drop VGA from bpc definitions
drm: Helper to read max clock rate
drm: Helper to read max bits per component
drm: Read DP branch device id
drm: Read DP branch device HW revision
drm: Read DP branch device SW revision
drm/i915: Check pixel rate for DP to VGA dongle
drm/i915: Update bits per component for display info
drm/i915: Add DP branch device info on debugfs
drivers/gpu/drm/drm_dp_helper.c | 129 ++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/i915_debugfs.c | 72 ++++++++++++++++++++
drivers/gpu/drm/i915/intel_dp.c | 35 ++++++++++
include/drm/drm_dp_helper.h | 27 ++++++--
4 files changed, 258 insertions(+), 5 deletions(-)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 01/10] drm: Add missing DP downstream port types
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
@ 2016-06-10 12:27 ` Mika Kahola
2016-06-10 12:27 ` [PATCH v5 02/10] drm: Drop VGA from bpc definitions Mika Kahola
` (9 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:27 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Add missing DisplayPort downstream port types. The introduced
new port types are DP++ and Wireless.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
include/drm/drm_dp_helper.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a848e7..e384c7f 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -211,6 +211,8 @@
# define DP_DS_PORT_TYPE_DVI 2
# define DP_DS_PORT_TYPE_HDMI 3
# define DP_DS_PORT_TYPE_NON_EDID 4
+# define DP_DS_PORT_TYPE_DP_DUALMODE 5
+# define DP_DS_PORT_TYPE_WIRELESS 6
# define DP_DS_PORT_HPD (1 << 3)
/* offset 1 for VGA is maximum megapixels per second / 8 */
/* offset 2 */
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 02/10] drm: Drop VGA from bpc definitions
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
2016-06-10 12:27 ` [PATCH v5 01/10] drm: Add missing DP downstream port types Mika Kahola
@ 2016-06-10 12:27 ` Mika Kahola
2016-06-10 12:27 ` [PATCH v5 03/10] drm: Helper to read max clock rate Mika Kahola
` (8 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:27 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Drop "VGA" from bits per component definitions as these
are also used by other standards such as DVI, HDMI,
DP++.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
include/drm/drm_dp_helper.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index e384c7f..a7badba 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -216,11 +216,11 @@
# define DP_DS_PORT_HPD (1 << 3)
/* offset 1 for VGA is maximum megapixels per second / 8 */
/* offset 2 */
-# define DP_DS_VGA_MAX_BPC_MASK (3 << 0)
-# define DP_DS_VGA_8BPC 0
-# define DP_DS_VGA_10BPC 1
-# define DP_DS_VGA_12BPC 2
-# define DP_DS_VGA_16BPC 3
+# define DP_DS_MAX_BPC_MASK (3 << 0)
+# define DP_DS_8BPC 0
+# define DP_DS_10BPC 1
+# define DP_DS_12BPC 2
+# define DP_DS_16BPC 3
/* link configuration */
#define DP_LINK_BW_SET 0x100
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 03/10] drm: Helper to read max clock rate
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
2016-06-10 12:27 ` [PATCH v5 01/10] drm: Add missing DP downstream port types Mika Kahola
2016-06-10 12:27 ` [PATCH v5 02/10] drm: Drop VGA from bpc definitions Mika Kahola
@ 2016-06-10 12:27 ` Mika Kahola
2016-06-10 12:27 ` [PATCH v5 04/10] drm: Helper to read max bits per component Mika Kahola
` (7 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:27 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Helper routine to read out maximum supported pixel rate
for DisplayPort legay VGA converter or TMDS clock rate
for other digital legacy converters. The helper returns
clock rate in kHz.
v2: Return early if detailed port cap info is not available.
Replace if-else ladder with switch-case (Ville)
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 33 +++++++++++++++++++++++++++++++++
include/drm/drm_dp_helper.h | 2 ++
2 files changed, 35 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index eeaf5a7..1199a02 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -438,6 +438,39 @@ int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link)
}
EXPORT_SYMBOL(drm_dp_link_configure);
+/**
+ * drm_dp_downstream_max_clock() - extract branch device max
+ * pixel rate for legacy VGA
+ * converter or max TMDS clock
+ * rate for others
+ * @dpcd: DisplayPort configuration data
+ * @port_cap: port capabilities
+ *
+ * Returns max clock in kHz on success or 0 if max clock not defined
+ */
+int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
+ const u8 port_cap[4])
+{
+ int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
+ bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DETAILED_CAP_INFO_AVAILABLE;
+
+ if (!detailed_cap_info)
+ return 0;
+
+ switch (type) {
+ case DP_DS_PORT_TYPE_VGA:
+ return port_cap[1] * 8 * 1000;
+ case DP_DS_PORT_TYPE_DVI:
+ case DP_DS_PORT_TYPE_HDMI:
+ case DP_DS_PORT_TYPE_DP_DUALMODE:
+ return port_cap[1] * 2500;
+ default:
+ return 0;
+ }
+}
+EXPORT_SYMBOL(drm_dp_downstream_max_clock);
+
/*
* I2C-over-AUX implementation
*/
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index a7badba..0cf6d3a 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -806,6 +806,8 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
+ const u8 port_cap[4]);
int drm_dp_aux_register(struct drm_dp_aux *aux);
void drm_dp_aux_unregister(struct drm_dp_aux *aux);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 04/10] drm: Helper to read max bits per component
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (2 preceding siblings ...)
2016-06-10 12:27 ` [PATCH v5 03/10] drm: Helper to read max clock rate Mika Kahola
@ 2016-06-10 12:27 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 05/10] drm: Read DP branch device id Mika Kahola
` (6 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:27 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Helper routine to read out maximum supported bits per
component for DisplayPort legay converters.
v2: Return early if detailed port cap info is not available.
Replace if-else ladder with switch-case (Ville)
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 42 +++++++++++++++++++++++++++++++++++++++++
include/drm/drm_dp_helper.h | 2 ++
2 files changed, 44 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 1199a02..3dab8a4 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -471,6 +471,48 @@ int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
}
EXPORT_SYMBOL(drm_dp_downstream_max_clock);
+/**
+ * drm_dp_downstream_max_bpc() - extract branch device max
+ * bits per component
+ * @dpcd: DisplayPort configuration data
+ * @port_cap: port capabilities
+ *
+ * Returns max bpc on success or 0 if max bpc not defined
+ */
+int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
+ const u8 port_cap[4])
+{
+ int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
+ bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DETAILED_CAP_INFO_AVAILABLE;
+ int bpc;
+
+ if (!detailed_cap_info)
+ return 0;
+
+ switch (type) {
+ case DP_DS_PORT_TYPE_VGA:
+ case DP_DS_PORT_TYPE_DVI:
+ case DP_DS_PORT_TYPE_HDMI:
+ case DP_DS_PORT_TYPE_DP_DUALMODE:
+ bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
+
+ switch (bpc) {
+ case DP_DS_8BPC:
+ return 8;
+ case DP_DS_10BPC:
+ return 10;
+ case DP_DS_12BPC:
+ return 12;
+ case DP_DS_16BPC:
+ return 16;
+ }
+ default:
+ return 0;
+ }
+}
+EXPORT_SYMBOL(drm_dp_downstream_max_bpc);
+
/*
* I2C-over-AUX implementation
*/
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 0cf6d3a..b18d17c 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -808,6 +808,8 @@ int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4]);
+int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
+ const u8 port_cap[4]);
int drm_dp_aux_register(struct drm_dp_aux *aux);
void drm_dp_aux_unregister(struct drm_dp_aux *aux);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 05/10] drm: Read DP branch device id
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (3 preceding siblings ...)
2016-06-10 12:27 ` [PATCH v5 04/10] drm: Helper to read max bits per component Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 06/10] drm: Read DP branch device HW revision Mika Kahola
` (5 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Read DisplayPort branch device id string.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 12 ++++++++++++
include/drm/drm_dp_helper.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 3dab8a4..0c83685 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -513,6 +513,18 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
}
EXPORT_SYMBOL(drm_dp_downstream_max_bpc);
+/**
+ * drm_dp_downstream_id() - identify branch device
+ * @aux: DisplayPort AUX channel
+ *
+ * Returns branch device id on success or NULL on failure
+ */
+int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6])
+{
+ return drm_dp_dpcd_read(aux, DP_BRANCH_ID, id, 6);
+}
+EXPORT_SYMBOL(drm_dp_downstream_id);
+
/*
* I2C-over-AUX implementation
*/
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index b18d17c..88bf3bf 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -445,6 +445,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
@@ -810,6 +811,7 @@ int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4]);
int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4]);
+int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]);
int drm_dp_aux_register(struct drm_dp_aux *aux);
void drm_dp_aux_unregister(struct drm_dp_aux *aux);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 06/10] drm: Read DP branch device HW revision
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (4 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 05/10] drm: Read DP branch device id Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 07/10] drm: Read DP branch device SW revision Mika Kahola
` (4 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
HW revision is mandatory field for DisplayPort branch
devices. This is defined in DPCD register field 0x509.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 21 +++++++++++++++++++++
include/drm/drm_dp_helper.h | 7 +++++++
2 files changed, 28 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 0c83685..b5ae189 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -514,6 +514,27 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
EXPORT_SYMBOL(drm_dp_downstream_max_bpc);
/**
+ * drm_dp_downstream_hw_rev() - read DP branch device HW revision
+ * @aux: DisplayPort AUX channel
+ *
+ * Returns HW revision on succes or negative error code on failure
+ */
+struct drm_dp_revision drm_dp_downstream_hw_rev(struct drm_dp_aux *aux)
+{
+ uint8_t tmp;
+ struct drm_dp_revision rev = { .major = -EINVAL, .minor = -EINVAL };
+
+ if (drm_dp_dpcd_read(aux, DP_BRANCH_HW_REV, &tmp, 1) != 1)
+ return rev;
+
+ rev.major = (tmp & 0xf0) >> 4;
+ rev.minor = tmp & 0xf;
+
+ return rev;
+}
+EXPORT_SYMBOL(drm_dp_downstream_hw_rev);
+
+/**
* drm_dp_downstream_id() - identify branch device
* @aux: DisplayPort AUX channel
*
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 88bf3bf..641bf3d 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -446,6 +446,7 @@
#define DP_SINK_OUI 0x400
#define DP_BRANCH_OUI 0x500
#define DP_BRANCH_ID 0x503
+#define DP_BRANCH_HW_REV 0x509
#define DP_SET_POWER 0x600
# define DP_SET_POWER_D0 0x1
@@ -803,6 +804,11 @@ struct drm_dp_link {
unsigned long capabilities;
};
+struct drm_dp_revision {
+ int major;
+ int minor;
+};
+
int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
@@ -812,6 +818,7 @@ int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4]);
int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]);
+struct drm_dp_revision drm_dp_downstream_hw_rev(struct drm_dp_aux *aux);
int drm_dp_aux_register(struct drm_dp_aux *aux);
void drm_dp_aux_unregister(struct drm_dp_aux *aux);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 07/10] drm: Read DP branch device SW revision
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (5 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 06/10] drm: Read DP branch device HW revision Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 08/10] drm/i915: Check pixel rate for DP to VGA dongle Mika Kahola
` (3 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
SW revision is mandatory field for DisplayPort branch
devices. This is defined in DPCD register field 0x50A.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 21 +++++++++++++++++++++
include/drm/drm_dp_helper.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index b5ae189..80147cd 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -535,6 +535,27 @@ struct drm_dp_revision drm_dp_downstream_hw_rev(struct drm_dp_aux *aux)
EXPORT_SYMBOL(drm_dp_downstream_hw_rev);
/**
+ * drm_dp_downstream_sw_rev() - read DP branch device SW revision
+ * @aux: DisplayPort AUX channel
+ *
+ * Returns SW revision on success or negative error code on failure
+ */
+struct drm_dp_revision drm_dp_downstream_sw_rev(struct drm_dp_aux *aux)
+{
+ uint8_t tmp[2];
+ struct drm_dp_revision rev = { .major = -EINVAL, .minor = -EINVAL };
+
+ if (drm_dp_dpcd_read(aux, DP_BRANCH_SW_REV, tmp, 2) != 2)
+ return rev;
+
+ rev.major = tmp[0];
+ rev.minor = tmp[1];
+
+ return rev;
+}
+EXPORT_SYMBOL(drm_dp_downstream_sw_rev);
+
+/**
* drm_dp_downstream_id() - identify branch device
* @aux: DisplayPort AUX channel
*
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 641bf3d..c3e4759 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -447,6 +447,7 @@
#define DP_BRANCH_OUI 0x500
#define DP_BRANCH_ID 0x503
#define DP_BRANCH_HW_REV 0x509
+#define DP_BRANCH_SW_REV 0x50A
#define DP_SET_POWER 0x600
# define DP_SET_POWER_D0 0x1
@@ -819,6 +820,7 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4]);
int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]);
struct drm_dp_revision drm_dp_downstream_hw_rev(struct drm_dp_aux *aux);
+struct drm_dp_revision drm_dp_downstream_sw_rev(struct drm_dp_aux *aux);
int drm_dp_aux_register(struct drm_dp_aux *aux);
void drm_dp_aux_unregister(struct drm_dp_aux *aux);
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 08/10] drm/i915: Check pixel rate for DP to VGA dongle
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (6 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 07/10] drm: Read DP branch device SW revision Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 09/10] drm/i915: Update bits per component for display info Mika Kahola
` (2 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Filter out a mode that exceeds the max pixel rate setting
for DP to VGA dongle. This is defined in DPCD register 0x81
if detailed cap info i.e. info field is 4 bytes long and
it is available for DP downstream port.
The register defines the pixel rate divided by 8 in MP/s.
v2: DPCD read outs and computation moved to drm (Ville, Daniel)
v3: Sink pixel rate computation moved to drm_dp_max_sink_dotclock()
function (Daniel)
v4: Use of drm_dp_helper.c routines to compute max pixel clock (Ville)
v5: Use of intel_dp->downstream_ports to read out port capabilities.
Code restructuring (Ville)
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f97cd53..3b09230 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -190,6 +190,20 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)
return (max_link_clock * max_lanes * 8) / 10;
}
+static int
+intel_dp_downstream_max_clock(struct intel_dp *intel_dp, int clock)
+{
+ int dp_ds_clk;
+
+ dp_ds_clk = drm_dp_downstream_max_clock(intel_dp->dpcd,
+ intel_dp->downstream_ports);
+
+ if (dp_ds_clk == 0)
+ return clock;
+
+ return min(clock, dp_ds_clk);
+}
+
static enum drm_mode_status
intel_dp_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
@@ -201,6 +215,18 @@ intel_dp_mode_valid(struct drm_connector *connector,
int max_rate, mode_rate, max_lanes, max_link_clock;
int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
+ bool is_branch_device = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DWN_STRM_PORT_PRESENT;
+ int type;
+
+ if (is_branch_device) {
+ type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
+
+ if (type == DP_DS_PORT_TYPE_VGA)
+ max_dotclk = intel_dp_downstream_max_clock(intel_dp,
+ max_dotclk);
+ }
+
if (is_edp(intel_dp) && fixed_mode) {
if (mode->hdisplay > fixed_mode->hdisplay)
return MODE_PANEL;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 09/10] drm/i915: Update bits per component for display info
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (7 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 08/10] drm/i915: Check pixel rate for DP to VGA dongle Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:28 ` [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs Mika Kahola
2016-06-10 12:47 ` ✗ Ro.CI.BAT: warning for drm/i915: DP branch devices (rev5) Patchwork
10 siblings, 0 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
DisplayPort branch device may define max supported bits per
component. Update display info based on this value if bpc
is defined.
v2: cleanup to match the drm_dp_helper.c patches introduced
earlier in this series
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3b09230..8a293bee 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3942,6 +3942,14 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
uint8_t *dpcd = intel_dp->dpcd;
uint8_t type;
+ if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT) {
+ int bpc = drm_dp_downstream_max_bpc(dpcd,
+ intel_dp->downstream_ports);
+
+ if (bpc > 0)
+ intel_dp->attached_connector->base.display_info.bpc = bpc;
+ }
+
if (!intel_dp_get_dpcd(intel_dp))
return connector_status_disconnected;
@@ -3978,6 +3986,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;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (8 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 09/10] drm/i915: Update bits per component for display info Mika Kahola
@ 2016-06-10 12:28 ` Mika Kahola
2016-06-10 12:46 ` [Intel-gfx] " kbuild test robot
2016-06-10 15:22 ` kbuild test robot
2016-06-10 12:47 ` ✗ Ro.CI.BAT: warning for drm/i915: DP branch devices (rev5) Patchwork
10 siblings, 2 replies; 14+ messages in thread
From: Mika Kahola @ 2016-06-10 12:28 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
Read DisplayPort branch device info from through debugfs
interface.
v2: use drm_dp_helper routines to collect data
v3: cleanup to match the drm_dp_helper.c patches introduced
earlier in this series
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 72 +++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e4f2c55..442df3a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2943,9 +2943,81 @@ static void intel_dp_info(struct seq_file *m,
{
struct intel_encoder *intel_encoder = intel_connector->encoder;
struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
+ struct drm_dp_revision rev;
+ bool is_branch_device;
+ bool detailed_cap_info = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DETAILED_CAP_INFO_AVAILABLE;
+ int type;
+ int clk;
+ int bpc;
+ int cap_size;
+ uint8_t cap[4];
+ char id[6];
seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
seq_printf(m, "\taudio support: %s\n", yesno(intel_dp->has_audio));
+
+ is_branch_device = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+ DP_DWN_STRM_PORT_PRESENT;
+ seq_printf(m, "\tbranch device: %s\n", yesno(is_branch_device));
+
+ if (is_branch_device) {
+ type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
+
+ switch (type) {
+ case DP_DS_PORT_TYPE_DP:
+ seq_printf(m, "\ttype: DisplayPort\n");
+ break;
+ case DP_DS_PORT_TYPE_VGA:
+ seq_printf(m, "\ttype: VGA\n");
+ break;
+ case DP_DS_PORT_TYPE_DVI:
+ seq_printf(m, "\ttype: DVI\n");
+ break;
+ case DP_DS_PORT_TYPE_HDMI:
+ seq_printf(m, "\ttype: HDMI\n");
+ break;
+ case DP_DS_PORT_TYPE_NON_EDID:
+ seq_printf(m, "\ttype: others without EDID support\n");
+ break;
+ case DP_DS_PORT_TYPE_DP_DUALMODE:
+ seq_printf(m, "\ttype: DP++\n");
+ break;
+ case DP_DS_PORT_TYPE_WIRELESS:
+ seq_printf(m, "\ttype: Wireless\n");
+ break;
+ default:
+ seq_printf(m, "\ttype: N/A\n");
+ }
+
+ drm_dp_downstream_id(&intel_dp->aux, id);
+ seq_printf(m, "\tDevice id: %s\n", id);
+
+ rev = drm_dp_downstream_hw_rev(&intel_dp->aux);
+ seq_printf(m, "\tHW revision: %.2d.%.2d\n", rev.major, rev.minor);
+
+ rev = drm_dp_downstream_sw_rev(&intel_dp->aux);
+ seq_printf(m, "\tSW revision: %.2d.%.2d\n", rev.major, rev.minor);
+
+ if (detailed_cap_info) {
+ clk = drm_dp_downstream_max_clock(intel_dp->dpcd,
+ intel_dp->downstream_ports);
+
+ if (clk > 0) {
+ if (type == DP_DS_PORT_TYPE_VGA)
+ seq_printf(m, "\tMax dot clock: %d kHz\n", clk);
+ else
+ seq_printf(m, "\tMax TMDS clock: %d kHz\n", clk);
+ }
+
+ bpc = drm_dp_downstream_max_bpc(intel_dp->dpcd,
+ intel_dp->downstream_ports);
+
+ if (bpc > 0)
+ seq_printf(m, "\tMax bpc: %d\n", bpc);
+ }
+ }
+
if (intel_encoder->type == INTEL_OUTPUT_EDP)
intel_panel_info(m, &intel_connector->panel);
}
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Intel-gfx] [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs
2016-06-10 12:28 ` [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs Mika Kahola
@ 2016-06-10 12:46 ` kbuild test robot
2016-06-10 15:22 ` kbuild test robot
1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2016-06-10 12:46 UTC (permalink / raw)
To: Mika Kahola; +Cc: intel-gfx, kbuild-all, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]
Hi,
[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.7-rc2 next-20160609]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mika-Kahola/drm-i915-DP-branch-devices/20160610-203119
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: i386-defconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/i915_debugfs.c: In function 'intel_dp_info':
>> drivers/gpu/drm/i915/i915_debugfs.c:2954:10: warning: unused variable 'cap' [-Wunused-variable]
uint8_t cap[4];
^~~
>> drivers/gpu/drm/i915/i915_debugfs.c:2953:6: warning: unused variable 'cap_size' [-Wunused-variable]
int cap_size;
^~~~~~~~
vim +/cap +2954 drivers/gpu/drm/i915/i915_debugfs.c
2947 bool is_branch_device;
2948 bool detailed_cap_info = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
2949 DP_DETAILED_CAP_INFO_AVAILABLE;
2950 int type;
2951 int clk;
2952 int bpc;
> 2953 int cap_size;
> 2954 uint8_t cap[4];
2955 char id[6];
2956
2957 seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24880 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* ✗ Ro.CI.BAT: warning for drm/i915: DP branch devices (rev5)
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
` (9 preceding siblings ...)
2016-06-10 12:28 ` [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs Mika Kahola
@ 2016-06-10 12:47 ` Patchwork
10 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2016-06-10 12:47 UTC (permalink / raw)
To: Mika Kahola; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: DP branch devices (rev5)
URL : https://patchwork.freedesktop.org/series/6658/
State : warning
== Summary ==
Series 6658v5 drm/i915: DP branch devices
http://patchwork.freedesktop.org/api/1.0/series/6658/revisions/5/mbox
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
fail -> PASS (ro-bdw-i7-5600u)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
skip -> DMESG-WARN (ro-bdw-i5-5250u)
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> SKIP (ro-bdw-i5-5250u)
ro-bdw-i5-5250u total:213 pass:197 dwarn:2 dfail:0 fail:0 skip:14
ro-bdw-i7-5557U total:213 pass:197 dwarn:1 dfail:0 fail:0 skip:15
ro-bdw-i7-5600u total:213 pass:185 dwarn:0 dfail:0 fail:0 skip:28
ro-bsw-n3050 total:213 pass:172 dwarn:0 dfail:0 fail:2 skip:39
ro-byt-n2820 total:213 pass:174 dwarn:0 dfail:0 fail:2 skip:37
ro-hsw-i3-4010u total:213 pass:190 dwarn:0 dfail:0 fail:0 skip:23
ro-hsw-i7-4770r total:213 pass:190 dwarn:0 dfail:0 fail:0 skip:23
ro-ilk-i7-620lm total:213 pass:150 dwarn:0 dfail:0 fail:1 skip:62
ro-ilk1-i5-650 total:208 pass:150 dwarn:0 dfail:0 fail:1 skip:57
ro-ivb-i7-3770 total:213 pass:181 dwarn:0 dfail:0 fail:0 skip:32
ro-ivb2-i7-3770 total:213 pass:185 dwarn:0 dfail:0 fail:0 skip:28
ro-snb-i7-2620M total:213 pass:174 dwarn:0 dfail:0 fail:1 skip:38
fi-hsw-i7-4770k failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1157/
b373842 drm-intel-nightly: 2016y-06m-09d-16h-49m-09s UTC integration manifest
8395b91 drm/i915: Add DP branch device info on debugfs
7826a6e drm/i915: Update bits per component for display info
655e8d7 drm/i915: Check pixel rate for DP to VGA dongle
45e1784 drm: Read DP branch device SW revision
e97d307 drm: Read DP branch device HW revision
7d881c0 drm: Read DP branch device id
2267452 drm: Helper to read max bits per component
8c4d678 drm: Helper to read max clock rate
67038d0 drm: Drop VGA from bpc definitions
3d67f7a drm: Add missing DP downstream port types
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Intel-gfx] [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs
2016-06-10 12:28 ` [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs Mika Kahola
2016-06-10 12:46 ` [Intel-gfx] " kbuild test robot
@ 2016-06-10 15:22 ` kbuild test robot
1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2016-06-10 15:22 UTC (permalink / raw)
To: Mika Kahola; +Cc: intel-gfx, kbuild-all, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
Hi,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.7-rc2 next-20160609]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mika-Kahola/drm-i915-DP-branch-devices/20160610-203119
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-s1-06102203 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/i915_debugfs.c: In function 'intel_dp_info':
>> drivers/gpu/drm/i915/i915_debugfs.c:2954:10: error: unused variable 'cap' [-Werror=unused-variable]
uint8_t cap[4];
^~~
>> drivers/gpu/drm/i915/i915_debugfs.c:2953:6: error: unused variable 'cap_size' [-Werror=unused-variable]
int cap_size;
^~~~~~~~
cc1: all warnings being treated as errors
vim +/cap +2954 drivers/gpu/drm/i915/i915_debugfs.c
2947 bool is_branch_device;
2948 bool detailed_cap_info = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
2949 DP_DETAILED_CAP_INFO_AVAILABLE;
2950 int type;
2951 int clk;
2952 int bpc;
> 2953 int cap_size;
> 2954 uint8_t cap[4];
2955 char id[6];
2956
2957 seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 27102 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-06-10 15:22 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 12:27 [PATCH v5 00/10] drm/i915: DP branch devices Mika Kahola
2016-06-10 12:27 ` [PATCH v5 01/10] drm: Add missing DP downstream port types Mika Kahola
2016-06-10 12:27 ` [PATCH v5 02/10] drm: Drop VGA from bpc definitions Mika Kahola
2016-06-10 12:27 ` [PATCH v5 03/10] drm: Helper to read max clock rate Mika Kahola
2016-06-10 12:27 ` [PATCH v5 04/10] drm: Helper to read max bits per component Mika Kahola
2016-06-10 12:28 ` [PATCH v5 05/10] drm: Read DP branch device id Mika Kahola
2016-06-10 12:28 ` [PATCH v5 06/10] drm: Read DP branch device HW revision Mika Kahola
2016-06-10 12:28 ` [PATCH v5 07/10] drm: Read DP branch device SW revision Mika Kahola
2016-06-10 12:28 ` [PATCH v5 08/10] drm/i915: Check pixel rate for DP to VGA dongle Mika Kahola
2016-06-10 12:28 ` [PATCH v5 09/10] drm/i915: Update bits per component for display info Mika Kahola
2016-06-10 12:28 ` [PATCH v5 10/10] drm/i915: Add DP branch device info on debugfs Mika Kahola
2016-06-10 12:46 ` [Intel-gfx] " kbuild test robot
2016-06-10 15:22 ` kbuild test robot
2016-06-10 12:47 ` ✗ Ro.CI.BAT: warning for drm/i915: DP branch devices (rev5) Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.