diff mbox series

[2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test

Message ID 20191030210844.19803-3-Jerry.Zuo@amd.com (mailing list archive)
State New, archived
Headers show
Series Changes for DP 1.4 Compliance test 4.2.2.6 | expand

Commit Message

Zuo, Jerry Oct. 30, 2019, 9:08 p.m. UTC
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 mbox series

Patch

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;
 }