From: Maarten Lankhorst Date: Wed, 2 Mar 2016 11:36:03 +0000 (+0100) Subject: drm/i915: Handle invalid ilk pipe watermarks correctly. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a426d6116467e09954289ee8c273e1bcc003adc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Handle invalid ilk pipe watermarks correctly. This function returns an int, but when ilk_validate_pipe_wm fails it returns false, which is 0 (success). As a result invalid watermarks are applied, while they should have been rejected. Fix this by returning -EINVAL. Fixes: ed4a6a7ca853 ("drm/i915: Add two-stage ILK-style watermark programming (v11)") Cc: Matt Roper Signed-off-by: Maarten Lankhorst Link: http://patchwork.freedesktop.org/patch/msgid/1456918563-28696-1-git-send-email-maarten.lankhorst@linux.intel.com Reviewed-by: Matt Roper --- diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d33de954a2e4..7df5a6318c51 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -2345,7 +2345,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc, pipe_wm->linetime = hsw_compute_linetime_wm(dev, cstate); if (!ilk_validate_pipe_wm(dev, pipe_wm)) - return false; + return -EINVAL; ilk_compute_wm_reg_maximums(dev, 1, &max);