drm/i915: Fix divide by zero on watermark update
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +3 -1
@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)return 0 ; -return DIV_ROUND_UP (8 * p->pipe_htotal *1000 , p->pixel_rate); +if (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,
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
2015-07-16 13:00 GMT-03:00 Mika Kuoppala <[email protected]>:
Quoted 5 lines
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.
Shouldn't we WARN() here?
Quoted 30 lines
Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)return 0 ; -return DIV_ROUND_UP (8 * p->pipe_htotal *1000 , p->pixel_rate); +if (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, --2.1.4
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Paulo Zanoni _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 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)
--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +3 -1
@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)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,
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
2015-07-16 13:36 GMT-03:00 Mika Kuoppala <[email protected]>:
Quoted 7 lines
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_ONadded (Paulo)
Since we're not hiding the problem (due to the WARN_ON) and the patch improves the current situation:
Quoted 27 lines
Cc Paulo Zanoni <[email protected]>Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)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, --2.1.4
Signature · 5 lines
Paulo Zanoni _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedQuoted 4 lines · Paulo Zanoni
2015-07-16 13:36 GMT-03:00 Mika Kuoppala <[email protected]>:
Quoted 3 lines
Fix divide by zero if we end up updating the watermarks with zero dotclock.
Quoted 8 lines
Quoted 4 lines
This is a stop gap measure to allow module load in cases where our state keeping fails.
v2:
WARN_ONadded (Paulo)Since we're not hiding the problem (due to the
WARN_ON) and the patch improves the current situation:Reviewed-by Paulo Zanoni <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 37 lines
Quoted 28 lines
Cc Paulo Zanoni <[email protected]>Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)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, --2.1.4
Signature · 5 lines
Paulo Zanoni _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Mika Kuoppala
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_ONadded (Paulo)Cc Paulo Zanoni <[email protected]>Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>
I want to say a loading module is more important than a proper fix, so:
Signature · 1 line
Damien
Quoted 23 lines
--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +3
-1@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)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,Signature · 1 line
2.1.4
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · Damien Lespiau
Quoted 8 lines · Mika Kuoppala
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_ONadded (Paulo)
Quoted 7 lines
Quoted 3 lines
Cc Paulo Zanoni <[email protected]>Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>I want to say a loading module is more important than a proper fix, so:
Reviewed-by Damien Lespiau <[email protected]>
Also it'd be great to ammend the prefix: 'drm/i915/skl'.
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 7 lines · Damien Lespiau
Quoted 6 lines · Mika Kuoppala
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.
Quoted 7 lines
Quoted 5 lines
v2:
WARN_ONadded (Paulo)Cc Paulo Zanoni <[email protected]>Cc Damien Lespiau <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>I want to say a loading module is more important than a proper fix, so:
Any ideas on the proper fix? Patches on the list, sketches on a post-it, anything? I've got a machine here hitting this.
BR,
Jani.
Quoted 33 lines
Reviewed-by Damien Lespiau <[email protected]>Signature · 1 line
DamienQuoted 23 lines
--- drivers/gpu/drm/i915/intel_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +3
-1@@ -3316,8 +3316,10 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)if (!to_intel_crtc (crtc)->active)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,Signature · 1 line
2.1.4_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx