From patchwork Fri Jul 11 17:20:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Reese, Armin C" X-Patchwork-Id: 4536501 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 4D2B19F1C4 for ; Fri, 11 Jul 2014 17:20:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89C0E20160 for ; Fri, 11 Jul 2014 17:20:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C607420254 for ; Fri, 11 Jul 2014 17:20:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2813F6E865; Fri, 11 Jul 2014 10:20:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id F2E746E865 for ; Fri, 11 Jul 2014 10:20:51 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 11 Jul 2014 10:20:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,644,1400050800"; d="scan'208";a="568586902" Received: from acreese-hsw.fm.intel.com ([10.19.123.158]) by fmsmga002.fm.intel.com with ESMTP; 11 Jul 2014 10:20:51 -0700 From: armin.c.reese@intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 11 Jul 2014 10:20:08 -0700 Message-Id: <1405099208-4085-2-git-send-email-armin.c.reese@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405099208-4085-1-git-send-email-armin.c.reese@intel.com> References: <1405099208-4085-1-git-send-email-armin.c.reese@intel.com> Subject: [Intel-gfx] [PATCH] drm/i915: Optimize the i915_gem_gtt_finish_object function 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.8 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 From: Armin Reese Signed-off-by: Armin Reese --- drivers/gpu/drm/i915/i915_gem_gtt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index afd4eef..7e2190e 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -1624,18 +1624,17 @@ static void ggtt_unbind_vma(struct i915_vma *vma) void i915_gem_gtt_finish_object(struct drm_i915_gem_object *obj) { - struct drm_device *dev = obj->base.dev; - struct drm_i915_private *dev_priv = dev->dev_private; - bool interruptible; - - interruptible = do_idling(dev_priv); + if (!obj->has_dma_mapping) { + struct drm_device *dev = obj->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + bool interruptible = do_idling(dev_priv); - if (!obj->has_dma_mapping) dma_unmap_sg(&dev->pdev->dev, obj->pages->sgl, obj->pages->nents, PCI_DMA_BIDIRECTIONAL); - undo_idling(dev_priv, interruptible); + undo_idling(dev_priv, interruptible); + } } static void i915_gtt_color_adjust(struct drm_mm_node *node,