Commit 619d4d04 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/i915: Use DIV_ROUND_UP() when calculating number of required FDI lanes

If we need precisely N lanes to satisfy the FDI bandwidth requirement,
the code would still claim that we need N+1 lanes. Use DIV_ROUND_UP()
to get a more accurate answer.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8f7abfd8
...@@ -6161,7 +6161,7 @@ int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp) ...@@ -6161,7 +6161,7 @@ int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp)
* is 2.5%; use 5% for safety's sake. * is 2.5%; use 5% for safety's sake.
*/ */
u32 bps = target_clock * bpp * 21 / 20; u32 bps = target_clock * bpp * 21 / 20;
return bps / (link_bw * 8) + 1; return DIV_ROUND_UP(bps, link_bw * 8);
} }
static bool ironlake_needs_fb_cb_tune(struct dpll *dpll, int factor) static bool ironlake_needs_fb_cb_tune(struct dpll *dpll, int factor)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment