From patchwork Mon Nov 12 17:32:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1729511 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5E0E03FCDE for ; Mon, 12 Nov 2012 17:48:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BD219F36E for ; Mon, 12 Nov 2012 09:48:54 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 32BC39F301 for ; Mon, 12 Nov 2012 09:34:02 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 12 Nov 2012 09:34:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="245675799" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by fmsmga001.fm.intel.com with SMTP; 12 Nov 2012 09:33:59 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Nov 2012 19:33:59 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 18/22] drm/i915: Unpin old fbs only when appropriate Date: Mon, 12 Nov 2012 19:32:56 +0200 Message-Id: <1352741580-12141-19-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> References: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 From: Ville Syrjälä Don't unpin the old fb after flips, unless a new fb was pinned, or we're disabling the plane/crtc. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index a119896..b795cb2 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -2133,8 +2133,10 @@ static void atomic_pipe_commit(struct drm_device *dev, intel_flip->old_cursor_bo = st->old.cursor_bo; } - if (st->old.fb) { + if (st->old.fb) intel_flip->old_fb_id = st->old.fb->base.id; + + if (st->fb_dirty && st->old.fb) { intel_flip->old_bo = to_intel_framebuffer(st->old.fb)->obj; mutex_lock(&dev->struct_mutex); @@ -2177,8 +2179,10 @@ static void atomic_pipe_commit(struct drm_device *dev, intel_plane->calc(plane, plane->fb, &st->coords); - if (st->old.fb) { + if (st->old.fb) intel_flip->old_fb_id = st->old.fb->base.id; + + if (st->dirty && st->old.fb) { intel_flip->old_bo = to_intel_framebuffer(st->old.fb)->obj; mutex_lock(&dev->struct_mutex);