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

drm/amd/display: Add OTG/ODM functions

[WHY]
Required for correct OTG_H_TIMING_CNTL programming

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Michael Strauss <michael.strauss@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michael Strauss and committed by
Alex Deucher
5ade1b95 0d60f2b4

+34
+34
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c
··· 160 160 REG_WAIT(OTG_CLOCK_CONTROL, OTG_BUSY, 0, 1, 100000); 161 161 } 162 162 163 + static void optc314_set_odm_bypass(struct timing_generator *optc, 164 + const struct dc_crtc_timing *dc_crtc_timing) 165 + { 166 + struct optc *optc1 = DCN10TG_FROM_TG(optc); 167 + enum h_timing_div_mode h_div = H_TIMING_NO_DIV; 168 + 169 + REG_SET_5(OPTC_DATA_SOURCE_SELECT, 0, 170 + OPTC_NUM_OF_INPUT_SEGMENT, 0, 171 + OPTC_SEG0_SRC_SEL, optc->inst, 172 + OPTC_SEG1_SRC_SEL, 0xf, 173 + OPTC_SEG2_SRC_SEL, 0xf, 174 + OPTC_SEG3_SRC_SEL, 0xf 175 + ); 176 + 177 + h_div = optc1_is_two_pixels_per_containter(dc_crtc_timing); 178 + REG_UPDATE(OTG_H_TIMING_CNTL, 179 + OTG_H_TIMING_DIV_MODE, h_div); 180 + 181 + REG_SET(OPTC_MEMORY_CONFIG, 0, 182 + OPTC_MEM_SEL, 0); 183 + optc1->opp_count = 1; 184 + } 185 + 186 + static void optc314_set_h_timing_div_manual_mode(struct timing_generator *optc, bool manual_mode) 187 + { 188 + struct optc *optc1 = DCN10TG_FROM_TG(optc); 189 + 190 + REG_UPDATE(OTG_H_TIMING_CNTL, 191 + OTG_H_TIMING_DIV_MODE_MANUAL, manual_mode ? 1 : 0); 192 + } 193 + 163 194 164 195 static struct timing_generator_funcs dcn314_tg_funcs = { 165 196 .validate_timing = optc1_validate_timing, ··· 253 222 .setup_manual_trigger = optc2_setup_manual_trigger, 254 223 .get_hw_timing = optc1_get_hw_timing, 255 224 .init_odm = optc3_init_odm, 225 + .set_odm_bypass = optc314_set_odm_bypass, 226 + .set_odm_combine = optc314_set_odm_combine, 227 + .set_h_timing_div_manual_mode = optc314_set_h_timing_div_manual_mode, 256 228 }; 257 229 258 230 void dcn314_timing_generator_init(struct optc *optc1)