From patchwork Mon Mar 24 08:13:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Murthy, Arun R" X-Patchwork-Id: 3881621 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 443BC9F2B6 for ; Mon, 24 Mar 2014 08:14:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 527E12022F for ; Mon, 24 Mar 2014 08:14:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E04F72020E for ; Mon, 24 Mar 2014 08:14:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EEE589CDF; Mon, 24 Mar 2014 01:14:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C54989CDF for ; Mon, 24 Mar 2014 01:14:21 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 24 Mar 2014 01:09:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,719,1389772800"; d="scan'208";a="506183949" Received: from armurthy-desktop.iind.intel.com ([10.223.25.113]) by orsmga002.jf.intel.com with ESMTP; 24 Mar 2014 01:13:50 -0700 From: Arun R Murthy To: daniel.vetter@ffwll.ch, jani.nikula@linux.intel.com, intel-gfx@lists.freedesktop.org, airlied@linux.ie Date: Mon, 24 Mar 2014 13:43:38 +0530 Message-Id: <1395648818-14310-1-git-send-email-arun.r.murthy@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: Arun R Murthy Subject: [Intel-gfx] [PATCH] drm/i915: use hrtimer in wait for vblank X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In wait for vblank use usleep_range, which will use hrtimers instead of msleep. Using msleep(1~20) there are more chances of sleeping for 20ms. Using usleep_range uses hrtimers and hence are precise, worst case will trigger an interrupt at the higher/max timeout. Signed-off-by: Arun R Murthy --- drivers/gpu/drm/i915/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 44067bc..079280a 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -52,7 +52,7 @@ break; \ } \ if (W && drm_can_sleep()) { \ - msleep(W); \ + usleep_range(W * 1000, W * 2 * 1000); \ } else { \ cpu_relax(); \ } \