drm: Add support for DP 1.4 Compliance edid corruption test
Subsystems (2)
PATCH v4 1/1 drm: Add support for DP 1.4 Compliance edid corruption test
Unlike DP 1.2 edid corruption test, DP 1.4 requires to calculate real CRC value of the last edid data block, and write it back. Current edid CRC calculates routine adds the last CRC byte, and check if non-zero.
This behavior is not accurate; actually, we need to return the actual CRC value when corruption is detected. This commit changes this issue by returning the calculated CRC, and initiate the required sequence.
Change since v3
- Fix a minor typo.
Change since v2
- Rewrite checksum computation routine to avoid duplicated code.
- Rename to avoid confusion.
Change since v1
- Have separate routine for returning real CRC.
--- drivers/gpu/drm/drm_dp_helper.c | 35 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_edid.c | 23 +++++++++++++++++++---- include/drm/drm_connector.h | 6 ++++++ include/drm/drm_dp_helper.h | 3 +++ 4 files changed, 63 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +35 -0
@@ -351,6 +351,41 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, }EXPORT_SYMBOL (drm_dp_dpcd_read_link_status); +/** +* drm_dp_send_real_edid_checksum() - send back real edid checksum value +* @aux: DisplayPort AUX channel +* @real_edid_checksum: real edid checksum for the last block +* +* Returns true on success +*/ +bool drm_dp_send_real_edid_checksum (struct drm_dp_aux *aux, +u8 real_edid_checksum) +{ +u8 link_edid_read =0 , auto_test_req =0 , test_resp =0 ; + +drm_dp_dpcd_read (aux,DP_DEVICE_SERVICE_IRQ_VECTOR , &auto_test_req,1 ); + auto_test_req &=DP_AUTOMATED_TEST_REQUEST ; + +drm_dp_dpcd_read (aux,DP_TEST_REQUEST , &link_edid_read,1 ); + link_edid_read &=DP_TEST_LINK_EDID_READ ; + +if (!auto_test_req || !link_edid_read) { +DRM_DEBUG_KMS ("Source DUT does not support TEST_EDID_READ\n" ); +return false; + } + +drm_dp_dpcd_write (aux,DP_DEVICE_SERVICE_IRQ_VECTOR , &auto_test_req,1 ); + +/* send back checksum for the last edid extension block data */ +drm_dp_dpcd_write (aux,DP_TEST_EDID_CHECKSUM , &real_edid_checksum,1 ); + + test_resp |=DP_TEST_EDID_CHECKSUM_WRITE ; +drm_dp_dpcd_write (aux,DP_TEST_RESPONSE , &test_resp,1 ); + +return true; +} +EXPORT_SYMBOL (drm_dp_send_real_edid_checksum); +/** * drm_dp_downstream_max_clock() - extract branch device max * pixel rate for legacy VGA
drivers/gpu/drm/drm_edid.c +19 -4
@@ -1450,11 +1450,22 @@ static int validate_displayid(u8 *displayid, int length, int idx);static int drm_edid_block_checksum (const u8 *raw_edid) {int i; -u8 csum =0 ; -for (i =0 ; i <EDID_LENGTH ; i++) +u8 csum =0 , crc =0 ; + +for (i =0 ; i <EDID_LENGTH -1 ; i++) csum += raw_edid[i]; -return csum; + crc =0x100 - csum; + +return crc; +} + +static bool drm_edid_block_checksum_diff (const u8 *raw_edid,u8 real_checksum) +{ +if (raw_edid[EDID_LENGTH -1 ] != real_checksum) +return true; +else +return false; }static bool drm_edid_is_zero (const u8 *in_edid,int length)
@@ -1512,7 +1523,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, } csum =drm_edid_block_checksum (raw_edid); -if (csum) { +if (drm_edid_block_checksum_diff (raw_edid, csum)) {if (edid_corrupt) *edid_corrupt = true;
@@ -1653,6 +1664,7 @@ static void connector_bad_edid(struct drm_connector *connector, u8 *edid, int num_blocks) { int i; +u8 num_of_ext = edid[0x7e ];if (connector->bad_edid_counter++ && !drm_debug_enabled (DRM_UT_KMS ))return ;
@@ -1675,6 +1687,9 @@ static void connector_bad_edid(struct drm_connector *connector, prefix,DUMP_PREFIX_NONE ,16 ,1 , block, EDID_LENGTH, false); } + +/* Calculate real checksum for the last edid extension block data */ + connector->real_edid_checksum =drm_edid_block_checksum (edid + num_of_ext *EDID_LENGTH ); }/* Get override or firmware EDID */
include/drm/drm_connector.h +6 -0
@@ -1349,6 +1349,12 @@ struct drm_connector {* rev1.1 4.2.2.6 */ bool edid_corrupt; +/** +* @real_edid_checksum: real edid checksum value for corrupted edid block. +* Required in Displayport 1.4 compliance testing +* rev1.1 4.2.2.6 +*/ +uint8_t real_edid_checksum;/** @debugfs_entry: debugfs directory for this connector */ struct dentry *debugfs_entry;
include/drm/drm_dp_helper.h +3 -0
@@ -1455,6 +1455,9 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux,int drm_dp_dpcd_read_link_status (struct drm_dp_aux *aux,u8 status[DP_LINK_STATUS_SIZE ]); +bool drm_dp_send_real_edid_checksum (struct drm_dp_aux *aux, +u8 real_edid_checksum); +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],
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Add support for DP 1.4 Compliance edid corruption test
== Series Details ==
== Series Details ==
Series: drm: Add support for DP 1.4 Compliance edid corruption test
URL : https://patchwork.freedesktop.org/series/70530/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip b54f4dbd2bed drm: Add support for DP 1.4 Compliance edid corruption test -:37: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #37: FILE: drivers/gpu/drm/drm_dp_helper.c:355: +/** + * drm_dp_send_real_edid_checksum() - send back real edid checksum value
-:44: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #44: FILE: drivers/gpu/drm/drm_dp_helper.c:362:
+bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux,
+ u8 real_edid_checksum)
-:140: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #140: FILE: include/drm/drm_connector.h:1353:
+ /**
+ * @real_edid_checksum: real edid checksum value for corrupted edid block.
-:144: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u8' over 'uint8_t' #144: FILE: include/drm/drm_connector.h:1357:
+ uint8_t real_edid_checksum;
-:157: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #157: FILE: include/drm/drm_dp_helper.h:1461:
+bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux,
+ u8 real_edid_checksum);
total: 0 errors, 2 warnings, 3 checks, 111 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm: Add support for DP 1.4 Compliance edid corruption test
In reply to Jerry (Fangzhi) Zuo== Series Details ==
== Series Details ==
Series: drm: Add support for DP 1.4 Compliance edid corruption test
URL : https://patchwork.freedesktop.org/series/70530/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7494 -> Patchwork_15622
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15622 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15622, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15622:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live_execlists:
- fi-cfl-8700k: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-cfl-8700k/igt@i915_selftest@live_execlists.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-cfl-8700k/igt@i915_selftest@live_execlists.html
Known issues
------------
Here are the changes found in Patchwork_15622 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@module-reload:
- fi-skl-lmem: [PASS][3] -> [DMESG-WARN][4] ([i915#592])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-skl-lmem/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-skl-lmem/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_parallel@basic:
- {fi-tgl-u}: [INCOMPLETE][5] ([i915#476]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-tgl-u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-tgl-u/igt@[email protected]
- {fi-tgl-guc}: [INCOMPLETE][7] ([i915#476]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-tgl-guc/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-tgl-guc/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [FAIL][9] ([i915#178]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-skl-6770hq/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-skl-6770hq/igt@[email protected]
* igt@i915_selftest@live_blt:
- fi-ivb-3770: [DMESG-FAIL][11] ([i915#725]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-ivb-3770/igt@i915_selftest@live_blt.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-ivb-3770/igt@i915_selftest@live_blt.html
* igt@i915_selftest@live_gem_contexts:
- fi-hsw-peppy: [DMESG-FAIL][13] ([i915#722]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
- fi-byt-n2820: [DMESG-FAIL][15] ([i915#722]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
#### Warnings ####
* igt@i915_selftest@live_blt:
- fi-hsw-4770: [DMESG-FAIL][17] ([i915#553] / [i915#725]) -> [DMESG-FAIL][18] ([i915#563])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-hsw-4770/igt@i915_selftest@live_blt.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-hsw-4770/igt@i915_selftest@live_blt.html
* igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- fi-kbl-x1275: [DMESG-WARN][19] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][20] ([i915#62] / [i915#92]) +4 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-kbl-x1275/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-kbl-x1275/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- fi-kbl-x1275: [DMESG-WARN][21] ([i915#62] / [i915#92]) -> [DMESG-WARN][22] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-kbl-x1275/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#178]: https://gitlab.freedesktop.org/drm/intel/issues/178
[i915#476]: https://gitlab.freedesktop.org/drm/intel/issues/476
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#563]: https://gitlab.freedesktop.org/drm/intel/issues/563
[i915#592]: https://gitlab.freedesktop.org/drm/intel/issues/592
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#710]: https://gitlab.freedesktop.org/drm/intel/issues/710
[i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#726]: https://gitlab.freedesktop.org/drm/intel/issues/726
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (53 -> 46)
------------------------------
Additional (1): fi-bwr-2160
Missing (8): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7494 -> Patchwork_15622
CI-20190529: 20190529
CI_DRM_7494: 3f61a8ed20b643bafb1865f5dbae8640a79fee5e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5333: e08522bb09ff1b9720359b3867da7e4aca0bd5f1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15622: b54f4dbd2bed422c2095ac6748f3cfa648039048 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
b54f4dbd2bed drm: Add support for DP 1.4 Compliance edid corruption test
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15622/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[AMD Official Use Only - Internal Distribution Only]
Hi All:
I just checked the CI report https://patchwork.freedesktop.org/series/70530/. The failures described in there are not quite related to my patch. Seems it is a false-positive. Does anyone know something about the issue described in the report?
In addition, I'll resend a new version that fixes the checkpatch issues.
Thanks a lot.
Regards,
Jerry
-----Original Message-----
From: Jerry (Fangzhi) Zuo <[email protected]>
Sent: December 4, 2019 1:03 PM
To: [email protected]; [email protected]; [email protected]
Cc: Ville Syrjälä <[email protected]>; Jani Nikula <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; Kazlauskas, Nicholas <[email protected]>; Siqueira, Rodrigo <[email protected]>; Deucher, Alexander <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test
Unlike DP 1.2 edid corruption test, DP 1.4 requires to calculate real CRC value of the last edid data block, and write it back. Current edid CRC calculates routine adds the last CRC byte, and check if non-zero.
This behavior is not accurate; actually, we need to return the actual CRC value when corruption is detected. This commit changes this issue by returning the calculated CRC, and initiate the required sequence.
Change since v3
- Fix a minor typo.
Change since v2
- Rewrite checksum computation routine to avoid duplicated code.
- Rename to avoid confusion.
Change since v1
- Have separate routine for returning real CRC.
--- drivers/gpu/drm/drm_dp_helper.c | 35 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_edid.c | 23 +++++++++++++++++++---- include/drm/drm_connector.h | 6 ++++++ include/drm/drm_dp_helper.h | 3 +++ 4 files changed, 63 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +37 -0
@@ -351,6 +351,41 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_dpcd_read_link_status); +/** +* drm_dp_send_real_edid_checksum() - send back real edid checksum +value +* @aux: DisplayPort AUX channel +* @real_edid_checksum: real edid checksum for the last block +* +* Returns true on success +*/ +bool drm_dp_send_real_edid_checksum (struct drm_dp_aux *aux, +u8 real_edid_checksum) +{ +u8 link_edid_read =0 , auto_test_req =0 , test_resp =0 ; + +drm_dp_dpcd_read (aux,DP_DEVICE_SERVICE_IRQ_VECTOR , &auto_test_req,1 ); + auto_test_req &=DP_AUTOMATED_TEST_REQUEST ; + +drm_dp_dpcd_read (aux,DP_TEST_REQUEST , &link_edid_read,1 ); + link_edid_read &=DP_TEST_LINK_EDID_READ ; + +if (!auto_test_req || !link_edid_read) { +DRM_DEBUG_KMS ("Source DUT does not support TEST_EDID_READ\n" ); +return false; + } + +drm_dp_dpcd_write (aux,DP_DEVICE_SERVICE_IRQ_VECTOR , &auto_test_req, +1 ); + +/* send back checksum for the last edid extension block data */ +drm_dp_dpcd_write (aux,DP_TEST_EDID_CHECKSUM , &real_edid_checksum,1 ); + + test_resp |=DP_TEST_EDID_CHECKSUM_WRITE ; +drm_dp_dpcd_write (aux,DP_TEST_RESPONSE , &test_resp,1 ); + +return true; +} +EXPORT_SYMBOL (drm_dp_send_real_edid_checksum); +/** * drm_dp_downstream_max_clock() - extract branch device max * pixel rate for legacy VGA
drivers/gpu/drm/drm_edid.c +14 -3
@@ -1450,11 +1450,22 @@ static int validate_displayid(u8 *displayid, int length, int idx); static int drm_edid_block_checksum(const u8 *raw_edid) {int i; -u8 csum =0 ; -for (i =0 ; i <EDID_LENGTH ; i++) +u8 csum =0 , crc =0 ; + +for (i =0 ; i <EDID_LENGTH -1 ; i++) csum += raw_edid[i]; -return csum; + crc =0x100 - csum; + +return crc; +} + +static bool drm_edid_block_checksum_diff (const u8 *raw_edid,u8 +real_checksum) { +if (raw_edid[EDID_LENGTH -1 ] != real_checksum) +return true; +else +return false; } static bool drm_edid_is_zero(const u8 *in_edid, int length) @@ -1512,7 +1523,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, }
csum = drm_edid_block_checksum(raw_edid);
- if (csum) {
+ if (drm_edid_block_checksum_diff(raw_edid, csum)) {
if (edid_corrupt)
*edid_corrupt = true;
@@ -1653,6 +1664,7 @@ static void connector_bad_edid(struct drm_connector *connector,
u8 *edid, int num_blocks)
{
int i;
+ u8 num_of_ext = edid[0x7e];
if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS))
return;
@@ -1675,6 +1687,9 @@ static void connector_bad_edid(struct drm_connector *connector,
prefix, DUMP_PREFIX_NONE, 16, 1,
block, EDID_LENGTH, false);
}
+
+ /* Calculate real checksum for the last edid extension block data */
+ connector->real_edid_checksum = drm_edid_block_checksum(edid +
+num_of_ext * EDID_LENGTH);
}
/* Get override or firmware EDID */
include/drm/drm_connector.h +6 -0
@@ -1349,6 +1349,12 @@ struct drm_connector {* rev1.1 4.2.2.6 */ bool edid_corrupt; +/** +* @real_edid_checksum: real edid checksum value for corrupted edid block. +* Required in Displayport 1.4 compliance testing +* rev1.1 4.2.2.6 +*/ +uint8_t real_edid_checksum;/** @debugfs_entry: debugfs directory for this connector */ struct dentry *debugfs_entry;
include/drm/drm_dp_helper.h +3 -1
@@ -1455,6 +1455,9 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, u8 status[DP_LINK_STATUS_SIZE]); +bool drm_dp_send_real_edid_checksum (struct drm_dp_aux *aux, +u8 real_edid_checksum); +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], --
2.14.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Add support for DP 1.4 Compliance edid corruption test (rev2)
In reply to Jerry (Fangzhi) Zuo== Series Details ==
== Series Details ==
Series: drm: Add support for DP 1.4 Compliance edid corruption test (rev2)
URL : https://patchwork.freedesktop.org/series/70530/
State : failure
== Summary ==
Applying: drm: Add support for DP 1.4 Compliance edid corruption test
error: corrupt patch at line 53
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch Patch failed at 0001 drm: Add support for DP 1.4 Compliance edid corruption test When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx