[Intel-gfx] [PATCH] drm/i915: Compute WR PLL dividers dynamically
Damien Lespiau
damien.lespiau at intel.com
Fri May 10 14:59:11 CEST 2013
On Wed, May 08, 2013 at 09:37:14PM +0200, Daniel Vetter wrote:
> Oops, blows up on 32bit machines. I guess the igt will be useful once more
> to check that the 32bit version is solid, too. Dropped from dinq for now.
> -Daniel
Oops indeed.
Turns out the mistake was an easy one to spot. I used 1e6 as a contant, which
is a double constant (!) and promoted the expression to a floating point
multiplication before casting it back to a 64 bits integer. The diff between
the problematic patch and the resent one (which will follow this mail) is quite
straightforward then:
$ git diff
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 9ee25e7..5c35386 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -530,8 +530,8 @@ static void wrpll_update_rnp(uint64_t freq2k, unsigned budget,
diff = ABS_DIFF((freq2k * p * r2), (LC_FREQ_2K * n2));
diff_best = ABS_DIFF((freq2k * best->p * best->r2),
(LC_FREQ_2K * best->n2));
- c = 1e6 * diff;
- d = 1e6 * diff_best;
+ c = 1000000 * diff;
+ d = 1000000 * diff_best;
if (a < c && b < d) {
/* If both are above the budget, pick the closer */
--
Damien
More information about the Intel-gfx
mailing list