Commit 50b1f44e authored by Fangzhi Zuo's avatar Fangzhi Zuo Committed by Alex Deucher

drm/amd/display: Add DP-HDMI FRL PCON SST Support in DM

1. Parse DSC caps from PCON DPCD
2. Policy determins if DSC is decoded at PCON
3. Enable/disable DSC at PCON
Signed-off-by: default avatarFangzhi Zuo <Jerry.Zuo@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 81d104f4
...@@ -6056,10 +6056,12 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector, ...@@ -6056,10 +6056,12 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
if (aconnector->dc_link && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT || if (aconnector->dc_link && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
sink->sink_signal == SIGNAL_TYPE_EDP)) { sink->sink_signal == SIGNAL_TYPE_EDP)) {
dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc, if (sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE ||
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw, sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER)
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw, dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
dsc_caps); aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
dsc_caps);
} }
} }
...@@ -6129,6 +6131,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, ...@@ -6129,6 +6131,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
uint32_t link_bandwidth_kbps; uint32_t link_bandwidth_kbps;
uint32_t max_dsc_target_bpp_limit_override = 0; uint32_t max_dsc_target_bpp_limit_override = 0;
struct dc *dc = sink->ctx->dc; struct dc *dc = sink->ctx->dc;
uint32_t max_supported_bw_in_kbps, timing_bw_in_kbps;
uint32_t dsc_max_supported_bw_in_kbps;
link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
dc_link_get_link_cap(aconnector->dc_link)); dc_link_get_link_cap(aconnector->dc_link));
...@@ -6147,16 +6151,37 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, ...@@ -6147,16 +6151,37 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
apply_dsc_policy_for_edp(aconnector, sink, stream, dsc_caps, max_dsc_target_bpp_limit_override); apply_dsc_policy_for_edp(aconnector, sink, stream, dsc_caps, max_dsc_target_bpp_limit_override);
} else if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) { } else if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
if (sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) {
if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0], if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0],
dsc_caps, dsc_caps,
aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override, aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override,
max_dsc_target_bpp_limit_override, max_dsc_target_bpp_limit_override,
link_bandwidth_kbps, link_bandwidth_kbps,
&stream->timing, &stream->timing,
&stream->timing.dsc_cfg)) { &stream->timing.dsc_cfg)) {
stream->timing.flags.DSC = 1; stream->timing.flags.DSC = 1;
DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from SST RX\n", __func__, drm_connector->name); DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from SST RX\n",
__func__, drm_connector->name);
}
} else if (sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) {
timing_bw_in_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing);
max_supported_bw_in_kbps = link_bandwidth_kbps;
dsc_max_supported_bw_in_kbps = link_bandwidth_kbps;
if (timing_bw_in_kbps > max_supported_bw_in_kbps &&
max_supported_bw_in_kbps > 0 &&
dsc_max_supported_bw_in_kbps > 0)
if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0],
dsc_caps,
aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override,
max_dsc_target_bpp_limit_override,
dsc_max_supported_bw_in_kbps,
&stream->timing,
&stream->timing.dsc_cfg)) {
stream->timing.flags.DSC = 1;
DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from DP-HDMI PCON\n",
__func__, drm_connector->name);
}
} }
} }
......
...@@ -585,8 +585,17 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -585,8 +585,17 @@ bool dm_helpers_dp_write_dsc_enable(
} }
if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT || stream->signal == SIGNAL_TYPE_EDP) { if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT || stream->signal == SIGNAL_TYPE_EDP) {
ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1); #if defined(CONFIG_DRM_AMD_DC_DCN)
DC_LOG_DC("Send DSC %s to sst display\n", enable_dsc ? "enable" : "disable"); if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) {
#endif
ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
DC_LOG_DC("Send DSC %s to SST RX\n", enable_dsc ? "enable" : "disable");
#if defined(CONFIG_DRM_AMD_DC_DCN)
} else if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) {
ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
DC_LOG_DC("Send DSC %s to DP-HDMI PCON\n", enable_dsc ? "enable" : "disable");
}
#endif
} }
return (ret > 0); return (ret > 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment