* [PATCH 1/2] drm/dp: Document DP spec versions for various DPCD registers
@ 2012-09-20 20:42 Adam Jackson
2012-09-20 20:42 ` [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware Adam Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Adam Jackson @ 2012-09-20 20:42 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
Note with a comment anything newer than DP 1.1a.
Obviously this needs some work still...
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
include/drm/drm_dp_helper.h | 52 ++++++++++++++++++++++++++----------------
1 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index f9888c3..38ffcb4 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -26,7 +26,19 @@
#include <linux/types.h>
#include <linux/i2c.h>
-/* From the VESA DisplayPort spec */
+/*
+ * Unless otherwise noted, all values are from the DP 1.1a spec. Note that
+ * DP and DPCD versions are independent. Differences from 1.0 are not noted,
+ * 1.0 devices basically don't exist in the wild.
+ *
+ * Abbreviations, in chronological order:
+ *
+ * eDP: Embedded DisplayPort version 1
+ * DPI: DisplayPort Interoperability Guideline v1.1a
+ * 1.2: DisplayPort 1.2
+ *
+ * 1.2 formally includes both eDP and DPI definitions.
+ */
#define AUX_NATIVE_WRITE 0x8
#define AUX_NATIVE_READ 0x9
@@ -53,7 +65,7 @@
#define DP_MAX_LANE_COUNT 0x002
# define DP_MAX_LANE_COUNT_MASK 0x1f
-# define DP_TPS3_SUPPORTED (1 << 6)
+# define DP_TPS3_SUPPORTED (1 << 6) /* 1.2 */
# define DP_ENHANCED_FRAME_CAP (1 << 7)
#define DP_MAX_DOWNSPREAD 0x003
@@ -69,16 +81,16 @@
/* 10b = TMDS or HDMI */
/* 11b = Other */
# define DP_FORMAT_CONVERSION (1 << 3)
-# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4)
+# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */
#define DP_MAIN_LINK_CHANNEL_CODING 0x006
#define DP_DOWN_STREAM_PORT_COUNT 0x007
# define DP_PORT_COUNT_MASK 0x0f
-# define DP_MSA_TIMING_PAR_IGNORED (1 << 6)
+# define DP_MSA_TIMING_PAR_IGNORED (1 << 6) /* eDP */
# define DP_OUI_SUPPORT (1 << 7)
-#define DP_I2C_SPEED_CAP 0x00c
+#define DP_I2C_SPEED_CAP 0x00c /* DPI */
# define DP_I2C_SPEED_1K 0x01
# define DP_I2C_SPEED_5K 0x02
# define DP_I2C_SPEED_10K 0x04
@@ -86,16 +98,16 @@
# define DP_I2C_SPEED_400K 0x10
# define DP_I2C_SPEED_1M 0x20
-#define DP_EDP_CONFIGURATION_CAP 0x00d
-#define DP_TRAINING_AUX_RD_INTERVAL 0x00e
+#define DP_EDP_CONFIGURATION_CAP 0x00d /* XXX 1.2? */
+#define DP_TRAINING_AUX_RD_INTERVAL 0x00e /* XXX 1.2? */
/* Multiple stream transport */
-#define DP_MSTM_CAP 0x021
+#define DP_MSTM_CAP 0x021 /* 1.2 */
# define DP_MST_CAP (1 << 0)
-#define DP_PSR_SUPPORT 0x070
+#define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */
# define DP_PSR_IS_SUPPORTED 1
-#define DP_PSR_CAPS 0x071
+#define DP_PSR_CAPS 0x071 /* XXX 1.2? */
# define DP_PSR_NO_TRAIN_ON_EXIT 1
# define DP_PSR_SETUP_TIME_330 (0 << 1)
# define DP_PSR_SETUP_TIME_275 (1 << 1)
@@ -136,7 +148,7 @@
#define DP_LINK_BW_SET 0x100
# define DP_LINK_BW_1_62 0x06
# define DP_LINK_BW_2_7 0x0a
-# define DP_LINK_BW_5_4 0x14
+# define DP_LINK_BW_5_4 0x14 /* 1.2 */
#define DP_LANE_COUNT_SET 0x101
# define DP_LANE_COUNT_MASK 0x0f
@@ -146,7 +158,7 @@
# define DP_TRAINING_PATTERN_DISABLE 0
# define DP_TRAINING_PATTERN_1 1
# define DP_TRAINING_PATTERN_2 2
-# define DP_TRAINING_PATTERN_3 3
+# define DP_TRAINING_PATTERN_3 3 /* 1.2 */
# define DP_TRAINING_PATTERN_MASK 0x3
# define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2)
@@ -187,22 +199,22 @@
#define DP_DOWNSPREAD_CTRL 0x107
# define DP_SPREAD_AMP_0_5 (1 << 4)
-# define DP_MSA_TIMING_PAR_IGNORE_EN (1 << 7)
+# define DP_MSA_TIMING_PAR_IGNORE_EN (1 << 7) /* eDP */
#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108
# define DP_SET_ANSI_8B10B (1 << 0)
-#define DP_I2C_SPEED_CONTROL_STATUS 0x109
+#define DP_I2C_SPEED_CONTROL_STATUS 0x109 /* DPI */
/* bitmask as for DP_I2C_SPEED_CAP */
-#define DP_EDP_CONFIGURATION_SET 0x10a
+#define DP_EDP_CONFIGURATION_SET 0x10a /* XXX 1.2? */
-#define DP_MSTM_CTRL 0x111
+#define DP_MSTM_CTRL 0x111 /* 1.2 */
# define DP_MST_EN (1 << 0)
# define DP_UP_REQ_EN (1 << 1)
# define DP_UPSTREAM_IS_SRC (1 << 2)
-#define DP_PSR_EN_CFG 0x170
+#define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */
# define DP_PSR_ENABLE (1 << 0)
# define DP_PSR_MAIN_LINK_ACTIVE (1 << 1)
# define DP_PSR_CRC_VERIFICATION (1 << 2)
@@ -277,14 +289,14 @@
# define DP_SET_POWER_D0 0x1
# define DP_SET_POWER_D3 0x2
-#define DP_PSR_ERROR_STATUS 0x2006
+#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */
# define DP_PSR_LINK_CRC_ERROR (1 << 0)
# define DP_PSR_RFB_STORAGE_ERROR (1 << 1)
-#define DP_PSR_ESI 0x2007
+#define DP_PSR_ESI 0x2007 /* XXX 1.2? */
# define DP_PSR_CAPS_CHANGE (1 << 0)
-#define DP_PSR_STATUS 0x2008
+#define DP_PSR_STATUS 0x2008 /* XXX 1.2? */
# define DP_PSR_SINK_INACTIVE 0
# define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1
# define DP_PSR_SINK_ACTIVE_RFB 2
--
1.7.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware
2012-09-20 20:42 [PATCH 1/2] drm/dp: Document DP spec versions for various DPCD registers Adam Jackson
@ 2012-09-20 20:42 ` Adam Jackson
2012-09-20 21:45 ` Paulo Zanoni
0 siblings, 1 reply; 4+ messages in thread
From: Adam Jackson @ 2012-09-20 20:42 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
drivers/gpu/drm/i915/intel_dp.c | 9 ++++-----
include/drm/drm_dp_helper.h | 3 ++-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 813b771..00f99e5 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2106,13 +2106,12 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
/* If we're HPD-aware, SINK_COUNT changes dynamically */
hpd = !!(intel_dp->downstream_ports[0] & DP_DS_PORT_HPD);
if (hpd) {
- uint8_t sink_count;
+ uint8_t reg;
if (!intel_dp_aux_native_read_retry(intel_dp, DP_SINK_COUNT,
- &sink_count, 1))
+ ®, 1))
return connector_status_unknown;
- sink_count &= DP_SINK_COUNT_MASK;
- return sink_count ? connector_status_connected
- : connector_status_disconnected;
+ return DP_GET_SINK_COUNT(reg) ? connector_status_connected
+ : connector_status_disconnected;
}
/* If no HPD, poke DDC gently */
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 38ffcb4..fe06148 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -221,7 +221,8 @@
# define DP_PSR_FRAME_CAPTURE (1 << 3)
#define DP_SINK_COUNT 0x200
-# define DP_SINK_COUNT_MASK (31 << 0)
+/* prior to 1.2 bit 7 was reserved mbz */
+# define DP_GET_SINK_COUNT(x) ((((x) & 0x80) >> 1) | ((x) & 0x3f))
# define DP_SINK_CP_READY (1 << 6)
#define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201
--
1.7.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware
2012-09-20 20:42 ` [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware Adam Jackson
@ 2012-09-20 21:45 ` Paulo Zanoni
2012-09-26 12:43 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Paulo Zanoni @ 2012-09-20 21:45 UTC (permalink / raw)
To: Adam Jackson; +Cc: intel-gfx, dri-devel
2012/9/20 Adam Jackson <ajax@redhat.com>:
> Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 9 ++++-----
> include/drm/drm_dp_helper.h | 3 ++-
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 813b771..00f99e5 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2106,13 +2106,12 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> /* If we're HPD-aware, SINK_COUNT changes dynamically */
> hpd = !!(intel_dp->downstream_ports[0] & DP_DS_PORT_HPD);
> if (hpd) {
> - uint8_t sink_count;
> + uint8_t reg;
> if (!intel_dp_aux_native_read_retry(intel_dp, DP_SINK_COUNT,
> - &sink_count, 1))
> + ®, 1))
> return connector_status_unknown;
> - sink_count &= DP_SINK_COUNT_MASK;
> - return sink_count ? connector_status_connected
> - : connector_status_disconnected;
> + return DP_GET_SINK_COUNT(reg) ? connector_status_connected
> + : connector_status_disconnected;
> }
>
> /* If no HPD, poke DDC gently */
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 38ffcb4..fe06148 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -221,7 +221,8 @@
> # define DP_PSR_FRAME_CAPTURE (1 << 3)
>
> #define DP_SINK_COUNT 0x200
> -# define DP_SINK_COUNT_MASK (31 << 0)
> +/* prior to 1.2 bit 7 was reserved mbz */
> +# define DP_GET_SINK_COUNT(x) ((((x) & 0x80) >> 1) | ((x) & 0x3f))
> # define DP_SINK_CP_READY (1 << 6)
>
> #define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201
> --
> 1.7.7.6
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Paulo Zanoni
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware
2012-09-20 21:45 ` Paulo Zanoni
@ 2012-09-26 12:43 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2012-09-26 12:43 UTC (permalink / raw)
To: Paulo Zanoni; +Cc: intel-gfx, dri-devel
On Thu, Sep 20, 2012 at 06:45:29PM -0300, Paulo Zanoni wrote:
> 2012/9/20 Adam Jackson <ajax@redhat.com>:
> > Signed-off-by: Adam Jackson <ajax@redhat.com>
>
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Both patches merged to dinq (again with Dave's irc-ack for the common
stuff).
Thanks, Daniel
>
> > ---
> > drivers/gpu/drm/i915/intel_dp.c | 9 ++++-----
> > include/drm/drm_dp_helper.h | 3 ++-
> > 2 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index 813b771..00f99e5 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -2106,13 +2106,12 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> > /* If we're HPD-aware, SINK_COUNT changes dynamically */
> > hpd = !!(intel_dp->downstream_ports[0] & DP_DS_PORT_HPD);
> > if (hpd) {
> > - uint8_t sink_count;
> > + uint8_t reg;
> > if (!intel_dp_aux_native_read_retry(intel_dp, DP_SINK_COUNT,
> > - &sink_count, 1))
> > + ®, 1))
> > return connector_status_unknown;
> > - sink_count &= DP_SINK_COUNT_MASK;
> > - return sink_count ? connector_status_connected
> > - : connector_status_disconnected;
> > + return DP_GET_SINK_COUNT(reg) ? connector_status_connected
> > + : connector_status_disconnected;
> > }
> >
> > /* If no HPD, poke DDC gently */
> > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> > index 38ffcb4..fe06148 100644
> > --- a/include/drm/drm_dp_helper.h
> > +++ b/include/drm/drm_dp_helper.h
> > @@ -221,7 +221,8 @@
> > # define DP_PSR_FRAME_CAPTURE (1 << 3)
> >
> > #define DP_SINK_COUNT 0x200
> > -# define DP_SINK_COUNT_MASK (31 << 0)
> > +/* prior to 1.2 bit 7 was reserved mbz */
> > +# define DP_GET_SINK_COUNT(x) ((((x) & 0x80) >> 1) | ((x) & 0x3f))
> > # define DP_SINK_CP_READY (1 << 6)
> >
> > #define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201
> > --
> > 1.7.7.6
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> --
> Paulo Zanoni
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-26 12:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 20:42 [PATCH 1/2] drm/dp: Document DP spec versions for various DPCD registers Adam Jackson
2012-09-20 20:42 ` [PATCH 2/2] drm/dp: Make sink count DP 1.2 aware Adam Jackson
2012-09-20 21:45 ` Paulo Zanoni
2012-09-26 12:43 ` Daniel Vetter
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.