From patchwork Mon Feb 21 04:42:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 576661 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1L4hCWL031760 for ; Mon, 21 Feb 2011 04:43:32 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0310B9EAF0 for ; Sun, 20 Feb 2011 20:43:12 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx4.gwdg.de (mx4.gwdg.de [134.76.10.17]) by gabe.freedesktop.org (Postfix) with ESMTP id 249419E824 for ; Sun, 20 Feb 2011 20:43:02 -0800 (PST) X-IronPort-Reputation-Score: None X-IronPort-AV: E=McAfee;i="5400,1158,6263"; a="21073131" X-IronPort-AV: E=Sophos;i="4.62,198,1297033200"; d="scan'208";a="21073131" Received: from smtp-out.tuebingen.mpg.de (HELO tuebingen.mpg.de) ([192.124.26.249]) by mailer2.mpg.de with ESMTP; 21 Feb 2011 05:43:01 +0100 Received: from [10.38.138.43] (account mario.kleiner@tuebingen.mpg.de HELO funky.kyb.local) by tuebingen.mpg.de (CommuniGate Pro SMTP 5.3.10) with ESMTPA id 14367918; Mon, 21 Feb 2011 05:43:01 +0100 From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/vblank: Use abs64(diff_ns) for s64 diff_ns instead of abs(diff_ns) Date: Mon, 21 Feb 2011 05:42:00 +0100 Message-Id: <1298263322-28605-2-git-send-email-mario.kleiner@tuebingen.mpg.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1298263322-28605-1-git-send-email-mario.kleiner@tuebingen.mpg.de> References: <1298263322-28605-1-git-send-email-mario.kleiner@tuebingen.mpg.de> Cc: airlied@redhat.com, Mario Kleiner X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Feb 2011 04:43:32 +0000 (UTC) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 0054e95..149805a 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -164,7 +164,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) * available. In that case we can't account for this and just * hope for the best. */ - if ((vblrc > 0) && (abs(diff_ns) > 1000000)) + if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) atomic_inc(&dev->_vblank_count[crtc]); /* Invalidate all timestamps while vblank irq's are off. */ @@ -1293,7 +1293,7 @@ void drm_handle_vblank(struct drm_device *dev, int crtc) * e.g., due to spurious vblank interrupts. We need to * ignore those for accounting. */ - if (abs(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { + if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { /* Store new timestamp in ringbuffer. */ vblanktimestamp(dev, crtc, vblcount + 1) = tvblank; smp_wmb();