intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: Print some debug/error info during DP dual mode detect
@ 2016-10-26 14:50 Imre Deak
  2016-10-26 15:10 ` Ville Syrjälä
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Imre Deak @ 2016-10-26 14:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

There's at least one LSPCON device that occasionally returns an unexpected
adaptor ID which leads to a failed detect. Print some debug info to help
debugging this and future cases. Also print an error for an unexpected
adaptor ID, so users can report it.

Cc: dri-devel@lists.freedesktop.org
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index 488355b..a0e603b 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
 		      sizeof(dp_dual_mode_hdmi_id)) == 0;
 }
 
+static bool is_type1_adaptor(uint8_t adaptor_id)
+{
+	return adaptor_id == 0 || adaptor_id == 0xff;
+}
+
 static bool is_type2_adaptor(uint8_t adaptor_id)
 {
 	return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
@@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 	 */
 	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
 				    hdmi_id, sizeof(hdmi_id));
+	DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
+		      ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);
 	if (ret)
 		return DRM_DP_DUAL_MODE_UNKNOWN;
 
@@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 	 */
 	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
 				    &adaptor_id, sizeof(adaptor_id));
+	DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
+		      adaptor_id, ret);
 	if (ret == 0) {
 		if (is_lspcon_adaptor(hdmi_id, adaptor_id))
 			return DRM_DP_DUAL_MODE_LSPCON;
@@ -219,6 +228,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 			else
 				return DRM_DP_DUAL_MODE_TYPE2_DVI;
 		}
+		if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
+			DRM_ERROR("Unexpected DP dual mode adapter ID %02x\n",
+				  adaptor_id);
+
 	}
 
 	if (is_hdmi_adaptor(hdmi_id))
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: Print some debug/error info during DP dual mode detect
  2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
@ 2016-10-26 15:10 ` Ville Syrjälä
  2016-10-26 15:27   ` Imre Deak
  2016-10-26 15:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2016-10-26 15:10 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx, dri-devel

On Wed, Oct 26, 2016 at 05:50:08PM +0300, Imre Deak wrote:
> There's at least one LSPCON device that occasionally returns an unexpected
> adaptor ID which leads to a failed detect. Print some debug info to help
> debugging this and future cases. Also print an error for an unexpected
> adaptor ID, so users can report it.
> 
> Cc: dri-devel@lists.freedesktop.org
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> index 488355b..a0e603b 100644
> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> @@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
>  		      sizeof(dp_dual_mode_hdmi_id)) == 0;
>  }
>  
> +static bool is_type1_adaptor(uint8_t adaptor_id)
> +{
> +	return adaptor_id == 0 || adaptor_id == 0xff;
> +}
> +
>  static bool is_type2_adaptor(uint8_t adaptor_id)
>  {
>  	return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
> @@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>  	 */
>  	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
>  				    hdmi_id, sizeof(hdmi_id));
> +	DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
> +		      ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);

What does that %*pE print with size==0, nothing?

>  	if (ret)
>  		return DRM_DP_DUAL_MODE_UNKNOWN;
>  
> @@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>  	 */
>  	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
>  				    &adaptor_id, sizeof(adaptor_id));
> +	DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
> +		      adaptor_id, ret);
>  	if (ret == 0) {
>  		if (is_lspcon_adaptor(hdmi_id, adaptor_id))
>  			return DRM_DP_DUAL_MODE_LSPCON;
> @@ -219,6 +228,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>  			else
>  				return DRM_DP_DUAL_MODE_TYPE2_DVI;
>  		}
> +		if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^
I take it that was to account for the broken adaptors that ignore the
offset?

> +			DRM_ERROR("Unexpected DP dual mode adapter ID %02x\n",
> +				  adaptor_id);

s/adapter/adaptor/ since that's what the spec called it, and I continued
down the same path to not confuse it the the i2c adapter.

With that
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +
>  	}
>  
>  	if (is_hdmi_adaptor(hdmi_id))
> -- 
> 2.5.0

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Print some debug/error info during DP dual mode detect
  2016-10-26 15:10 ` Ville Syrjälä
@ 2016-10-26 15:27   ` Imre Deak
  0 siblings, 0 replies; 7+ messages in thread
From: Imre Deak @ 2016-10-26 15:27 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, dri-devel

On Wed, 2016-10-26 at 18:10 +0300, Ville Syrjälä wrote:
> On Wed, Oct 26, 2016 at 05:50:08PM +0300, Imre Deak wrote:
> > There's at least one LSPCON device that occasionally returns an unexpected
> > adaptor ID which leads to a failed detect. Print some debug info to help
> > debugging this and future cases. Also print an error for an unexpected
> > adaptor ID, so users can report it.
> > 
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > index 488355b..a0e603b 100644
> > --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > @@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
> >  		      sizeof(dp_dual_mode_hdmi_id)) == 0;
> >  }
> >  
> > +static bool is_type1_adaptor(uint8_t adaptor_id)
> > +{
> > +	return adaptor_id == 0 || adaptor_id == 0xff;
> > +}
> > +
> >  static bool is_type2_adaptor(uint8_t adaptor_id)
> >  {
> >  	return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
> > @@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> >  	 */
> >  	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
> >  				    hdmi_id, sizeof(hdmi_id));
> > +	DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
> > +		      ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);
> 
> What does that %*pE print with size==0, nothing?

Yes.

> >  	if (ret)
> >  		return DRM_DP_DUAL_MODE_UNKNOWN;
> >  
> > @@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> >  	 */
> >  	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
> >  				    &adaptor_id, sizeof(adaptor_id));
> > +	DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
> > +		      adaptor_id, ret);
> >  	if (ret == 0) {
> >  		if (is_lspcon_adaptor(hdmi_id, adaptor_id))
> >  			return DRM_DP_DUAL_MODE_LSPCON;
> > @@ -219,6 +228,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> >  			else
> >  				return DRM_DP_DUAL_MODE_TYPE2_DVI;
> >  		}
> > +		if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
>                                                      ^^^^^^^^^^^^^^^^^^^^^^^^
> I take it that was to account for the broken adaptors that ignore the
> offset?

Yep.

> > +			DRM_ERROR("Unexpected DP dual mode adapter ID %02x\n",
> > +				  adaptor_id);
> 
> s/adapter/adaptor/ since that's what the spec called it, and I continued
> down the same path to not confuse it the the i2c adapter.

Ok.

> With that
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> > +
> >  	}
> >  
> >  	if (is_hdmi_adaptor(hdmi_id))
> > -- 
> > 2.5.0
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* ✗ Fi.CI.BAT: failure for drm: Print some debug/error info during DP dual mode detect
  2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
  2016-10-26 15:10 ` Ville Syrjälä
@ 2016-10-26 15:53 ` Patchwork
  2016-10-26 16:29 ` [PATCH v2] " Imre Deak
  2016-10-26 17:16 ` ✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2) Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-10-26 15:53 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

== Series Details ==

Series: drm: Print some debug/error info during DP dual mode detect
URL   : https://patchwork.freedesktop.org/series/14412/
State : failure

== Summary ==

Series 14412v1 drm: Print some debug/error info during DP dual mode detect
https://patchwork.freedesktop.org/api/1.0/series/14412/revisions/1/mbox/

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                pass       -> INCOMPLETE (fi-skl-6260u)

fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:246  pass:204  dwarn:0   dfail:0   fail:0   skip:42 
fi-bxt-t5700     total:246  pass:216  dwarn:0   dfail:0   fail:0   skip:30 
fi-byt-j1900     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-byt-n2820     total:246  pass:211  dwarn:0   dfail:0   fail:0   skip:35 
fi-hsw-4770      total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-ilk-650       total:246  pass:185  dwarn:0   dfail:0   fail:0   skip:61 
fi-ivb-3520m     total:246  pass:220  dwarn:0   dfail:0   fail:0   skip:26 
fi-ivb-3770      total:246  pass:220  dwarn:0   dfail:0   fail:0   skip:26 
fi-kbl-7200u     total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:24 
fi-skl-6260u     total:210  pass:197  dwarn:0   dfail:0   fail:0   skip:12 
fi-skl-6700hq    total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-skl-6700k     total:246  pass:222  dwarn:1   dfail:0   fail:0   skip:23 
fi-skl-6770hq    total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:246  pass:209  dwarn:0   dfail:0   fail:0   skip:37 
fi-snb-2600      total:246  pass:208  dwarn:0   dfail:0   fail:0   skip:38 

fe116755dd4cf23c17c8ad50227ca4376480d015 drm-intel-nightly: 2016y-10m-26d-14h-34m-03s UTC integration manifest
5cff751 drm: Print some debug/error info during DP dual mode detect

Full results at https://intel-gfx-ci.01.org/CI/Patchwork_2825/

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2825/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm: Print some debug/error info during DP dual mode detect
  2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
  2016-10-26 15:10 ` Ville Syrjälä
  2016-10-26 15:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2016-10-26 16:29 ` Imre Deak
  2016-10-26 19:59   ` Sean Paul
  2016-10-26 17:16 ` ✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2) Patchwork
  3 siblings, 1 reply; 7+ messages in thread
From: Imre Deak @ 2016-10-26 16:29 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

There's at least one LSPCON device that occasionally returns an unexpected
adaptor ID which leads to a failed detect. Print some debug info to help
debugging this and future cases. Also print an error for an unexpected
adaptor ID, so users can report it.

v2:
- s/adapter/adaptor/ and add code comment about incorrect type 1 adaptor
  IDs. (Ville)

Cc: dri-devel@lists.freedesktop.org
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index 488355b..e025639 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
 		      sizeof(dp_dual_mode_hdmi_id)) == 0;
 }
 
+static bool is_type1_adaptor(uint8_t adaptor_id)
+{
+	return adaptor_id == 0 || adaptor_id == 0xff;
+}
+
 static bool is_type2_adaptor(uint8_t adaptor_id)
 {
 	return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
@@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 	 */
 	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
 				    hdmi_id, sizeof(hdmi_id));
+	DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
+		      ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);
 	if (ret)
 		return DRM_DP_DUAL_MODE_UNKNOWN;
 
@@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 	 */
 	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
 				    &adaptor_id, sizeof(adaptor_id));
+	DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
+		      adaptor_id, ret);
 	if (ret == 0) {
 		if (is_lspcon_adaptor(hdmi_id, adaptor_id))
 			return DRM_DP_DUAL_MODE_LSPCON;
@@ -219,6 +228,15 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
 			else
 				return DRM_DP_DUAL_MODE_TYPE2_DVI;
 		}
+		/*
+		 * If neither a proper type 1 ID nor a broken type 1 adaptor
+		 * as described above, assume type 1, but let the user know
+		 * that we may have misdetected the type.
+		 */
+		if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
+			DRM_ERROR("Unexpected DP dual mode adaptor ID %02x\n",
+				  adaptor_id);
+
 	}
 
 	if (is_hdmi_adaptor(hdmi_id))
-- 
2.5.0

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

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

* ✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2)
  2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
                   ` (2 preceding siblings ...)
  2016-10-26 16:29 ` [PATCH v2] " Imre Deak
@ 2016-10-26 17:16 ` Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-10-26 17:16 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

== Series Details ==

Series: drm: Print some debug/error info during DP dual mode detect (rev2)
URL   : https://patchwork.freedesktop.org/series/14412/
State : success

== Summary ==

Series 14412v2 drm: Print some debug/error info during DP dual mode detect
https://patchwork.freedesktop.org/api/1.0/series/14412/revisions/2/mbox/


fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:246  pass:204  dwarn:0   dfail:0   fail:0   skip:42 
fi-bxt-t5700     total:246  pass:216  dwarn:0   dfail:0   fail:0   skip:30 
fi-byt-j1900     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-byt-n2820     total:246  pass:211  dwarn:0   dfail:0   fail:0   skip:35 
fi-hsw-4770      total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-ilk-650       total:246  pass:185  dwarn:0   dfail:0   fail:0   skip:61 
fi-ivb-3520m     total:246  pass:220  dwarn:0   dfail:0   fail:0   skip:26 
fi-ivb-3770      total:246  pass:220  dwarn:0   dfail:0   fail:0   skip:26 
fi-kbl-7200u     total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:24 
fi-skl-6260u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-skl-6700k     total:246  pass:222  dwarn:1   dfail:0   fail:0   skip:23 
fi-skl-6770hq    total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:246  pass:209  dwarn:0   dfail:0   fail:0   skip:37 
fi-snb-2600      total:246  pass:208  dwarn:0   dfail:0   fail:0   skip:38 

fe116755dd4cf23c17c8ad50227ca4376480d015 drm-intel-nightly: 2016y-10m-26d-14h-34m-03s UTC integration manifest
99d41e5 drm: Print some debug/error info during DP dual mode detect

Full results at https://intel-gfx-ci.01.org/CI/Patchwork_2827/

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2827/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm: Print some debug/error info during DP dual mode detect
  2016-10-26 16:29 ` [PATCH v2] " Imre Deak
@ 2016-10-26 19:59   ` Sean Paul
  0 siblings, 0 replies; 7+ messages in thread
From: Sean Paul @ 2016-10-26 19:59 UTC (permalink / raw)
  To: Imre Deak; +Cc: Intel Graphics Development, dri-devel

On Wed, Oct 26, 2016 at 12:29 PM, Imre Deak <imre.deak@intel.com> wrote:
> There's at least one LSPCON device that occasionally returns an unexpected
> adaptor ID which leads to a failed detect. Print some debug info to help
> debugging this and future cases. Also print an error for an unexpected
> adaptor ID, so users can report it.
>
> v2:
> - s/adapter/adaptor/ and add code comment about incorrect type 1 adaptor
>   IDs. (Ville)
>
> Cc: dri-devel@lists.freedesktop.org
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>


Applied to drm-misc, thanks

Sean

> ---
>  drivers/gpu/drm/drm_dp_dual_mode_helper.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> index 488355b..e025639 100644
> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> @@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
>                       sizeof(dp_dual_mode_hdmi_id)) == 0;
>  }
>
> +static bool is_type1_adaptor(uint8_t adaptor_id)
> +{
> +       return adaptor_id == 0 || adaptor_id == 0xff;
> +}
> +
>  static bool is_type2_adaptor(uint8_t adaptor_id)
>  {
>         return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
> @@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>          */
>         ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
>                                     hdmi_id, sizeof(hdmi_id));
> +       DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
> +                     ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);
>         if (ret)
>                 return DRM_DP_DUAL_MODE_UNKNOWN;
>
> @@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>          */
>         ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
>                                     &adaptor_id, sizeof(adaptor_id));
> +       DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
> +                     adaptor_id, ret);
>         if (ret == 0) {
>                 if (is_lspcon_adaptor(hdmi_id, adaptor_id))
>                         return DRM_DP_DUAL_MODE_LSPCON;
> @@ -219,6 +228,15 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
>                         else
>                                 return DRM_DP_DUAL_MODE_TYPE2_DVI;
>                 }
> +               /*
> +                * If neither a proper type 1 ID nor a broken type 1 adaptor
> +                * as described above, assume type 1, but let the user know
> +                * that we may have misdetected the type.
> +                */
> +               if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
> +                       DRM_ERROR("Unexpected DP dual mode adaptor ID %02x\n",
> +                                 adaptor_id);
> +
>         }
>
>         if (is_hdmi_adaptor(hdmi_id))
> --
> 2.5.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-10-26 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
2016-10-26 15:10 ` Ville Syrjälä
2016-10-26 15:27   ` Imre Deak
2016-10-26 15:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-10-26 16:29 ` [PATCH v2] " Imre Deak
2016-10-26 19:59   ` Sean Paul
2016-10-26 17:16 ` ✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).