[Intel-gfx] [PATCH 04/14] drm/i915: Don't underflow bestppm

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Sep 24 20:26:21 CEST 2013


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

We do 'bestppm - 10' in vlv_find_best_dpll() but never check whether
that might underflow. Add such a check.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f8d67b2..f646fea 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -709,7 +709,7 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
 						bestppm = 0;
 						flag = 1;
 					}
-					if (ppm < bestppm - 10) {
+					if (bestppm >= 10 && ppm < bestppm - 10) {
 						bestppm = ppm;
 						flag = 1;
 					}
-- 
1.8.1.5




More information about the Intel-gfx mailing list