drm: Print some debug/error info during DP dual mode detect
Subsystems (2)
PATCH 1/1 drm: Print some debug/error info during DP dual mode detect
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.
--- drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/drm_dp_dual_mode_helper.c +13 -0
@@ -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))
Signature · 6 lines
2.5.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 29 lines · Imre Deak
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.
--- drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/gpu/drm/drm_dp_dual_mode_helper.c +5
-0@@ -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 |
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 202
Quoted 5 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0@@ -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?
Quoted 13 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0if (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 ;
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 231
Quoted 4 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +1
-0@@ -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?
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 233
Quoted 2 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0+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
Quoted 6 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +1
-0+ }if (is_hdmi_adaptor (hdmi_id))Signature · 1 line
2.5.0
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Imre Deak
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.
---
drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++1 file changed, 13 insertions(+)drivers/gpu/drm/drm_dp_dual_mode_helper.c +0
-0@@ -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; }drivers/gpu/drm/drm_dp_dual_mode_helper.c +5
-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){
returnadaptor_id== (DP_DUAL_MODE_TYPE_TYPE2|
Quoted 8 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 202
Quoted 6 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0@@ -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.
Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +0
-0if (ret) return DRM_DP_DUAL_MODE_UNKNOWN;drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0@@ -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;
Quoted 8 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 231
Quoted 5 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +0
-0@@ -219,6 +228,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)else
returnDRM_DP_DUAL_MODE_TYPE2_DVI; }drivers/gpu/drm/drm_dp_dual_mode_helper.c +1
-0+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.
Quoted 5 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter) · line 233
Quoted 2 lines
drivers/gpu/drm/drm_dp_dual_mode_helper.c +2
-0+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.
Quoted 10 lines
With that
Reviewed-by Ville Syrjälä <[email protected]>Quoted 6 lines
+
}
if (is_hdmi_adaptor(hdmi_id))
--
2.5.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✗ Fi.CI.BAT: failure for drm: Print some debug/error info during DP dual mode detect
In reply to Imre Deak== Series Details ==
== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm: Print some debug/error info during DP dual mode detect
In reply to Imre DeakThere'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)
--- drivers/gpu/drm/drm_dp_dual_mode_helper.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/drm_dp_dual_mode_helper.c +18 -0
@@ -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))
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sean Paul
AppliedQuoted 5 lines · Imre Deak
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.
Quoted 8 lines
v2:
- s/adapter/adaptor/ and add code comment about incorrect type 1 adaptor IDs. (Ville)Cc Ville Syrjälä <[email protected]>Signed-off-by Imre Deak <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>
Applied to drm-misc, thanks
Sean
Quoted 57 lines
--- drivers/gpu/drm/drm_dp_dual_mode_helper.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/gpu/drm/drm_dp_dual_mode_helper.c +18
-1@@ -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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2)
In reply to Imre Deak== Series Details ==
== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx