AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jerry (Fangzhi) Zuo" <Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	harry.wentland-5C7GfCeVMHo@public.gmane.org,
	"Jerry (Fangzhi) Zuo" <Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH v2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
Date: Mon, 4 Nov 2019 16:13:40 -0500	[thread overview]
Message-ID: <20191104211340.30604-1-Jerry.Zuo@amd.com> (raw)
In-Reply-To: <20191030210844.19803-3-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>

-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

WARNING: multiple messages have this Message-ID (diff)
From: "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com>
To: <dri-devel@lists.freedesktop.org>, <amd-gfx@lists.freedesktop.org>
Cc: manasi.d.navare@intel.com, harry.wentland@amd.com,
	"Jerry \(Fangzhi\) Zuo" <Jerry.Zuo@amd.com>
Subject: [PATCH v2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test
Date: Mon, 4 Nov 2019 16:13:40 -0500	[thread overview]
Message-ID: <20191104211340.30604-1-Jerry.Zuo@amd.com> (raw)
Message-ID: <20191104211340.eTkOYIaISNyriy4_2FaGRRu8Oa5jlL-N_5cH-tI38CU@z> (raw)
In-Reply-To: <20191030210844.19803-3-Jerry.Zuo@amd.com>

-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

  parent reply	other threads:[~2019-11-04 21:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
     [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
     [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 19:38       ` [PATCH v2 " 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-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
     [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
     [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
     [not found]                   ` <DM5PR12MB1705A4E4102731AF4BDB00CDE54A0-2J9CzHegvk9755J/8u8g5AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
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
     [not found]     ` <20191030210844.19803-3-Jerry.Zuo-5C7GfCeVMHo@public.gmane.org>
2019-11-04 21:13       ` Jerry (Fangzhi) Zuo [this message]
2019-11-04 21:13         ` [PATCH v2] " Jerry (Fangzhi) Zuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191104211340.30604-1-Jerry.Zuo@amd.com \
    --to=jerry.zuo-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=harry.wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox