[PATCH 05/14] drm/amd/display: Enable SST DSC in DM

Mikita Lipski mlipski at amd.com
Mon Aug 19 18:46:34 UTC 2019


Tested-by: Mikita Lipski <Mikita.Lipski at amd.com>

Mikita Lipski

On 2019-08-19 11:50 a.m., David Francis wrote:
> In create_stream_for_sink, check for SST DP connectors
> 
> Parse DSC caps to DC format, then, if DSC is supported,
> compute the config
> 
> DSC hardware will be programmed by dc_commit_state
> 
> Cc: Mikita Lipski <Mikita.Lipski at amd.com>
> Signed-off-by: David Francis <David.Francis at amd.com>
> ---
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 ++++++++++++-------
>   .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  4 ++-
>   2 files changed, 24 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 911fe78b47c1..84249057e181 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3576,6 +3576,10 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>   	bool scale = dm_state ? (dm_state->scaling != RMX_OFF) : false;
>   	int mode_refresh;
>   	int preferred_refresh = 0;
> +#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
> +	struct dsc_dec_dpcd_caps dsc_caps;
> +	uint32_t link_bandwidth_kbps;
> +#endif
>   
>   	struct dc_sink *sink = NULL;
>   	if (aconnector == NULL) {
> @@ -3648,17 +3652,23 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>   			&mode, &aconnector->base, con_state, old_stream);
>   
>   #ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
> -	/* stream->timing.flags.DSC = 0; */
> -        /*  */
> -	/* if (aconnector->dc_link && */
> -	/* 		aconnector->dc_link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT #<{(|&& */
> -	/* 		aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.is_dsc_supported|)}>#) */
> -	/* 	if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc, */
> -	/* 			&aconnector->dc_link->dpcd_caps.dsc_caps, */
> -	/* 			dc_link_bandwidth_kbps(aconnector->dc_link, dc_link_get_link_cap(aconnector->dc_link)), */
> -	/* 			&stream->timing, */
> -	/* 			&stream->timing.dsc_cfg)) */
> -	/* 		stream->timing.flags.DSC = 1; */
> +	stream->timing.flags.DSC = 0;
> +
> +	if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
> +		dc_dsc_parse_dsc_dpcd(aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
> +				      aconnector->dc_link->dpcd_caps.dsc_caps.dsc_ext_caps.raw,
> +				      &dsc_caps);
> +		link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
> +							     dc_link_get_link_cap(aconnector->dc_link));
> +
> +		if (dsc_caps.is_dsc_supported)
> +			if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc,
> +						  &dsc_caps,
> +						  link_bandwidth_kbps,
> +						  &stream->timing,
> +						  &stream->timing.dsc_cfg))
> +				stream->timing.flags.DSC = 1;
> +	}
>   #endif
>   
>   	update_stream_scaling_settings(&mode, dm_state, stream);
> 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 7cf0573ab25f..5f2c315b18ba 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
> @@ -549,7 +549,9 @@ bool dm_helpers_dp_write_dsc_enable(
>   		bool enable
>   )
>   {
> -	return false;
> +	uint8_t enable_dsc = enable ? 1 : 0;
> +
> +	return dm_helpers_dp_write_dpcd(ctx, stream->sink->link, DP_DSC_ENABLE, &enable_dsc, 1);
>   }
>   #endif
>   
> 


More information about the dri-devel mailing list