public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/dp: add defines for downstream port types
@ 2013-09-27 11:48 Jani Nikula
  2013-09-27 11:48 ` [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jani Nikula @ 2013-09-27 11:48 UTC (permalink / raw)
  To: dri-devel, intel-gfx

Detailed cap info at address 80h is not available with DPCD ver
1.0. Whether such devices exist in the wild I don't know, but there
should be no harm done in having the defines for downstream port 0 in
address 05h.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/drm/drm_dp_helper.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index ae8dbfb..83da4eb 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -77,10 +77,10 @@
 #define DP_DOWNSTREAMPORT_PRESENT           0x005
 # define DP_DWN_STRM_PORT_PRESENT           (1 << 0)
 # define DP_DWN_STRM_PORT_TYPE_MASK         0x06
-/* 00b = DisplayPort */
-/* 01b = Analog */
-/* 10b = TMDS or HDMI */
-/* 11b = Other */
+# define DP_DWN_STRM_PORT_TYPE_DP           (0 << 1)
+# define DP_DWN_STRM_PORT_TYPE_ANALOG       (1 << 1)
+# define DP_DWN_STRM_PORT_TYPE_TMDS         (2 << 1)
+# define DP_DWN_STRM_PORT_TYPE_OTHER        (3 << 1)
 # define DP_FORMAT_CONVERSION               (1 << 3)
 # define DP_DETAILED_CAP_INFO_AVAILABLE	    (1 << 4) /* DPI */
 
-- 
1.7.9.5

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

* [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0
  2013-09-27 11:48 [PATCH 1/2] drm/dp: add defines for downstream port types Jani Nikula
@ 2013-09-27 11:48 ` Jani Nikula
  2013-09-27 17:30   ` Adam Jackson
  2013-09-27 19:06 ` [PATCH 1/2] drm/dp: add defines for downstream port types Todd Previte
  2013-09-27 21:20 ` Alex Deucher
  2 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2013-09-27 11:48 UTC (permalink / raw)
  To: dri-devel, intel-gfx

We haven't read the downstream port caps for DPCD 1.0, so don't use
them.

v2: use defines for DPCD 1.0 downstream port types

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 95a3159..2f04f0f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2817,7 +2817,6 @@ static enum drm_connector_status
 intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 {
 	uint8_t *dpcd = intel_dp->dpcd;
-	bool hpd;
 	uint8_t type;
 
 	if (!intel_dp_get_dpcd(intel_dp))
@@ -2828,8 +2827,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 		return connector_status_connected;
 
 	/* If we're HPD-aware, SINK_COUNT changes dynamically */
-	hpd = !!(intel_dp->downstream_ports[0] & DP_DS_PORT_HPD);
-	if (hpd) {
+	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
+	    intel_dp->downstream_ports[0] & DP_DS_PORT_HPD) {
 		uint8_t reg;
 		if (!intel_dp_aux_native_read_retry(intel_dp, DP_SINK_COUNT,
 						    &reg, 1))
@@ -2843,9 +2842,18 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 		return connector_status_connected;
 
 	/* Well we tried, say unknown for unreliable port types */
-	type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
-	if (type == DP_DS_PORT_TYPE_VGA || type == DP_DS_PORT_TYPE_NON_EDID)
-		return connector_status_unknown;
+	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {
+		type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
+		if (type == DP_DS_PORT_TYPE_VGA ||
+		    type == DP_DS_PORT_TYPE_NON_EDID)
+			return connector_status_unknown;
+	} else {
+		type = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+			DP_DWN_STRM_PORT_TYPE_MASK;
+		if (type == DP_DWN_STRM_PORT_TYPE_ANALOG ||
+		    type == DP_DWN_STRM_PORT_TYPE_OTHER)
+			return connector_status_unknown;
+	}
 
 	/* Anything else is out of spec, warn and ignore */
 	DRM_DEBUG_KMS("Broken DP branch device, ignoring\n");
-- 
1.7.9.5

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

* Re: [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0
  2013-09-27 11:48 ` [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 Jani Nikula
@ 2013-09-27 17:30   ` Adam Jackson
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Jackson @ 2013-09-27 17:30 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel

On Fri, 2013-09-27 at 14:48 +0300, Jani Nikula wrote:
> We haven't read the downstream port caps for DPCD 1.0, so don't use
> them.
> 
> v2: use defines for DPCD 1.0 downstream port types
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

I don't know if I've ever seen a DPCD 1.0 device, but the changes make
sense.  For the series:

Reviewed-by: Adam Jackson <ajax@redhat.com>

- ajax

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

* Re: [PATCH 1/2] drm/dp: add defines for downstream port types
  2013-09-27 11:48 [PATCH 1/2] drm/dp: add defines for downstream port types Jani Nikula
  2013-09-27 11:48 ` [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 Jani Nikula
@ 2013-09-27 19:06 ` Todd Previte
  2013-09-27 21:20 ` Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Todd Previte @ 2013-09-27 19:06 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1356 bytes --]

Looks good.


Reviewed-by: Todd Previte <tprevite@gmail.com>


On Fri, Sep 27, 2013 at 4:48 AM, Jani Nikula <jani.nikula@intel.com> wrote:

> Detailed cap info at address 80h is not available with DPCD ver
> 1.0. Whether such devices exist in the wild I don't know, but there
> should be no harm done in having the defines for downstream port 0 in
> address 05h.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  include/drm/drm_dp_helper.h |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index ae8dbfb..83da4eb 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -77,10 +77,10 @@
>  #define DP_DOWNSTREAMPORT_PRESENT           0x005
>  # define DP_DWN_STRM_PORT_PRESENT           (1 << 0)
>  # define DP_DWN_STRM_PORT_TYPE_MASK         0x06
> -/* 00b = DisplayPort */
> -/* 01b = Analog */
> -/* 10b = TMDS or HDMI */
> -/* 11b = Other */
> +# define DP_DWN_STRM_PORT_TYPE_DP           (0 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_ANALOG       (1 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_TMDS         (2 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_OTHER        (3 << 1)
>  # define DP_FORMAT_CONVERSION               (1 << 3)
>  # define DP_DETAILED_CAP_INFO_AVAILABLE            (1 << 4) /* DPI */
>
> --
> 1.7.9.5
>
>

[-- Attachment #1.2: Type: text/html, Size: 1986 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH 1/2] drm/dp: add defines for downstream port types
  2013-09-27 11:48 [PATCH 1/2] drm/dp: add defines for downstream port types Jani Nikula
  2013-09-27 11:48 ` [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 Jani Nikula
  2013-09-27 19:06 ` [PATCH 1/2] drm/dp: add defines for downstream port types Todd Previte
@ 2013-09-27 21:20 ` Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2013-09-27 21:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Intel Graphics Development, Maling list - DRI developers

On Fri, Sep 27, 2013 at 7:48 AM, Jani Nikula <jani.nikula@intel.com> wrote:
> Detailed cap info at address 80h is not available with DPCD ver
> 1.0. Whether such devices exist in the wild I don't know, but there
> should be no harm done in having the defines for downstream port 0 in
> address 05h.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  include/drm/drm_dp_helper.h |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index ae8dbfb..83da4eb 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -77,10 +77,10 @@
>  #define DP_DOWNSTREAMPORT_PRESENT           0x005
>  # define DP_DWN_STRM_PORT_PRESENT           (1 << 0)
>  # define DP_DWN_STRM_PORT_TYPE_MASK         0x06
> -/* 00b = DisplayPort */
> -/* 01b = Analog */
> -/* 10b = TMDS or HDMI */
> -/* 11b = Other */
> +# define DP_DWN_STRM_PORT_TYPE_DP           (0 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_ANALOG       (1 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_TMDS         (2 << 1)
> +# define DP_DWN_STRM_PORT_TYPE_OTHER        (3 << 1)
>  # define DP_FORMAT_CONVERSION               (1 << 3)
>  # define DP_DETAILED_CAP_INFO_AVAILABLE            (1 << 4) /* DPI */
>
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2013-09-27 21:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 11:48 [PATCH 1/2] drm/dp: add defines for downstream port types Jani Nikula
2013-09-27 11:48 ` [PATCH 2/2] drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 Jani Nikula
2013-09-27 17:30   ` Adam Jackson
2013-09-27 19:06 ` [PATCH 1/2] drm/dp: add defines for downstream port types Todd Previte
2013-09-27 21:20 ` Alex Deucher

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