Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: extract set stream attribute to link_hwss

[why]
Extract set stream attribute into link_hwss as part of the link hwss
refactor work.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wenjing Liu and committed by
Alex Deucher
eff5e115 3f689345

+94 -47
+9 -47
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 4123 4123 struct link_encoder *link_enc; 4124 4124 enum otg_out_mux_dest otg_out_dest = OUT_MUX_DIO; 4125 4125 struct vpg *vpg = pipe_ctx->stream_res.stream_enc->vpg; 4126 + const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res); 4126 4127 4127 4128 if (is_dp_128b_132b_signal(pipe_ctx)) 4128 4129 vpg = pipe_ctx->stream_res.hpo_dp_stream_enc->vpg; ··· 4152 4151 link_enc->funcs->setup( 4153 4152 link_enc, 4154 4153 pipe_ctx->stream->signal); 4155 - pipe_ctx->stream_res.stream_enc->funcs->setup_stereo_sync( 4156 - pipe_ctx->stream_res.stream_enc, 4157 - pipe_ctx->stream_res.tg->inst, 4158 - stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE); 4159 4154 } 4160 - 4161 - if (is_dp_128b_132b_signal(pipe_ctx)) { 4162 - pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->set_stream_attribute( 4163 - pipe_ctx->stream_res.hpo_dp_stream_enc, 4164 - &stream->timing, 4165 - stream->output_color_space, 4166 - stream->use_vsc_sdp_for_colorimetry, 4167 - stream->timing.flags.DSC, 4168 - false); 4169 - otg_out_dest = OUT_MUX_HPO_DP; 4170 - } else if (dc_is_dp_signal(pipe_ctx->stream->signal)) { 4171 - pipe_ctx->stream_res.stream_enc->funcs->dp_set_stream_attribute( 4172 - pipe_ctx->stream_res.stream_enc, 4173 - &stream->timing, 4174 - stream->output_color_space, 4175 - stream->use_vsc_sdp_for_colorimetry, 4176 - stream->link->dpcd_caps.dprx_feature.bits.SST_SPLIT_SDP_CAP); 4177 - } 4178 - 4179 - if (dc_is_dp_signal(pipe_ctx->stream->signal)) 4180 - dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_DP_STREAM_ATTR); 4181 - 4182 - if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal)) 4183 - pipe_ctx->stream_res.stream_enc->funcs->hdmi_set_stream_attribute( 4184 - pipe_ctx->stream_res.stream_enc, 4185 - &stream->timing, 4186 - stream->phy_pix_clk, 4187 - pipe_ctx->stream_res.audio != NULL); 4188 4155 4189 4156 pipe_ctx->stream->link->link_state_valid = true; 4190 4157 4191 - if (pipe_ctx->stream_res.tg->funcs->set_out_mux) 4158 + if (pipe_ctx->stream_res.tg->funcs->set_out_mux) { 4159 + if (is_dp_128b_132b_signal(pipe_ctx)) 4160 + otg_out_dest = OUT_MUX_HPO_DP; 4161 + else 4162 + otg_out_dest = OUT_MUX_DIO; 4192 4163 pipe_ctx->stream_res.tg->funcs->set_out_mux(pipe_ctx->stream_res.tg, otg_out_dest); 4164 + } 4193 4165 4194 - if (dc_is_dvi_signal(pipe_ctx->stream->signal)) 4195 - pipe_ctx->stream_res.stream_enc->funcs->dvi_set_stream_attribute( 4196 - pipe_ctx->stream_res.stream_enc, 4197 - &stream->timing, 4198 - (pipe_ctx->stream->signal == SIGNAL_TYPE_DVI_DUAL_LINK) ? 4199 - true : false); 4200 - 4201 - if (dc_is_lvds_signal(pipe_ctx->stream->signal)) 4202 - pipe_ctx->stream_res.stream_enc->funcs->lvds_set_stream_attribute( 4203 - pipe_ctx->stream_res.stream_enc, 4204 - &stream->timing); 4166 + link_hwss->setup_stream_attribute(pipe_ctx); 4205 4167 4206 4168 if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) { 4207 4169 bool apply_edp_fast_boot_optimization = ··· 4299 4335 dc->hwss.enable_audio_stream(pipe_ctx); 4300 4336 4301 4337 } else { // if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) 4302 - if (is_dp_128b_132b_signal(pipe_ctx)) { 4338 + if (is_dp_128b_132b_signal(pipe_ctx)) 4303 4339 fpga_dp_hpo_enable_link_and_stream(state, pipe_ctx); 4304 - } 4305 4340 if (dc_is_dp_signal(pipe_ctx->stream->signal) || 4306 4341 dc_is_virtual_signal(pipe_ctx->stream->signal)) 4307 4342 dp_set_dsc_enable(pipe_ctx, true); 4308 - 4309 4343 } 4310 4344 4311 4345 if (pipe_ctx->stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {