[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1376962382-29913-1-git-send-email-furquan@google.com>
Date: Mon, 19 Aug 2013 18:33:01 -0700
From: Furquan Shaikh <furquan@...gle.com>
To: Jesse Barnes <jbarnes@...tuousgeek.org>,
Paulo Zanoni <paulo.r.zanoni@...el.com>,
Josh Triplett <josh.triplett@...el.com>,
Daniel Vetter <daniel.vetter@...el.com>,
intel-gfx@...ts.freedesktop.org
Cc: Ronald Minnich <rminnich@...gle.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Furquan Shaikh <furquan@...gle.com>, furquan.m.shaikh@...il.com
Subject: [PATCH 1/2] drm/i915: Fix bug while calculating the clock value using do_div in ironlake_crtc_clock_get
We need to round up the values since the comparison in drm_mode_equal might fail if division
results in fractional part
Signed-off-by: Furquan Shaikh <furquan@...gle.com>
---
drivers/gpu/drm/i915/intel_display.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0f40f8e..e0069f4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7190,7 +7190,11 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc,
return;
clock = ((u64)link_m * (u64)link_freq * (u64)repeat);
- do_div(clock, link_n);
+ /* This is required because the value comes out to be in fraction
+ (eg. 70699.54). Need to round it up since values are compared in
+ drm_mode_equal
+ */
+ clock = DIV_ROUND_UP_ULL(clock, link_n);
pipe_config->adjusted_mode.clock = clock;
}
--
1.8.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists