Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 661abfc0 authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Daniel Vetter
Browse files

drm/i915: Fix divide by zero on watermark update



Fix divide by zero if we end up updating the watermarks
with zero dotclock.

This is a stop gap measure to allow module load in cases
where our state keeping fails.

v2: WARN_ON added (Paulo)

Cc: Paulo Zanoni <przanoni@gmail.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 26495481
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)
	if (!to_intel_crtc(crtc)->active)
	if (!to_intel_crtc(crtc)->active)
		return 0;
		return 0;


	return DIV_ROUND_UP(8 * p->pipe_htotal * 1000, p->pixel_rate);
	if (WARN_ON(p->pixel_rate == 0))
		return 0;


	return DIV_ROUND_UP(8 * p->pipe_htotal * 1000, p->pixel_rate);
}
}


static void skl_compute_transition_wm(struct drm_crtc *crtc,
static void skl_compute_transition_wm(struct drm_crtc *crtc,