<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Joseph Gravenor <Joseph.Gravenor@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Liu, Zhan <Zhan.Liu@amd.com><br>
<b>Sent:</b> Friday, April 17, 2020 1:17 PM<br>
<b>To:</b> Liu, Zhan <Zhan.Liu@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Gravenor, Joseph <Joseph.Gravenor@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">+ Joseph<br>
<br>
<br>
<br>
Hi Joseph,<br>
<br>
Would you like to help me review this change? This was a follow-up on the discussion we had earlier this year.<br>
<br>
Thanks,<br>
Zhan<br>
<br>
<br>
> -----Original Message-----<br>
> From: Liu, Zhan <zhan.liu@amd.com><br>
> Sent: 2020/April/16, Thursday 3:24 PM<br>
> To: amd-gfx@lists.freedesktop.org; Liu, Zhan <Zhan.Liu@amd.com><br>
> Subject: [PATCH] drm/amd/display: Remove aconnector condition check for<br>
> dpcd read<br>
> <br>
> [Why]<br>
> Aconnector is not necessary to be NULL in order to read dpcd successfully.<br>
> <br>
> Actually if we rely on checking aconnector here, we won't be able to turn off<br>
> all displays before doing display detection. That will cause some MST hubs<br>
> not able to light up.<br>
> <br>
> [How]<br>
> Remove aconnector check when turning off all displays at hardware<br>
> initialization stage.<br>
> <br>
> Signed-off-by: Zhan Liu <zhan.liu@amd.com><br>
> ---<br>
>  .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 ++++++++-----------<br>
>  1 file changed, 14 insertions(+), 22 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
> b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
> index 9f41efddc9bc..6f33f3f0d023 100644<br>
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
> @@ -1332,31 +1332,23 @@ void dcn10_init_hw(struct dc *dc)<br>
>                        if (dc->links[i]->connector_signal !=<br>
> SIGNAL_TYPE_DISPLAY_PORT)<br>
>                                continue;<br>
> <br>
> -                     /*<br>
> -                      * core_link_read_dpcd() will invoke<br>
> dm_helpers_dp_read_dpcd(),<br>
> -                      * which needs to read dpcd info with the help of<br>
> aconnector.<br>
> -                      * If aconnector (dc->links[i]->prev) is NULL, then<br>
> dpcd status<br>
> -                      * cannot be read.<br>
> -                      */<br>
> -                     if (dc->links[i]->priv) {<br>
> -                             /* if any of the displays are lit up turn them<br>
> off */<br>
> -                             status = core_link_read_dpcd(dc->links[i],<br>
> DP_SET_POWER,<br>
> -<br>
>        &dpcd_power_state, sizeof(dpcd_power_state));<br>
> -                             if (status == DC_OK && dpcd_power_state ==<br>
> DP_POWER_STATE_D0) {<br>
> -                                     /* blank dp stream before power off<br>
> receiver*/<br>
> -                                     if (dc->links[i]->link_enc->funcs-<br>
> >get_dig_frontend) {<br>
> -                                             unsigned int fe = dc->links[i]-<br>
> >link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc);<br>
> -<br>
> -                                             for (j = 0; j < dc->res_pool-<br>
> >stream_enc_count; j++) {<br>
> -                                                     if (fe == dc-<br>
> >res_pool->stream_enc[j]->id) {<br>
> -                                                             dc-<br>
> >res_pool->stream_enc[j]->funcs->dp_blank(<br>
> -<br>
>                dc->res_pool->stream_enc[j]);<br>
> -                                                             break;<br>
> -                                                     }<br>
> +                     /* if any of the displays are lit up turn them off */<br>
> +                     status = core_link_read_dpcd(dc->links[i],<br>
> DP_SET_POWER,<br>
> +                                                     &dpcd_power_state,<br>
> sizeof(dpcd_power_state));<br>
> +                     if (status == DC_OK && dpcd_power_state ==<br>
> DP_POWER_STATE_D0) {<br>
> +                             /* blank dp stream before power off<br>
> receiver*/<br>
> +                             if (dc->links[i]->link_enc->funcs-<br>
> >get_dig_frontend) {<br>
> +                                     unsigned int fe =<br>
> +dc->links[i]->link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc)<br>
> +;<br>
> +<br>
> +                                     for (j = 0; j < dc->res_pool-<br>
> >stream_enc_count; j++) {<br>
> +                                             if (fe == dc->res_pool-<br>
> >stream_enc[j]->id) {<br>
> +                                                     dc->res_pool-<br>
> >stream_enc[j]->funcs->dp_blank(<br>
> +<br>
>        dc->res_pool->stream_enc[j]);<br>
> +                                                     break;<br>
>                                                }<br>
>                                        }<br>
> -                                     dp_receiver_power_ctrl(dc->links[i],<br>
> false);<br>
>                                }<br>
> +                             dp_receiver_power_ctrl(dc->links[i], false);<br>
>                        }<br>
>                }<br>
>        }<br>
> --<br>
> 2.17.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>