aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_display.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index bc9cc9211e67..10d70540fc50 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -633,37 +633,37 @@ calc_fb_div(struct radeon_pll *pll,
633 633
634 vco_freq = freq * post_div; 634 vco_freq = freq * post_div;
635 /* feedback_divider = vco_freq * ref_div / pll->reference_freq; */ 635 /* feedback_divider = vco_freq * ref_div / pll->reference_freq; */
636 a.full = rfixed_const(pll->reference_freq); 636 a.full = dfixed_const(pll->reference_freq);
637 feedback_divider.full = rfixed_const(vco_freq); 637 feedback_divider.full = dfixed_const(vco_freq);
638 feedback_divider.full = rfixed_div(feedback_divider, a); 638 feedback_divider.full = dfixed_div(feedback_divider, a);
639 a.full = rfixed_const(ref_div); 639 a.full = dfixed_const(ref_div);
640 feedback_divider.full = rfixed_mul(feedback_divider, a); 640 feedback_divider.full = dfixed_mul(feedback_divider, a);
641 641
642 if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV) { 642 if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV) {
643 /* feedback_divider = floor((feedback_divider * 10.0) + 0.5) * 0.1; */ 643 /* feedback_divider = floor((feedback_divider * 10.0) + 0.5) * 0.1; */
644 a.full = rfixed_const(10); 644 a.full = dfixed_const(10);
645 feedback_divider.full = rfixed_mul(feedback_divider, a); 645 feedback_divider.full = dfixed_mul(feedback_divider, a);
646 feedback_divider.full += rfixed_const_half(0); 646 feedback_divider.full += dfixed_const_half(0);
647 feedback_divider.full = rfixed_floor(feedback_divider); 647 feedback_divider.full = dfixed_floor(feedback_divider);
648 feedback_divider.full = rfixed_div(feedback_divider, a); 648 feedback_divider.full = dfixed_div(feedback_divider, a);
649 649
650 /* *fb_div = floor(feedback_divider); */ 650 /* *fb_div = floor(feedback_divider); */
651 a.full = rfixed_floor(feedback_divider); 651 a.full = dfixed_floor(feedback_divider);
652 *fb_div = rfixed_trunc(a); 652 *fb_div = dfixed_trunc(a);
653 /* *fb_div_frac = fmod(feedback_divider, 1.0) * 10.0; */ 653 /* *fb_div_frac = fmod(feedback_divider, 1.0) * 10.0; */
654 a.full = rfixed_const(10); 654 a.full = dfixed_const(10);
655 b.full = rfixed_mul(feedback_divider, a); 655 b.full = dfixed_mul(feedback_divider, a);
656 656
657 feedback_divider.full = rfixed_floor(feedback_divider); 657 feedback_divider.full = dfixed_floor(feedback_divider);
658 feedback_divider.full = rfixed_mul(feedback_divider, a); 658 feedback_divider.full = dfixed_mul(feedback_divider, a);
659 feedback_divider.full = b.full - feedback_divider.full; 659 feedback_divider.full = b.full - feedback_divider.full;
660 *fb_div_frac = rfixed_trunc(feedback_divider); 660 *fb_div_frac = dfixed_trunc(feedback_divider);
661 } else { 661 } else {
662 /* *fb_div = floor(feedback_divider + 0.5); */ 662 /* *fb_div = floor(feedback_divider + 0.5); */
663 feedback_divider.full += rfixed_const_half(0); 663 feedback_divider.full += dfixed_const_half(0);
664 feedback_divider.full = rfixed_floor(feedback_divider); 664 feedback_divider.full = dfixed_floor(feedback_divider);
665 665
666 *fb_div = rfixed_trunc(feedback_divider); 666 *fb_div = dfixed_trunc(feedback_divider);
667 *fb_div_frac = 0; 667 *fb_div_frac = 0;
668 } 668 }
669 669
@@ -693,10 +693,10 @@ calc_fb_ref_div(struct radeon_pll *pll,
693 pll_out_max = pll->pll_out_max; 693 pll_out_max = pll->pll_out_max;
694 } 694 }
695 695
696 ffreq.full = rfixed_const(freq); 696 ffreq.full = dfixed_const(freq);
697 /* max_error = ffreq * 0.0025; */ 697 /* max_error = ffreq * 0.0025; */
698 a.full = rfixed_const(400); 698 a.full = dfixed_const(400);
699 max_error.full = rfixed_div(ffreq, a); 699 max_error.full = dfixed_div(ffreq, a);
700 700
701 for ((*ref_div) = pll->min_ref_div; (*ref_div) < pll->max_ref_div; ++(*ref_div)) { 701 for ((*ref_div) = pll->min_ref_div; (*ref_div) < pll->max_ref_div; ++(*ref_div)) {
702 if (calc_fb_div(pll, freq, post_div, (*ref_div), fb_div, fb_div_frac)) { 702 if (calc_fb_div(pll, freq, post_div, (*ref_div), fb_div, fb_div_frac)) {
@@ -707,9 +707,9 @@ calc_fb_ref_div(struct radeon_pll *pll,
707 continue; 707 continue;
708 708
709 /* pll_out = vco / post_div; */ 709 /* pll_out = vco / post_div; */
710 a.full = rfixed_const(post_div); 710 a.full = dfixed_const(post_div);
711 pll_out.full = rfixed_const(vco); 711 pll_out.full = dfixed_const(vco);
712 pll_out.full = rfixed_div(pll_out, a); 712 pll_out.full = dfixed_div(pll_out, a);
713 713
714 if (pll_out.full >= ffreq.full) { 714 if (pll_out.full >= ffreq.full) {
715 error.full = pll_out.full - ffreq.full; 715 error.full = pll_out.full - ffreq.full;
@@ -1099,15 +1099,15 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
1099 } 1099 }
1100 if (radeon_crtc->rmx_type != RMX_OFF) { 1100 if (radeon_crtc->rmx_type != RMX_OFF) {
1101 fixed20_12 a, b; 1101 fixed20_12 a, b;
1102 a.full = rfixed_const(crtc->mode.vdisplay); 1102 a.full = dfixed_const(crtc->mode.vdisplay);
1103 b.full = rfixed_const(radeon_crtc->native_mode.hdisplay); 1103 b.full = dfixed_const(radeon_crtc->native_mode.hdisplay);
1104 radeon_crtc->vsc.full = rfixed_div(a, b); 1104 radeon_crtc->vsc.full = dfixed_div(a, b);
1105 a.full = rfixed_const(crtc->mode.hdisplay); 1105 a.full = dfixed_const(crtc->mode.hdisplay);
1106 b.full = rfixed_const(radeon_crtc->native_mode.vdisplay); 1106 b.full = dfixed_const(radeon_crtc->native_mode.vdisplay);
1107 radeon_crtc->hsc.full = rfixed_div(a, b); 1107 radeon_crtc->hsc.full = dfixed_div(a, b);
1108 } else { 1108 } else {
1109 radeon_crtc->vsc.full = rfixed_const(1); 1109 radeon_crtc->vsc.full = dfixed_const(1);
1110 radeon_crtc->hsc.full = rfixed_const(1); 1110 radeon_crtc->hsc.full = dfixed_const(1);
1111 } 1111 }
1112 return true; 1112 return true;
1113} 1113}