All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Changes for DP 1.4 Compliance test 4.2.2.6
@ 2019-10-30 21:08 ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry.Zuo-5C7GfCeVMHo

Unlike DP 1.2 Compliance test 4.2.2.6, DP 1.4 requires to calculate real
CRC value of the last edid data block, and write it back.

Current edid CRC calculate routine adds the last CRC byte, and check if
non-zero or not. Need to return the actual CRC value when corruption is
detected.    

Jerry (Fangzhi) Zuo (2):
  drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
  drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test

 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++----------------
 drivers/gpu/drm/drm_dp_helper.c                    | 36 ++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c                         | 15 +++++++--
 include/drm/drm_connector.h                        |  7 +++++
 include/drm/drm_dp_helper.h                        |  3 ++
 5 files changed, 65 insertions(+), 31 deletions(-)

-- 
2.14.1

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

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

* [PATCH 0/2] Changes for DP 1.4 Compliance test 4.2.2.6
@ 2019-10-30 21:08 ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry.Zuo

Unlike DP 1.2 Compliance test 4.2.2.6, DP 1.4 requires to calculate real
CRC value of the last edid data block, and write it back.

Current edid CRC calculate routine adds the last CRC byte, and check if
non-zero or not. Need to return the actual CRC value when corruption is
detected.    

Jerry (Fangzhi) Zuo (2):
  drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
  drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test

 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++----------------
 drivers/gpu/drm/drm_dp_helper.c                    | 36 ++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c                         | 15 +++++++--
 include/drm/drm_connector.h                        |  7 +++++
 include/drm/drm_dp_helper.h                        |  3 ++
 5 files changed, 65 insertions(+), 31 deletions(-)

-- 
2.14.1

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

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

* [PATCH 0/2] Changes for DP 1.4 Compliance test 4.2.2.6
@ 2019-10-30 21:08 ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry.Zuo

Unlike DP 1.2 Compliance test 4.2.2.6, DP 1.4 requires to calculate real
CRC value of the last edid data block, and write it back.

Current edid CRC calculate routine adds the last CRC byte, and check if
non-zero or not. Need to return the actual CRC value when corruption is
detected.    

Jerry (Fangzhi) Zuo (2):
  drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
  drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test

 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++----------------
 drivers/gpu/drm/drm_dp_helper.c                    | 36 ++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c                         | 15 +++++++--
 include/drm/drm_connector.h                        |  7 +++++
 include/drm/drm_dp_helper.h                        |  3 ++
 5 files changed, 65 insertions(+), 31 deletions(-)

-- 
2.14.1

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

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

* [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry.Zuo-5C7GfCeVMHo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..400064dcc010 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
 			      struct edid *edid);
 static int validate_displayid(u8 *displayid, int length, int idx);
 
-static int drm_edid_block_checksum(const u8 *raw_edid)
+static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+	u8 len;
+
+	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
+
+	for (i = 0; i < len; i++)
 		csum += raw_edid[i];
 
+	csum = c ? csum : (0x100 - csum);
+
 	return csum;
 }
 
@@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
 		}
 	}
 
-	csum = drm_edid_block_checksum(raw_edid);
+	csum = drm_edid_block_checksum(raw_edid, true);
 	if (csum) {
 		if (edid_corrupt)
 			*edid_corrupt = true;
@@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry.Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..400064dcc010 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
 			      struct edid *edid);
 static int validate_displayid(u8 *displayid, int length, int idx);
 
-static int drm_edid_block_checksum(const u8 *raw_edid)
+static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+	u8 len;
+
+	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
+
+	for (i = 0; i < len; i++)
 		csum += raw_edid[i];
 
+	csum = c ? csum : (0x100 - csum);
+
 	return csum;
 }
 
@@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
 		}
 	}
 
-	csum = drm_edid_block_checksum(raw_edid);
+	csum = drm_edid_block_checksum(raw_edid, true);
 	if (csum) {
 		if (edid_corrupt)
 			*edid_corrupt = true;
@@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry.Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..400064dcc010 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
 			      struct edid *edid);
 static int validate_displayid(u8 *displayid, int length, int idx);
 
-static int drm_edid_block_checksum(const u8 *raw_edid)
+static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+	u8 len;
+
+	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
+
+	for (i = 0; i < len; i++)
 		csum += raw_edid[i];
 
+	csum = c ? csum : (0x100 - csum);
+
 	return csum;
 }
 
@@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
 		}
 	}
 
-	csum = drm_edid_block_checksum(raw_edid);
+	csum = drm_edid_block_checksum(raw_edid, true);
 	if (csum) {
 		if (edid_corrupt)
 			*edid_corrupt = true;
@@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry.Zuo-5C7GfCeVMHo

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..c430890085f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_bad_edid_checksum(&aconnector->dm_dp_aux.aux, connector->bad_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* [PATCH 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry.Zuo

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..c430890085f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_bad_edid_checksum(&aconnector->dm_dp_aux.aux, connector->bad_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* [PATCH 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-10-30 21:08 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry.Zuo

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..c430890085f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_bad_edid_checksum(&aconnector->dm_dp_aux.aux, connector->bad_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* Re: [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 14:07         ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-01 14:07 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w, Jerry.Zuo-5C7GfCeVMHo

On Wed, 30 Oct 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 58 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..400064dcc010 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
>  			      struct edid *edid);
>  static int validate_displayid(u8 *displayid, int length, int idx);
>  
> -static int drm_edid_block_checksum(const u8 *raw_edid)
> +static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
>  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +	u8 len;
> +
> +	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
> +
> +	for (i = 0; i < len; i++)
>  		csum += raw_edid[i];
>  
> +	csum = c ? csum : (0x100 - csum);
> +
>  	return csum;
>  }

I think a mysterious boolean 'c' argument just makes this more
confusing.

Please split the function to two, one that calculates the checksum (c ==
false case) and another that uses the function (c == true case). The
latter would return the same value as the above.

Please do this as a prep patch without any of the other modifications.

BR,
Jani.



>  
> @@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
>  		}
>  	}
>  
> -	csum = drm_edid_block_checksum(raw_edid);
> +	csum = drm_edid_block_checksum(raw_edid, true);
>  	if (csum) {
>  		if (edid_corrupt)
>  			*edid_corrupt = true;
> @@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 14:07         ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-01 14:07 UTC (permalink / raw)
  To: Jerry (Fangzhi) Zuo, dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry.Zuo

On Wed, 30 Oct 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 58 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..400064dcc010 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
>  			      struct edid *edid);
>  static int validate_displayid(u8 *displayid, int length, int idx);
>  
> -static int drm_edid_block_checksum(const u8 *raw_edid)
> +static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
>  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +	u8 len;
> +
> +	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
> +
> +	for (i = 0; i < len; i++)
>  		csum += raw_edid[i];
>  
> +	csum = c ? csum : (0x100 - csum);
> +
>  	return csum;
>  }

I think a mysterious boolean 'c' argument just makes this more
confusing.

Please split the function to two, one that calculates the checksum (c ==
false case) and another that uses the function (c == true case). The
latter would return the same value as the above.

Please do this as a prep patch without any of the other modifications.

BR,
Jani.



>  
> @@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
>  		}
>  	}
>  
> -	csum = drm_edid_block_checksum(raw_edid);
> +	csum = drm_edid_block_checksum(raw_edid, true);
>  	if (csum) {
>  		if (edid_corrupt)
>  			*edid_corrupt = true;
> @@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 14:07         ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-01 14:07 UTC (permalink / raw)
  To: Jerry (Fangzhi) Zuo, dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry.Zuo

On Wed, 30 Oct 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 15 ++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 58 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..400064dcc010 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector,
>  			      struct edid *edid);
>  static int validate_displayid(u8 *displayid, int length, int idx);
>  
> -static int drm_edid_block_checksum(const u8 *raw_edid)
> +static int drm_edid_block_checksum(const u8 *raw_edid, bool c)
>  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +	u8 len;
> +
> +	len = c ? EDID_LENGTH : (EDID_LENGTH - 1);
> +
> +	for (i = 0; i < len; i++)
>  		csum += raw_edid[i];
>  
> +	csum = c ? csum : (0x100 - csum);
> +
>  	return csum;
>  }

I think a mysterious boolean 'c' argument just makes this more
confusing.

Please split the function to two, one that calculates the checksum (c ==
false case) and another that uses the function (c == true case). The
latter would return the same value as the above.

Please do this as a prep patch without any of the other modifications.

BR,
Jani.



>  
> @@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
>  		}
>  	}
>  
> -	csum = drm_edid_block_checksum(raw_edid);
> +	csum = drm_edid_block_checksum(raw_edid, true);
>  	if (csum) {
>  		if (edid_corrupt)
>  			*edid_corrupt = true;
> @@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 19:38         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-01 19:38 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 60 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..0598314e3f46 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 	return csum;
 }
 
+static int drm_edid_block_real_checksum(const u8 *raw_edid)
+{
+	int i;
+	u8 csum = 0;
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
+		csum += raw_edid[i];
+
+	return (0x100 - csum);
+}
+
 static bool drm_edid_is_zero(const u8 *in_edid, int length)
 {
 	if (memchr_inv(in_edid, 0, length))
@@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 19:38         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-01 19:38 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 60 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..0598314e3f46 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 	return csum;
 }
 
+static int drm_edid_block_real_checksum(const u8 *raw_edid)
+{
+	int i;
+	u8 csum = 0;
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
+		csum += raw_edid[i];
+
+	return (0x100 - csum);
+}
+
 static bool drm_edid_is_zero(const u8 *in_edid, int length)
 {
 	if (memchr_inv(in_edid, 0, length))
@@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 19:38         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-01 19:38 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 60 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75dbd30c62a7 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 }
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
+/**
+  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
+  * @aux: DisplayPort AUX channel
+  * @bad_edid_checksum: real edid checksum for the last block
+  *
+  * Returns true on success
+  */
+bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
+                                u8 bad_edid_checksum)
+{
+        u8 link_edid_read = 0, auto_test_req = 0;
+        u8 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, &bad_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_bad_edid_checksum);
+
 /**
  * drm_dp_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..0598314e3f46 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 	return csum;
 }
 
+static int drm_edid_block_real_checksum(const u8 *raw_edid)
+{
+	int i;
+	u8 csum = 0;
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
+		csum += raw_edid[i];
+
+	return (0x100 - csum);
+}
+
 static bool drm_edid_is_zero(const u8 *in_edid, int length)
 {
 	if (memchr_inv(in_edid, 0, length))
@@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..8442461542b9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ struct drm_connector {
 	 * rev1.1 4.2.2.6
 	 */
 	bool edid_corrupt;
+	/**
+         * @bad_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 bad_edid_checksum;
+
 
 	/** @debugfs_entry: debugfs directory for this connector */
 	struct dentry *debugfs_entry;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..2a7e54bebb18 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
+				u8 bad_edid_checksum);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 20:57             ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-01 20:57 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w, Wentland, Harry

On 2019-11-01 3:38 p.m., Jerry (Fangzhi) Zuo wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);
> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;


This variable name confused me a bit. Maybe name this
"computed_edid_checksum" to clarify that this is the EDID checksum that
we've computed for the EDID, i.e. the correct one.

> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,

Same as before, might be good to name this
drm_dp_send_computed_edid_checksum or something similar.

Harry

> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 20:57             ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-01 20:57 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx; +Cc: manasi.d.navare

On 2019-11-01 3:38 p.m., Jerry (Fangzhi) Zuo wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);
> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;


This variable name confused me a bit. Maybe name this
"computed_edid_checksum" to clarify that this is the EDID checksum that
we've computed for the EDID, i.e. the correct one.

> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,

Same as before, might be good to name this
drm_dp_send_computed_edid_checksum or something similar.

Harry

> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-01 20:57             ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-01 20:57 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx; +Cc: manasi.d.navare, Wentland, Harry

On 2019-11-01 3:38 p.m., Jerry (Fangzhi) Zuo wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);
> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;


This variable name confused me a bit. Maybe name this
"computed_edid_checksum" to clarify that this is the EDID checksum that
we've computed for the EDID, i.e. the correct one.

> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,

Same as before, might be good to name this
drm_dp_send_computed_edid_checksum or something similar.

Harry

> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 14:00           ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-04 14:00 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

On Fri, 01 Nov 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> -v2: Have separate routine for returning real CRC
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);

Now you have two functions that have the loop to calculate checksums,
which is not at all what I tried to tell you to do.

I tried to suggest something like this:

static int drm_edid_block_checksum(const u8 *raw_edid)
{
	int i;
	u8 csum = 0;
	for (i = 0; i < EDID_LENGTH - 1; i++)
		csum += raw_edid[i];

	return 0x100 - csum;
}

static int drm_edid_block_checksum_diff(const u8 *raw_edid)
{
        u8 csum = drm_edid_block_checksum(raw_edid) + raw_edid[EDID_LENGTH - 1];

        return csum;
}

Alternatively, you could have just the function to calculate the
checksum, and then the check is comparing the calculated checksum
against the checksum in the EDID.

BR,
Jani.




> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 14:00           ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-04 14:00 UTC (permalink / raw)
  To: Jerry (Fangzhi) Zuo, dri-devel, amd-gfx
  Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

On Fri, 01 Nov 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> -v2: Have separate routine for returning real CRC
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);

Now you have two functions that have the loop to calculate checksums,
which is not at all what I tried to tell you to do.

I tried to suggest something like this:

static int drm_edid_block_checksum(const u8 *raw_edid)
{
	int i;
	u8 csum = 0;
	for (i = 0; i < EDID_LENGTH - 1; i++)
		csum += raw_edid[i];

	return 0x100 - csum;
}

static int drm_edid_block_checksum_diff(const u8 *raw_edid)
{
        u8 csum = drm_edid_block_checksum(raw_edid) + raw_edid[EDID_LENGTH - 1];

        return csum;
}

Alternatively, you could have just the function to calculate the
checksum, and then the check is comparing the calculated checksum
against the checksum in the EDID.

BR,
Jani.




> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 14:00           ` Jani Nikula
  0 siblings, 0 replies; 36+ messages in thread
From: Jani Nikula @ 2019-11-04 14:00 UTC (permalink / raw)
  To: Jerry (Fangzhi) Zuo, dri-devel, amd-gfx
  Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

On Fri, 01 Nov 2019, "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com> wrote:
> DP 1.4 edid corruption test requires source DUT to write calculated
> CRC, not the corrupted CRC from reference sink.
>
> Return the calculated CRC back, and initiate the required sequence.
>
> -v2: Have separate routine for returning real CRC
>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 14 ++++++++++++++
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 60 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..75dbd30c62a7 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> +  * drm_dp_send_bad_edid_checksum() - send back real edid checksum value
> +  * @aux: DisplayPort AUX channel
> +  * @bad_edid_checksum: real edid checksum for the last block
> +  *
> +  * Returns true on success
> +  */
> +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux,
> +                                u8 bad_edid_checksum)
> +{
> +        u8 link_edid_read = 0, auto_test_req = 0;
> +        u8 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, &bad_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_bad_edid_checksum);
> +
>  /**
>   * drm_dp_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 82a4ceed3fcf..0598314e3f46 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1354,6 +1354,17 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
>  	return csum;
>  }
>  
> +static int drm_edid_block_real_checksum(const u8 *raw_edid)
> +{
> +	int i;
> +	u8 csum = 0;
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
> +		csum += raw_edid[i];
> +
> +	return (0x100 - csum);

Now you have two functions that have the loop to calculate checksums,
which is not at all what I tried to tell you to do.

I tried to suggest something like this:

static int drm_edid_block_checksum(const u8 *raw_edid)
{
	int i;
	u8 csum = 0;
	for (i = 0; i < EDID_LENGTH - 1; i++)
		csum += raw_edid[i];

	return 0x100 - csum;
}

static int drm_edid_block_checksum_diff(const u8 *raw_edid)
{
        u8 csum = drm_edid_block_checksum(raw_edid) + raw_edid[EDID_LENGTH - 1];

        return csum;
}

Alternatively, you could have just the function to calculate the
checksum, and then the check is comparing the calculated checksum
against the checksum in the EDID.

BR,
Jani.




> +}
> +
>  static bool drm_edid_is_zero(const u8 *in_edid, int length)
>  {
>  	if (memchr_inv(in_edid, 0, length))
> @@ -1572,6 +1583,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->bad_edid_checksum = drm_edid_block_real_checksum(edid + edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..8442461542b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ struct drm_connector {
>  	 * rev1.1 4.2.2.6
>  	 */
>  	bool edid_corrupt;
> +	/**
> +         * @bad_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 bad_edid_checksum;
> +
>  
>  	/** @debugfs_entry: debugfs directory for this connector */
>  	struct dentry *debugfs_entry;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 5a795075d5da..2a7e54bebb18 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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_bad_edid_checksum(struct drm_dp_aux *aux,
> +				u8 bad_edid_checksum);
> +
>  /*
>   * DisplayPort link
>   */

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH v3] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 21:11           ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:11 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75bdffd840c6 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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
+  * @bad_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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v3] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 21:11           ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:11 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75bdffd840c6 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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
+  * @bad_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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v3] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-04 21:11           ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:11 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..75bdffd840c6 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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
+  * @bad_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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-11-04 21:13         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:13 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry (Fangzhi) Zuo

-v3: Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..927fdac77b6f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, connector->real_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* [PATCH v2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-11-04 21:13         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:13 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

-v3: Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..927fdac77b6f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, connector->real_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* [PATCH v2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
@ 2019-11-04 21:13         ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-04 21:13 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry (Fangzhi) Zuo

-v3: Rename to avoid confusion

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 11e5784aa62a..927fdac77b6f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_sink *sink)
 {
 	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct i2c_adapter *ddc;
 	int retry = 3;
 	enum dc_edid_status edid_status;
@@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid(
 
 		edid = drm_get_edid(&aconnector->base, ddc);
 
+		if (link->aux_mode && connector->edid_corrupt)
+			drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, connector->real_edid_checksum);
+
+		if (!edid && connector->edid_corrupt)
+			return EDID_BAD_CHECKSUM;
+
 		if (!edid)
 			return EDID_NO_RESPONSE;
 
@@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
-	if (link->aux_mode) {
-		union test_request test_request = { {0} };
-		union test_response test_response = { {0} };
-
-		dm_helpers_dp_read_dpcd(ctx,
-					link,
-					DP_TEST_REQUEST,
-					&test_request.raw,
-					sizeof(union test_request));
-
-		if (!test_request.bits.EDID_READ)
-			return edid_status;
-
-		test_response.bits.EDID_CHECKSUM_WRITE = 1;
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_EDID_CHECKSUM,
-					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
-					1);
-
-		dm_helpers_dp_write_dpcd(ctx,
-					link,
-					DP_TEST_RESPONSE,
-					&test_response.raw,
-					sizeof(test_response));
-
-	}
 
 	return edid_status;
 }
-- 
2.14.1

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

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

* [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-05 16:37               ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-05 16:37 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w,
	harry.wentland-5C7GfCeVMHo, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-05 16:37               ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-05 16:37 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-05 16:37               ` Jerry (Fangzhi) Zuo
  0 siblings, 0 replies; 36+ messages in thread
From: Jerry (Fangzhi) Zuo @ 2019-11-05 16:37 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: manasi.d.navare, harry.wentland, Jerry (Fangzhi) Zuo

DP 1.4 edid corruption test requires source DUT to write calculated
CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)
 {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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)
@@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
-- 
2.14.1

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

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

* RE: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-25 21:36                   ` Zuo, Jerry
  0 siblings, 0 replies; 36+ messages in thread
From: Zuo, Jerry @ 2019-11-25 21:36 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w, Wentland, Harry, Jani Nikula

Please kindly give a review on my latest revision. Thanks a lot.

Regards,
Jerry

-----Original Message-----
From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
Sent: November 5, 2019 11:38 AM
To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6

DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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) @@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + 
+edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
--
2.14.1

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

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

* RE: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-25 21:36                   ` Zuo, Jerry
  0 siblings, 0 replies; 36+ messages in thread
From: Zuo, Jerry @ 2019-11-25 21:36 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx; +Cc: manasi.d.navare, Jani Nikula

Please kindly give a review on my latest revision. Thanks a lot.

Regards,
Jerry

-----Original Message-----
From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
Sent: November 5, 2019 11:38 AM
To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6

DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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) @@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + 
+edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
--
2.14.1

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

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

* RE: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-25 21:36                   ` Zuo, Jerry
  0 siblings, 0 replies; 36+ messages in thread
From: Zuo, Jerry @ 2019-11-25 21:36 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx
  Cc: manasi.d.navare, Wentland, Harry, Jani Nikula

Please kindly give a review on my latest revision. Thanks a lot.

Regards,
Jerry

-----Original Message-----
From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
Sent: November 5, 2019 11:38 AM
To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6

DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.

Return the calculated CRC back, and initiate the required sequence.

-v2: Have separate routine for returning real CRC

-v3: Rewrite checksum computation routine to avoid duplicated code.
     Rename to avoid confusion

-v4: Fix a minor typo.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
 include/drm/drm_connector.h     |  7 +++++++
 include/drm/drm_dp_helper.h     |  3 +++
 4 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -336,6 +336,42 @@ 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;
+        u8 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_link_probe() - probe a DisplayPort link for capabilities
  * @aux: DisplayPort AUX channel
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
 	int i;
 	u8 csum = 0;
-	for (i = 0; i < EDID_LENGTH; i++)
+
+	for (i = 0; i < EDID_LENGTH - 1; i++)
 		csum += raw_edid[i];
 
-	return csum;
+	return (0x100 - csum);
+}
+
+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) @@ -1409,7 +1418,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;
 
@@ -1572,6 +1581,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 + 
+edid[0x7e] * EDID_LENGTH);
 }
 
 /* Get override or firmware EDID */
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1345,6 +1345,13 @@ 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;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1383,6 +1383,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);
+
 /*
  * DisplayPort link
  */
--
2.14.1

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

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

* Re: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-26 18:39                       ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-26 18:39 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w, Wentland, Harry, Jani Nikula

On 2019-11-25 4:36 p.m., Zuo, Jerry wrote:
> Please kindly give a review on my latest revision. Thanks a lot.
> 

Both patches are
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Regards,
> Jerry
> 
> -----Original Message-----
> From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
> Sent: November 5, 2019 11:38 AM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
> Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
> 
> DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> -v3: Rewrite checksum computation routine to avoid duplicated code.
>      Rename to avoid confusion
> 
> -v4: Fix a minor typo.
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 61 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ 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;
> +        u8 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_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
>  		csum += raw_edid[i];
>  
> -	return csum;
> +	return (0x100 - csum);
> +}
> +
> +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) @@ -1409,7 +1418,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;
>  
> @@ -1572,6 +1581,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 + 
> +edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ 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;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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);
> +
>  /*
>   * DisplayPort link
>   */
> --
> 2.14.1
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-26 18:39                       ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-26 18:39 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx; +Cc: manasi.d.navare, Jani Nikula

On 2019-11-25 4:36 p.m., Zuo, Jerry wrote:
> Please kindly give a review on my latest revision. Thanks a lot.
> 

Both patches are
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Regards,
> Jerry
> 
> -----Original Message-----
> From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
> Sent: November 5, 2019 11:38 AM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
> Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
> 
> DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> -v3: Rewrite checksum computation routine to avoid duplicated code.
>      Rename to avoid confusion
> 
> -v4: Fix a minor typo.
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 61 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ 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;
> +        u8 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_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
>  		csum += raw_edid[i];
>  
> -	return csum;
> +	return (0x100 - csum);
> +}
> +
> +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) @@ -1409,7 +1418,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;
>  
> @@ -1572,6 +1581,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 + 
> +edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ 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;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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);
> +
>  /*
>   * DisplayPort link
>   */
> --
> 2.14.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
@ 2019-11-26 18:39                       ` Harry Wentland
  0 siblings, 0 replies; 36+ messages in thread
From: Harry Wentland @ 2019-11-26 18:39 UTC (permalink / raw)
  To: Zuo, Jerry, dri-devel, amd-gfx
  Cc: manasi.d.navare, Wentland, Harry, Jani Nikula

On 2019-11-25 4:36 p.m., Zuo, Jerry wrote:
> Please kindly give a review on my latest revision. Thanks a lot.
> 

Both patches are
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Regards,
> Jerry
> 
> -----Original Message-----
> From: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> 
> Sent: November 5, 2019 11:38 AM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: lyude@redhat.com; manasi.d.navare@intel.com; Wentland, Harry <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
> Subject: [PATCH v4] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6
> 
> DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink.
> 
> Return the calculated CRC back, and initiate the required sequence.
> 
> -v2: Have separate routine for returning real CRC
> 
> -v3: Rewrite checksum computation routine to avoid duplicated code.
>      Rename to avoid confusion
> 
> -v4: Fix a minor typo.
> 
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_edid.c      | 18 +++++++++++++++---
>  include/drm/drm_connector.h     |  7 +++++++
>  include/drm/drm_dp_helper.h     |  3 +++
>  4 files changed, 61 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -336,6 +336,42 @@ 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;
> +        u8 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_link_probe() - probe a DisplayPort link for capabilities
>   * @aux: DisplayPort AUX channel
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid)  {
>  	int i;
>  	u8 csum = 0;
> -	for (i = 0; i < EDID_LENGTH; i++)
> +
> +	for (i = 0; i < EDID_LENGTH - 1; i++)
>  		csum += raw_edid[i];
>  
> -	return csum;
> +	return (0x100 - csum);
> +}
> +
> +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) @@ -1409,7 +1418,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;
>  
> @@ -1572,6 +1581,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 + 
> +edid[0x7e] * EDID_LENGTH);
>  }
>  
>  /* Get override or firmware EDID */
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1345,6 +1345,13 @@ 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;
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -1383,6 +1383,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);
> +
>  /*
>   * DisplayPort link
>   */
> --
> 2.14.1
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-11-26 18:39 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 21:08 [PATCH 0/2] Changes for DP 1.4 Compliance test 4.2.2.6 Jerry (Fangzhi) Zuo
2019-10-30 21:08 ` Jerry (Fangzhi) Zuo
2019-10-30 21:08 ` Jerry (Fangzhi) Zuo
     [not found] ` <20191030210844.19803-1-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-10-30 21:08   ` [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption " Jerry (Fangzhi) Zuo
2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
     [not found]     ` <20191030210844.19803-2-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-01 14:07       ` Jani Nikula
2019-11-01 14:07         ` Jani Nikula
2019-11-01 14:07         ` Jani Nikula
2019-11-01 19:38       ` [PATCH v2 " Jerry (Fangzhi) Zuo
2019-11-01 19:38         ` Jerry (Fangzhi) Zuo
2019-11-01 19:38         ` Jerry (Fangzhi) Zuo
     [not found]         ` <20191101193839.25582-1-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-01 20:57           ` Harry Wentland
2019-11-01 20:57             ` Harry Wentland
2019-11-01 20:57             ` Harry Wentland
2019-11-04 14:00         ` Jani Nikula
2019-11-04 14:00           ` Jani Nikula
2019-11-04 14:00           ` Jani Nikula
2019-11-04 21:11         ` [PATCH v3] " Jerry (Fangzhi) Zuo
2019-11-04 21:11           ` Jerry (Fangzhi) Zuo
2019-11-04 21:11           ` Jerry (Fangzhi) Zuo
     [not found]           ` <20191104211145.30553-1-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-05 16:37             ` [PATCH v4] " Jerry (Fangzhi) Zuo
2019-11-05 16:37               ` Jerry (Fangzhi) Zuo
2019-11-05 16:37               ` Jerry (Fangzhi) Zuo
     [not found]               ` <20191105163740.3093-1-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-25 21:36                 ` Zuo, Jerry
2019-11-25 21:36                   ` Zuo, Jerry
2019-11-25 21:36                   ` Zuo, Jerry
     [not found]                   ` <DM5PR12MB1705A4E4102731AF4BDB00CDE54A0-2J9CzHegvk9755J/8u8g5AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-26 18:39                     ` Harry Wentland
2019-11-26 18:39                       ` Harry Wentland
2019-11-26 18:39                       ` Harry Wentland
2019-10-30 21:08   ` [PATCH 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test Jerry (Fangzhi) Zuo
2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
2019-10-30 21:08     ` Jerry (Fangzhi) Zuo
     [not found]     ` <20191030210844.19803-3-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-04 21:13       ` [PATCH v2] " Jerry (Fangzhi) Zuo
2019-11-04 21:13         ` Jerry (Fangzhi) Zuo
2019-11-04 21:13         ` Jerry (Fangzhi) Zuo

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.