mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 07:16:45 +07:00
drm/i915: fix haswell linetime watermarks calculation
Move the "*8" calculation to the left side so we don't propagate rounding errors. Also use DIV_ROUND_CLOSEST because that's what the spec says we need to do. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
7366937312
commit
eaa591ec52
@ -2093,7 +2093,7 @@ haswell_update_linetime_wm(struct drm_device *dev, struct drm_crtc *crtc)
|
||||
* row at the given clock rate, multiplied by 8.
|
||||
* */
|
||||
temp |= PIPE_WM_LINETIME_TIME(
|
||||
((mode->htotal * 1000) / mode->clock) * 8);
|
||||
DIV_ROUND_CLOSEST(mode->htotal * 1000 * 8, mode->clock));
|
||||
|
||||
/* IPS watermarks are only used by pipe A, and are ignored by
|
||||
* pipes B and C. They are calculated similarly to the common
|
||||
|
Loading…
Reference in New Issue
Block a user