[PATCH] Revert "drm/amd/display: move edp sink present detection to hw init"

Kazlauskas, Nicholas nicholas.kazlauskas at amd.com
Mon Feb 8 19:57:18 UTC 2021


On 2021-02-08 2:25 p.m., Anson Jacob wrote:
> This reverts commit de6571ecbb88643fa4bb4172e65c12795a2f3124.
> 
> Patch causes regression in resume time.

Shouldn't affect any system that has an eDP connector on the board since 
it's expected to be present in end user configuration.

If we want to replicate the same behavior we had before for eDP 
connector + eDP disconnected then we'd want to make sure we're skipping 
the registration for the connector in DM.

Regards,
Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/dc/core/dc.c | 40 +++++++++++-------------
>   drivers/gpu/drm/amd/display/dc/dc_link.h |  2 --
>   2 files changed, 18 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index c9aede2f783d..8d5378f53243 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -205,9 +205,27 @@ static bool create_links(
>   		link = link_create(&link_init_params);
>   
>   		if (link) {
> +			bool should_destory_link = false;
> +
> +			if (link->connector_signal == SIGNAL_TYPE_EDP) {
> +				if (dc->config.edp_not_connected) {
> +					if (!IS_DIAG_DC(dc->ctx->dce_environment))
> +						should_destory_link = true;
> +				} else {
> +					enum dc_connection_type type;
> +					dc_link_detect_sink(link, &type);
> +					if (type == dc_connection_none)
> +						should_destory_link = true;
> +				}
> +			}
> +
> +			if (dc->config.force_enum_edp || !should_destory_link) {
>   				dc->links[dc->link_count] = link;
>   				link->dc = dc;
>   				++dc->link_count;
> +			} else {
> +				link_destroy(&link);
> +			}
>   		}
>   	}
>   
> @@ -998,30 +1016,8 @@ struct dc *dc_create(const struct dc_init_data *init_params)
>   	return NULL;
>   }
>   
> -static void detect_edp_presence(struct dc *dc)
> -{
> -	struct dc_link *edp_link = get_edp_link(dc);
> -	bool edp_sink_present = true;
> -
> -	if (!edp_link)
> -		return;
> -
> -	if (dc->config.edp_not_connected) {
> -			edp_sink_present = false;
> -	} else {
> -		enum dc_connection_type type;
> -		dc_link_detect_sink(edp_link, &type);
> -		if (type == dc_connection_none)
> -			edp_sink_present = false;
> -	}
> -
> -	edp_link->edp_sink_present = edp_sink_present;
> -}
> -
>   void dc_hardware_init(struct dc *dc)
>   {
> -
> -	detect_edp_presence(dc);
>   	if (dc->ctx->dce_environment != DCE_ENV_VIRTUAL_HW)
>   		dc->hwss.init_hw(dc);
>   }
> diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h
> index e189f16bc026..d5d8f0ad9233 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc_link.h
> +++ b/drivers/gpu/drm/amd/display/dc/dc_link.h
> @@ -103,8 +103,6 @@ struct dc_link {
>   	bool lttpr_non_transparent_mode;
>   	bool is_internal_display;
>   
> -	bool edp_sink_present;
> -
>   	/* caps is the same as reported_link_cap. link_traing use
>   	 * reported_link_cap. Will clean up.  TODO
>   	 */
> 




More information about the amd-gfx mailing list