From patchwork Wed Apr 27 06:10:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher James Halse Rogers X-Patchwork-Id: 735351 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 p3R6CoX7000798 for ; Wed, 27 Apr 2011 06:13:10 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 826E79EF85 for ; Tue, 26 Apr 2011 23:12:50 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by gabe.freedesktop.org (Postfix) with ESMTP id 62CB29E91D for ; Tue, 26 Apr 2011 23:11:46 -0700 (PDT) Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QExyT-0001Zu-KH; Wed, 27 Apr 2011 06:11:45 +0000 Received: from ppp105-211.static.internode.on.net ([150.101.105.211] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QExyS-0001jk-Qy; Wed, 27 Apr 2011 06:11:45 +0000 From: christopher.halse.rogers@canonical.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm: Warn if vblank state has become inconsistent. Date: Wed, 27 Apr 2011 16:10:58 +1000 Message-Id: <1303884659-739-2-git-send-email-christopher.halse.rogers@canonical.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303884659-739-1-git-send-email-christopher.halse.rogers@canonical.com> References: <1303884659-739-1-git-send-email-christopher.halse.rogers@canonical.com> 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]); Wed, 27 Apr 2011 06:13:10 +0000 (UTC) From: Christopher James Halse Rogers After emitting all the waiting vblank events no-one should hold a vblank reference. Emit a warning if this is not the case. Signed-off-by: Christopher James Halse Rogers Reviewed-by: Michel Dänzer --- drivers/gpu/drm/drm_irq.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index a1f12cb..72407fa 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc) e->event.sequence); } + WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0); spin_unlock_irqrestore(&dev->vbl_lock, irqflags); } EXPORT_SYMBOL(drm_vblank_off);