Lines Matching refs:amdgpu_crtc

45 	struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);  in amdgpu_atombios_crtc_overscan_setup()  local
52 args.ucCRTC = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_overscan_setup()
54 switch (amdgpu_crtc->rmx_type) { in amdgpu_atombios_crtc_overscan_setup()
75 args.usOverscanRight = cpu_to_le16(amdgpu_crtc->h_border); in amdgpu_atombios_crtc_overscan_setup()
76 args.usOverscanLeft = cpu_to_le16(amdgpu_crtc->h_border); in amdgpu_atombios_crtc_overscan_setup()
77 args.usOverscanBottom = cpu_to_le16(amdgpu_crtc->v_border); in amdgpu_atombios_crtc_overscan_setup()
78 args.usOverscanTop = cpu_to_le16(amdgpu_crtc->v_border); in amdgpu_atombios_crtc_overscan_setup()
88 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_scaler_setup() local
94 args.ucScaler = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_scaler_setup()
96 switch (amdgpu_crtc->rmx_type) { in amdgpu_atombios_crtc_scaler_setup()
115 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_lock() local
124 args.ucCRTC = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_lock()
132 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_enable() local
140 args.ucCRTC = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_enable()
148 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_blank() local
156 args.ucCRTC = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_blank()
164 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_powergate() local
172 args.ucDispPipeId = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_powergate()
193 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_set_dtd_timing() local
201 args.usH_Size = cpu_to_le16(mode->crtc_hdisplay - (amdgpu_crtc->h_border * 2)); in amdgpu_atombios_crtc_set_dtd_timing()
203 cpu_to_le16(mode->crtc_hblank_end - mode->crtc_hdisplay + (amdgpu_crtc->h_border * 2)); in amdgpu_atombios_crtc_set_dtd_timing()
204 args.usV_Size = cpu_to_le16(mode->crtc_vdisplay - (amdgpu_crtc->v_border * 2)); in amdgpu_atombios_crtc_set_dtd_timing()
206 cpu_to_le16(mode->crtc_vblank_end - mode->crtc_vdisplay + (amdgpu_crtc->v_border * 2)); in amdgpu_atombios_crtc_set_dtd_timing()
208 cpu_to_le16(mode->crtc_hsync_start - mode->crtc_hdisplay + amdgpu_crtc->h_border); in amdgpu_atombios_crtc_set_dtd_timing()
212 cpu_to_le16(mode->crtc_vsync_start - mode->crtc_vdisplay + amdgpu_crtc->v_border); in amdgpu_atombios_crtc_set_dtd_timing()
215 args.ucH_Border = amdgpu_crtc->h_border; in amdgpu_atombios_crtc_set_dtd_timing()
216 args.ucV_Border = amdgpu_crtc->v_border; in amdgpu_atombios_crtc_set_dtd_timing()
230 args.ucCRTC = amdgpu_crtc->crtc_id; in amdgpu_atombios_crtc_set_dtd_timing()
308 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_adjust_pll() local
311 struct drm_encoder *encoder = amdgpu_crtc->encoder; in amdgpu_atombios_crtc_adjust_pll()
318 int bpc = amdgpu_crtc->bpc; in amdgpu_atombios_crtc_adjust_pll()
324 amdgpu_crtc->pll_flags = AMDGPU_PLL_USE_FRAC_FB_DIV; in amdgpu_atombios_crtc_adjust_pll()
339 if (amdgpu_crtc->ss_enabled) { in amdgpu_atombios_crtc_adjust_pll()
340 if (amdgpu_crtc->ss.refdiv) { in amdgpu_atombios_crtc_adjust_pll()
341 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_REF_DIV; in amdgpu_atombios_crtc_adjust_pll()
342 amdgpu_crtc->pll_reference_div = amdgpu_crtc->ss.refdiv; in amdgpu_atombios_crtc_adjust_pll()
343 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_FRAC_FB_DIV; in amdgpu_atombios_crtc_adjust_pll()
352 amdgpu_crtc->pll_flags |= AMDGPU_PLL_PREFER_CLOSEST_LOWER; in amdgpu_atombios_crtc_adjust_pll()
354 amdgpu_crtc->pll_flags |= AMDGPU_PLL_IS_LCD; in amdgpu_atombios_crtc_adjust_pll()
394 if (amdgpu_crtc->ss_enabled && amdgpu_crtc->ss.percentage) in amdgpu_atombios_crtc_adjust_pll()
407 if (amdgpu_crtc->ss_enabled && amdgpu_crtc->ss.percentage) in amdgpu_atombios_crtc_adjust_pll()
435 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_FRAC_FB_DIV; in amdgpu_atombios_crtc_adjust_pll()
436 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_REF_DIV; in amdgpu_atombios_crtc_adjust_pll()
437 amdgpu_crtc->pll_reference_div = args.v3.sOutput.ucRefDiv; in amdgpu_atombios_crtc_adjust_pll()
440 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_FRAC_FB_DIV; in amdgpu_atombios_crtc_adjust_pll()
441 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_POST_DIV; in amdgpu_atombios_crtc_adjust_pll()
442 amdgpu_crtc->pll_post_div = args.v3.sOutput.ucPostDiv; in amdgpu_atombios_crtc_adjust_pll()
750 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_prepare_pll() local
754 to_amdgpu_encoder(amdgpu_crtc->encoder); in amdgpu_atombios_crtc_prepare_pll()
755 int encoder_mode = amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder); in amdgpu_atombios_crtc_prepare_pll()
757 amdgpu_crtc->bpc = 8; in amdgpu_atombios_crtc_prepare_pll()
758 amdgpu_crtc->ss_enabled = false; in amdgpu_atombios_crtc_prepare_pll()
761 (amdgpu_encoder_get_dp_bridge_encoder_id(amdgpu_crtc->encoder) != ENCODER_OBJECT_ID_NONE)) { in amdgpu_atombios_crtc_prepare_pll()
764 amdgpu_get_connector_for_encoder(amdgpu_crtc->encoder); in amdgpu_atombios_crtc_prepare_pll()
773 amdgpu_crtc->bpc = amdgpu_connector_get_monitor_bpc(connector); in amdgpu_atombios_crtc_prepare_pll()
780 amdgpu_crtc->ss_enabled = in amdgpu_atombios_crtc_prepare_pll()
781 amdgpu_atombios_get_asic_ss_info(adev, &amdgpu_crtc->ss, in amdgpu_atombios_crtc_prepare_pll()
786 amdgpu_crtc->ss_enabled = in amdgpu_atombios_crtc_prepare_pll()
788 &amdgpu_crtc->ss, in amdgpu_atombios_crtc_prepare_pll()
793 amdgpu_crtc->ss_enabled = in amdgpu_atombios_crtc_prepare_pll()
795 &amdgpu_crtc->ss, in amdgpu_atombios_crtc_prepare_pll()
800 amdgpu_crtc->ss_enabled = in amdgpu_atombios_crtc_prepare_pll()
802 &amdgpu_crtc->ss, in amdgpu_atombios_crtc_prepare_pll()
812 amdgpu_crtc->adjusted_clock = amdgpu_atombios_crtc_adjust_pll(crtc, mode); in amdgpu_atombios_crtc_prepare_pll()
819 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); in amdgpu_atombios_crtc_set_pll() local
823 to_amdgpu_encoder(amdgpu_crtc->encoder); in amdgpu_atombios_crtc_set_pll()
828 int encoder_mode = amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder); in amdgpu_atombios_crtc_set_pll()
832 (amdgpu_crtc->bpc > 8)) in amdgpu_atombios_crtc_set_pll()
833 clock = amdgpu_crtc->adjusted_clock; in amdgpu_atombios_crtc_set_pll()
835 switch (amdgpu_crtc->pll_id) { in amdgpu_atombios_crtc_set_pll()
850 pll->flags = amdgpu_crtc->pll_flags; in amdgpu_atombios_crtc_set_pll()
851 pll->reference_div = amdgpu_crtc->pll_reference_div; in amdgpu_atombios_crtc_set_pll()
852 pll->post_div = amdgpu_crtc->pll_post_div; in amdgpu_atombios_crtc_set_pll()
854 amdgpu_pll_compute(adev, pll, amdgpu_crtc->adjusted_clock, &pll_clock, in amdgpu_atombios_crtc_set_pll()
857 amdgpu_atombios_crtc_program_ss(adev, ATOM_DISABLE, amdgpu_crtc->pll_id, in amdgpu_atombios_crtc_set_pll()
858 amdgpu_crtc->crtc_id, &amdgpu_crtc->ss); in amdgpu_atombios_crtc_set_pll()
860 amdgpu_atombios_crtc_program_pll(crtc, amdgpu_crtc->crtc_id, amdgpu_crtc->pll_id, in amdgpu_atombios_crtc_set_pll()
863 amdgpu_crtc->bpc, amdgpu_crtc->ss_enabled, &amdgpu_crtc->ss); in amdgpu_atombios_crtc_set_pll()
865 if (amdgpu_crtc->ss_enabled) { in amdgpu_atombios_crtc_set_pll()
869 (u32)amdgpu_crtc->ss.percentage) / in amdgpu_atombios_crtc_set_pll()
870 (100 * (u32)amdgpu_crtc->ss.percentage_divider); in amdgpu_atombios_crtc_set_pll()
871 amdgpu_crtc->ss.amount = (amount / 10) & ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK; in amdgpu_atombios_crtc_set_pll()
872 amdgpu_crtc->ss.amount |= ((amount - (amount / 10)) << ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT) & in amdgpu_atombios_crtc_set_pll()
874 if (amdgpu_crtc->ss.type & ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD) in amdgpu_atombios_crtc_set_pll()
875 step_size = (4 * amount * ref_div * ((u32)amdgpu_crtc->ss.rate * 2048)) / in amdgpu_atombios_crtc_set_pll()
878 step_size = (2 * amount * ref_div * ((u32)amdgpu_crtc->ss.rate * 2048)) / in amdgpu_atombios_crtc_set_pll()
880 amdgpu_crtc->ss.step = step_size; in amdgpu_atombios_crtc_set_pll()
882 amdgpu_atombios_crtc_program_ss(adev, ATOM_ENABLE, amdgpu_crtc->pll_id, in amdgpu_atombios_crtc_set_pll()
883 amdgpu_crtc->crtc_id, &amdgpu_crtc->ss); in amdgpu_atombios_crtc_set_pll()