mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 13:22:23 +00:00
drm/i915: Use DIV_ROUND_CLOSEST()
vlv_find_best_dpll() has an open coded DIV_ROUND_CLOSEST(). Replace it with the real thing. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
43b0ac5317
commit
5de56df5c7
@ -695,8 +695,7 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
|
||||
p = p1 * p2;
|
||||
/* based on hardware requirement, prefer bigger m1,m2 values */
|
||||
for (m1 = limit->m1.min; m1 <= limit->m1.max; m1++) {
|
||||
m2 = (((2*(fastclk * p * n / m1 )) +
|
||||
refclk) / (2*refclk));
|
||||
m2 = DIV_ROUND_CLOSEST(fastclk * p * n, refclk * m1);
|
||||
m = m1 * m2;
|
||||
vco = updrate * m;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user