From patchwork Thu Oct 21 09:32:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 270441 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 o9LA2ikL013826 for ; Thu, 21 Oct 2010 10:03:06 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 316179F75B for ; Thu, 21 Oct 2010 03:02:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Oct 2010 10:03:06 +0000 (UTC) X-Greylist: delayed 1793 seconds by postgrey-1.31 at gabe; Thu, 21 Oct 2010 03:02:26 PDT Received: from smtps.ntu.edu.tw (smtps.ntu.edu.tw [140.112.2.142]) by gabe.freedesktop.org (Postfix) with ESMTP id 099E39E730 for ; Thu, 21 Oct 2010 03:02:26 -0700 (PDT) Received: from localhost.localdomain (122-116-175-74.HINET-IP.hinet.net [122.116.175.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtps.ntu.edu.tw (Postfix) with ESMTP id 3AA2810731F for ; Thu, 21 Oct 2010 17:32:32 +0800 (CST) From: Chia-I Wu To: intel-gfx@lists.freedesktop.org Date: Thu, 21 Oct 2010 17:32:30 +0800 Message-Id: <1287653550-3026-1-git-send-email-olvaffe@gmail.com> X-Mailer: git-send-email 1.7.1 Subject: [Intel-gfx] [PATCH] drm/i915: fix current fb blocking for flipping. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5e21b31..2e8cf7d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4664,7 +4664,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev, spin_unlock_irqrestore(&dev->event_lock, flags); - obj_priv = to_intel_bo(work->pending_flip_obj); + obj_priv = to_intel_bo(work->old_fb_obj); /* Initial scanout buffer will have a 0 pending flip count */ if ((atomic_read(&obj_priv->pending_flip) == 0) || @@ -4729,6 +4729,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, work->dev = crtc->dev; intel_fb = to_intel_framebuffer(crtc->fb); work->old_fb_obj = intel_fb->obj; + obj_priv = to_intel_bo(intel_fb->obj); + atomic_inc(&obj_priv->pending_flip); INIT_WORK(&work->work, intel_unpin_work_fn); /* We borrow the event spin lock for protecting unpin_work */ @@ -4770,7 +4772,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, i915_gem_object_flush_write_domain(obj); drm_vblank_get(dev, intel_crtc->pipe); obj_priv = to_intel_bo(obj); - atomic_inc(&obj_priv->pending_flip); work->pending_flip_obj = obj; if (intel_crtc->plane)