<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt;">
<font size="2"><span style="font-size: 11pt;">On 2020-04-29 1:58 p.m., Jerry (Fangzhi) Zuo wrote:<br>
> It works together with drm framework<br>
> "drm: Add support for DP 1.4 Compliance edid corruption test"<br>
> <br>
> Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com><br>
> ---<br>
>  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 40 ++++++-------------<br>
>  1 file changed, 13 insertions(+), 27 deletions(-)<br>
> <br>
> 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<br>
> index c407f06cd1f5..b086d5c906e0 100644<br>
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c<br>
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c<br>
> @@ -554,6 +554,7 @@ enum dc_edid_status dm_helpers_read_local_edid(<br>
>                struct dc_sink *sink)<br>
>  {<br>
>        struct amdgpu_dm_connector *aconnector = link->priv;<br>
> +     struct drm_connector *connector = &aconnector->base;<br>
>        struct i2c_adapter *ddc;<br>
>        int retry = 3;<br>
>        enum dc_edid_status edid_status;<br>
> @@ -571,6 +572,15 @@ enum dc_edid_status dm_helpers_read_local_edid(<br>
>  <br>
>                edid = drm_get_edid(&aconnector->base, ddc);<br>
>  <br>
> +             /* DP Compliance Test 4.2.2.6 */<br>
> +             if (link->aux_mode && connector->edid_corrupt)<br>
> +                     drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, connector->real_edid_checksum);<br>
> +<br>
> +             if (!edid && connector->edid_corrupt) {<br>
> +                     connector->edid_corrupt = false;<br>
> +                     return EDID_BAD_CHECKSUM;<br>
<br>
You return EDID_BAD_CHECKSUM here but the surrounding loop uses<br>
"edid_status == EDID_BAD_CHECKSUM" as condition to go again. Is this<br>
duplicating functionality that dm_helpers_parse_edid_caps did?<br>
<br>
Harry</span></font></div>
<div><br>
</div>
<div><br>
</div>
<div><font color="#000000" face="Calibri">It is not duplicate. You mentioned <font color="#000000" face="Calibri">
dm_helpers_parse_edid_caps() with retries is fallen into the 3rd checkup step below</font>:<font color="#000000" face="Calibri"><br>
1. If base block is fetched with checksum mismatch, drm will set connector->edid_corrupt and return with Null edid buffer. This case will be handled as compliance test case 4.2.2.6, retuning EDID_BAD_CHECKSUM right away without going ahead to parse edid caps
 --> newly added<font color="#000000" face="Calibri"><br>
2. If edid buffer cannot be created, return EDID_NO_RESPONSE but do not set connector->edid_corrupt<font color="#000000" face="Calibri"><br>
3. For invalid extension blocks, drm doesn't set connector->edid_corrupt. This case will be further handled by dm_helpers_parse_edid_caps() with 3 times retries.
<font color="#000000" face="Calibri"><br>
</font></font></font></font></font></div>
<div><font color="#000000" face="Calibri">If failed any step above with EDID_BAD_CHECKSUM, will enable fail-safe mode in DC.</font></div>
<div><br>
</div>
<div><font color="#000000" face="Calibri">Jerry</font></div>
<div><font color="#000000" face="Calibri"><font size="2"><span style="font-size: 11pt;"><br>
<br>
> +             }<br>
> +<br>
>                if (!edid)<br>
>                        return EDID_NO_RESPONSE;<br>
>  <br>
> @@ -605,34 +615,10 @@ enum dc_edid_status dm_helpers_read_local_edid(<br>
>                DRM_ERROR("EDID err: %d, on connector: %s",<br>
>                                edid_status,<br>
>                                aconnector->base.name);<br>
> -     if (link->aux_mode) {<br>
> -             union test_request test_request = { {0} };<br>
> -             union test_response test_response = { {0} };<br>
> -<br>
> -             dm_helpers_dp_read_dpcd(ctx,<br>
> -                                     link,<br>
> -                                     DP_TEST_REQUEST,<br>
> -                                     &test_request.raw,<br>
> -                                     sizeof(union test_request));<br>
> -<br>
> -             if (!test_request.bits.EDID_READ)<br>
> -                     return edid_status;<br>
>  <br>
> -             test_response.bits.EDID_CHECKSUM_WRITE = 1;<br>
> -<br>
> -             dm_helpers_dp_write_dpcd(ctx,<br>
> -                                     link,<br>
> -                                     DP_TEST_EDID_CHECKSUM,<br>
> -                                     &sink->dc_edid.raw_edid[sink->dc_edid.length-1],<br>
> -                                     1);<br>
> -<br>
> -             dm_helpers_dp_write_dpcd(ctx,<br>
> -                                     link,<br>
> -                                     DP_TEST_RESPONSE,<br>
> -                                     &test_response.raw,<br>
> -                                     sizeof(test_response));<br>
> -<br>
> -     }<br>
> +     /* DP Compliance Test 4.2.2.3 */<br>
> +     if (link->aux_mode)<br>
> +             drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, sink->dc_edid.raw_edid[sink->dc_edid.length-1]);<br>
>  <br>
>        return edid_status;<br>
>  }<br>
> <br>
</span></font></font></div>
</div>
</body>
</html>