From patchwork Wed Aug 26 18:52:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 7079541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 541FFBF036 for ; Wed, 26 Aug 2015 18:52:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 790F720967 for ; Wed, 26 Aug 2015 18:52:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 819B22095F for ; Wed, 26 Aug 2015 18:52:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 458CF6ECA3; Wed, 26 Aug 2015 11:52:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id B577A6EC9D for ; Wed, 26 Aug 2015 11:52:13 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 537738E3DC; Wed, 26 Aug 2015 18:52:13 +0000 (UTC) Received: from localhost.localdomain.com (vpn-56-15.rdu2.redhat.com [10.10.56.15]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7QIq9ub004771; Wed, 26 Aug 2015 14:52:12 -0400 From: jglisse@redhat.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] drm/nouveau: Use swiotlb_in_use() to know if swiotlb is enabled or not. Date: Wed, 26 Aug 2015 14:52:04 -0400 Message-Id: <1440615127-25834-4-git-send-email-jglisse@redhat.com> In-Reply-To: <1440615127-25834-1-git-send-email-jglisse@redhat.com> References: <1440615127-25834-1-git-send-email-jglisse@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: lkml@vger.kernel.org, Konrad Rzeszutek Wilk , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Ben Skeggs , Daniel Vetter , Alex Deucher , Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 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: Jérôme Glisse We can not rely on swiotlb_nr_tbl() to know if swiotlb is in use or not for our device. Use the new helper to determine that. Signed-off-by: Jérôme Glisse Cc: Konrad Rzeszutek Wilk Cc: Alex Deucher Cc: Ben Skeggs Cc: Dave Airlie Cc: lkml@vger.kernel.org Cc: Daniel Vetter --- drivers/gpu/drm/nouveau/nouveau_bo.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 6edcce1..f601049 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -28,7 +28,6 @@ */ #include -#include #include "nouveau_drm.h" #include "nouveau_dma.h" @@ -1504,11 +1503,9 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) } #endif -#ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { + if (swiotlb_in_use(pdev)) { return ttm_dma_populate((void *)ttm, dev->dev); } -#endif r = ttm_pool_populate(ttm); if (r) { @@ -1572,12 +1569,10 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) } #endif -#ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { + if (swiotlb_in_use(pdev)) { ttm_dma_unpopulate((void *)ttm, dev->dev); return; } -#endif for (i = 0; i < ttm->num_pages; i++) { if (ttm_dma->dma_address[i]) {