From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: rc6 residency (fix the fix) Date: Sun, 22 Apr 2012 19:11:16 +0100 Message-ID: <1335118302_21631@CP5-2952> References: <1334947801-17280-1-git-send-email-ben@bwidawsk.net> <1335109823_20954@CP5-2952> <20120422103529.54504e03@bwidawsk.net> <1335116390_21488@CP5-2952> <20120422110232.4d52a440@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 390159E8CE for ; Sun, 22 Apr 2012 11:11:53 -0700 (PDT) In-Reply-To: <20120422110232.4d52a440@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org, Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org On Sun, 22 Apr 2012 11:02:32 -0700, Ben Widawsky wrote: > Does div_round64 work for you? I think that is the best solution. Only exists in drivers/cpuidle/governors/menu.c, and still would need a do_div to avoid the subsequent 64-bit division. The choice appears to be either perform the divide by 1000 using do_div, or note that a u32 * 128 / 1000 is also a u32 and so cast the result of DIV_ROUND_UP_ULL back to u32. -Chris -- Chris Wilson, Intel Open Source Technology Centre