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

drm/amd/display: Enable DTBCLK DTO earlier in the sequence

[why]
As per programming guide, we need to
enable the virtual pixel clock via DTBCLK
DTO and ungate the clock before we begin
programming OPP/OPTC control registers.
Otherwise, the double-buffered registers
will be left pending until the clocks are enabled.

[how]
Move the DTBCLK DTO programming up to
where we do the legacy DP DTO programming.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Sung Joon Kim <sungjoon.kim@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sung Joon Kim and committed by
Alex Deucher
14f9db42 5db346c2

+16 -16
+16 -16
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
··· 873 873 return DC_ERROR_UNEXPECTED; 874 874 } 875 875 876 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 877 + struct dccg *dccg = dc->res_pool->dccg; 878 + struct timing_generator *tg = pipe_ctx->stream_res.tg; 879 + struct dtbclk_dto_params dto_params = {0}; 880 + 881 + if (dccg->funcs->set_dtbclk_p_src) 882 + dccg->funcs->set_dtbclk_p_src(dccg, DTBCLK0, tg->inst); 883 + 884 + dto_params.otg_inst = tg->inst; 885 + dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz / 10; 886 + dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx); 887 + dto_params.timing = &pipe_ctx->stream->timing; 888 + dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr); 889 + dccg->funcs->set_dtbclk_dto(dccg, &dto_params); 890 + } 891 + 876 892 if (dc_is_hdmi_tmds_signal(stream->signal)) { 877 893 stream->link->phy_state.symclk_ref_cnts.otg = 1; 878 894 if (stream->link->phy_state.symclk_state == SYMCLK_OFF_TX_OFF) ··· 973 957 if (pipe_ctx->stream && dc_state_get_pipe_subvp_type(context, pipe_ctx) == SUBVP_PHANTOM) { 974 958 if (pipe_ctx->stream_res.tg && pipe_ctx->stream_res.tg->funcs->phantom_crtc_post_enable) 975 959 pipe_ctx->stream_res.tg->funcs->phantom_crtc_post_enable(pipe_ctx->stream_res.tg); 976 - } 977 - 978 - if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 979 - struct dccg *dccg = dc->res_pool->dccg; 980 - struct timing_generator *tg = pipe_ctx->stream_res.tg; 981 - struct dtbclk_dto_params dto_params = {0}; 982 - 983 - if (dccg->funcs->set_dtbclk_p_src) 984 - dccg->funcs->set_dtbclk_p_src(dccg, DTBCLK0, tg->inst); 985 - 986 - dto_params.otg_inst = tg->inst; 987 - dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz / 10; 988 - dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx); 989 - dto_params.timing = &pipe_ctx->stream->timing; 990 - dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr); 991 - dccg->funcs->set_dtbclk_dto(dccg, &dto_params); 992 960 } 993 961 994 962 return DC_OK;