All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read
@ 2020-04-16 19:23 Zhan Liu
  2020-04-17 17:17 ` Liu, Zhan
  0 siblings, 1 reply; 3+ messages in thread
From: Zhan Liu @ 2020-04-16 19:23 UTC (permalink / raw)
  To: amd-gfx, zhan.liu

[Why]
Aconnector is not necessary to be NULL in order to read dpcd
successfully.

Actually if we rely on checking aconnector here, we won't be able
to turn off all displays before doing display detection. That will
cause some MST hubs not able to light up.

[How]
Remove aconnector check when turning off all displays at
hardware initialization stage.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
---
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 ++++++++-----------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 9f41efddc9bc..6f33f3f0d023 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1332,31 +1332,23 @@ void dcn10_init_hw(struct dc *dc)
 			if (dc->links[i]->connector_signal != SIGNAL_TYPE_DISPLAY_PORT)
 				continue;
 
-			/*
-			 * core_link_read_dpcd() will invoke dm_helpers_dp_read_dpcd(),
-			 * which needs to read dpcd info with the help of aconnector.
-			 * If aconnector (dc->links[i]->prev) is NULL, then dpcd status
-			 * cannot be read.
-			 */
-			if (dc->links[i]->priv) {
-				/* if any of the displays are lit up turn them off */
-				status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
-								&dpcd_power_state, sizeof(dpcd_power_state));
-				if (status == DC_OK && dpcd_power_state == DP_POWER_STATE_D0) {
-					/* blank dp stream before power off receiver*/
-					if (dc->links[i]->link_enc->funcs->get_dig_frontend) {
-						unsigned int fe = dc->links[i]->link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc);
-
-						for (j = 0; j < dc->res_pool->stream_enc_count; j++) {
-							if (fe == dc->res_pool->stream_enc[j]->id) {
-								dc->res_pool->stream_enc[j]->funcs->dp_blank(
-											dc->res_pool->stream_enc[j]);
-								break;
-							}
+			/* if any of the displays are lit up turn them off */
+			status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
+							&dpcd_power_state, sizeof(dpcd_power_state));
+			if (status == DC_OK && dpcd_power_state == DP_POWER_STATE_D0) {
+				/* blank dp stream before power off receiver*/
+				if (dc->links[i]->link_enc->funcs->get_dig_frontend) {
+					unsigned int fe = dc->links[i]->link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc);
+
+					for (j = 0; j < dc->res_pool->stream_enc_count; j++) {
+						if (fe == dc->res_pool->stream_enc[j]->id) {
+							dc->res_pool->stream_enc[j]->funcs->dp_blank(
+										dc->res_pool->stream_enc[j]);
+							break;
 						}
 					}
-					dp_receiver_power_ctrl(dc->links[i], false);
 				}
+				dp_receiver_power_ctrl(dc->links[i], false);
 			}
 		}
 	}
-- 
2.17.1

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

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

* RE: [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read
  2020-04-16 19:23 [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read Zhan Liu
@ 2020-04-17 17:17 ` Liu, Zhan
  2020-04-20 15:25   ` Gravenor, Joseph
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Zhan @ 2020-04-17 17:17 UTC (permalink / raw)
  To: Liu, Zhan, amd-gfx, Gravenor, Joseph

+ Joseph



Hi Joseph,

Would you like to help me review this change? This was a follow-up on the discussion we had earlier this year.

Thanks,
Zhan


> -----Original Message-----
> From: Liu, Zhan <zhan.liu@amd.com>
> Sent: 2020/April/16, Thursday 3:24 PM
> To: amd-gfx@lists.freedesktop.org; Liu, Zhan <Zhan.Liu@amd.com>
> Subject: [PATCH] drm/amd/display: Remove aconnector condition check for
> dpcd read
> 
> [Why]
> Aconnector is not necessary to be NULL in order to read dpcd successfully.
> 
> Actually if we rely on checking aconnector here, we won't be able to turn off
> all displays before doing display detection. That will cause some MST hubs
> not able to light up.
> 
> [How]
> Remove aconnector check when turning off all displays at hardware
> initialization stage.
> 
> Signed-off-by: Zhan Liu <zhan.liu@amd.com>
> ---
>  .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 ++++++++-----------
>  1 file changed, 14 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> index 9f41efddc9bc..6f33f3f0d023 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> @@ -1332,31 +1332,23 @@ void dcn10_init_hw(struct dc *dc)
>  			if (dc->links[i]->connector_signal !=
> SIGNAL_TYPE_DISPLAY_PORT)
>  				continue;
> 
> -			/*
> -			 * core_link_read_dpcd() will invoke
> dm_helpers_dp_read_dpcd(),
> -			 * which needs to read dpcd info with the help of
> aconnector.
> -			 * If aconnector (dc->links[i]->prev) is NULL, then
> dpcd status
> -			 * cannot be read.
> -			 */
> -			if (dc->links[i]->priv) {
> -				/* if any of the displays are lit up turn them
> off */
> -				status = core_link_read_dpcd(dc->links[i],
> DP_SET_POWER,
> -
> 	&dpcd_power_state, sizeof(dpcd_power_state));
> -				if (status == DC_OK && dpcd_power_state ==
> DP_POWER_STATE_D0) {
> -					/* blank dp stream before power off
> receiver*/
> -					if (dc->links[i]->link_enc->funcs-
> >get_dig_frontend) {
> -						unsigned int fe = dc->links[i]-
> >link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc);
> -
> -						for (j = 0; j < dc->res_pool-
> >stream_enc_count; j++) {
> -							if (fe == dc-
> >res_pool->stream_enc[j]->id) {
> -								dc-
> >res_pool->stream_enc[j]->funcs->dp_blank(
> -
> 		dc->res_pool->stream_enc[j]);
> -								break;
> -							}
> +			/* if any of the displays are lit up turn them off */
> +			status = core_link_read_dpcd(dc->links[i],
> DP_SET_POWER,
> +							&dpcd_power_state,
> sizeof(dpcd_power_state));
> +			if (status == DC_OK && dpcd_power_state ==
> DP_POWER_STATE_D0) {
> +				/* blank dp stream before power off
> receiver*/
> +				if (dc->links[i]->link_enc->funcs-
> >get_dig_frontend) {
> +					unsigned int fe =
> +dc->links[i]->link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc)
> +;
> +
> +					for (j = 0; j < dc->res_pool-
> >stream_enc_count; j++) {
> +						if (fe == dc->res_pool-
> >stream_enc[j]->id) {
> +							dc->res_pool-
> >stream_enc[j]->funcs->dp_blank(
> +
> 	dc->res_pool->stream_enc[j]);
> +							break;
>  						}
>  					}
> -					dp_receiver_power_ctrl(dc->links[i],
> false);
>  				}
> +				dp_receiver_power_ctrl(dc->links[i], false);
>  			}
>  		}
>  	}
> --
> 2.17.1

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

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

* Re: [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read
  2020-04-17 17:17 ` Liu, Zhan
@ 2020-04-20 15:25   ` Gravenor, Joseph
  0 siblings, 0 replies; 3+ messages in thread
From: Gravenor, Joseph @ 2020-04-20 15:25 UTC (permalink / raw)
  To: Liu, Zhan, amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 5060 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Joseph Gravenor <Joseph.Gravenor@amd.com>
________________________________
From: Liu, Zhan <Zhan.Liu@amd.com>
Sent: Friday, April 17, 2020 1:17 PM
To: Liu, Zhan <Zhan.Liu@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Gravenor, Joseph <Joseph.Gravenor@amd.com>
Subject: RE: [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read

+ Joseph



Hi Joseph,

Would you like to help me review this change? This was a follow-up on the discussion we had earlier this year.

Thanks,
Zhan


> -----Original Message-----
> From: Liu, Zhan <zhan.liu@amd.com>
> Sent: 2020/April/16, Thursday 3:24 PM
> To: amd-gfx@lists.freedesktop.org; Liu, Zhan <Zhan.Liu@amd.com>
> Subject: [PATCH] drm/amd/display: Remove aconnector condition check for
> dpcd read
>
> [Why]
> Aconnector is not necessary to be NULL in order to read dpcd successfully.
>
> Actually if we rely on checking aconnector here, we won't be able to turn off
> all displays before doing display detection. That will cause some MST hubs
> not able to light up.
>
> [How]
> Remove aconnector check when turning off all displays at hardware
> initialization stage.
>
> Signed-off-by: Zhan Liu <zhan.liu@amd.com>
> ---
>  .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 ++++++++-----------
>  1 file changed, 14 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> index 9f41efddc9bc..6f33f3f0d023 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> @@ -1332,31 +1332,23 @@ void dcn10_init_hw(struct dc *dc)
>                        if (dc->links[i]->connector_signal !=
> SIGNAL_TYPE_DISPLAY_PORT)
>                                continue;
>
> -                     /*
> -                      * core_link_read_dpcd() will invoke
> dm_helpers_dp_read_dpcd(),
> -                      * which needs to read dpcd info with the help of
> aconnector.
> -                      * If aconnector (dc->links[i]->prev) is NULL, then
> dpcd status
> -                      * cannot be read.
> -                      */
> -                     if (dc->links[i]->priv) {
> -                             /* if any of the displays are lit up turn them
> off */
> -                             status = core_link_read_dpcd(dc->links[i],
> DP_SET_POWER,
> -
>        &dpcd_power_state, sizeof(dpcd_power_state));
> -                             if (status == DC_OK && dpcd_power_state ==
> DP_POWER_STATE_D0) {
> -                                     /* blank dp stream before power off
> receiver*/
> -                                     if (dc->links[i]->link_enc->funcs-
> >get_dig_frontend) {
> -                                             unsigned int fe = dc->links[i]-
> >link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc);
> -
> -                                             for (j = 0; j < dc->res_pool-
> >stream_enc_count; j++) {
> -                                                     if (fe == dc-
> >res_pool->stream_enc[j]->id) {
> -                                                             dc-
> >res_pool->stream_enc[j]->funcs->dp_blank(
> -
>                dc->res_pool->stream_enc[j]);
> -                                                             break;
> -                                                     }
> +                     /* if any of the displays are lit up turn them off */
> +                     status = core_link_read_dpcd(dc->links[i],
> DP_SET_POWER,
> +                                                     &dpcd_power_state,
> sizeof(dpcd_power_state));
> +                     if (status == DC_OK && dpcd_power_state ==
> DP_POWER_STATE_D0) {
> +                             /* blank dp stream before power off
> receiver*/
> +                             if (dc->links[i]->link_enc->funcs-
> >get_dig_frontend) {
> +                                     unsigned int fe =
> +dc->links[i]->link_enc->funcs->get_dig_frontend(dc->links[i]->link_enc)
> +;
> +
> +                                     for (j = 0; j < dc->res_pool-
> >stream_enc_count; j++) {
> +                                             if (fe == dc->res_pool-
> >stream_enc[j]->id) {
> +                                                     dc->res_pool-
> >stream_enc[j]->funcs->dp_blank(
> +
>        dc->res_pool->stream_enc[j]);
> +                                                     break;
>                                                }
>                                        }
> -                                     dp_receiver_power_ctrl(dc->links[i],
> false);
>                                }
> +                             dp_receiver_power_ctrl(dc->links[i], false);
>                        }
>                }
>        }
> --
> 2.17.1


[-- Attachment #1.2: Type: text/html, Size: 13584 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

end of thread, other threads:[~2020-04-20 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 19:23 [PATCH] drm/amd/display: Remove aconnector condition check for dpcd read Zhan Liu
2020-04-17 17:17 ` Liu, Zhan
2020-04-20 15:25   ` Gravenor, Joseph

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.