提交 a85d4bcb 编写于 作者: B Ben Widawsky 提交者: Daniel Vetter

drm/i915: rc6 residency (fix the fix)

Chris' fix for my 32b breakage was incorrect. do_div returns a
remainder. Go back to a divide macro which is more 32b friendly.

Tested on x86-64.

This has only been compile tested on 32b systems.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48756
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Sincere-apologies: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NBen Widawsky <benjamin.widawsky@intel.com>
[danvet: fixup 32bit compile-fail.]
Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 3801a7fd
......@@ -39,8 +39,8 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)
if (!intel_enable_rc6(dev))
return 0;
raw_time = I915_READ(reg) * 128ULL + 500;
return do_div(raw_time, 100000);
raw_time = I915_READ(reg) * 128ULL;
return DIV_ROUND_UP_ULL(raw_time, 100000);
}
static ssize_t
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册