From patchwork Wed Aug 31 02:41:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 1114832 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7V3EtEm023965 for ; Wed, 31 Aug 2011 03:15:15 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21E2F9EBB9 for ; Tue, 30 Aug 2011 20:14:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 03:15:15 +0000 (UTC) X-Greylist: delayed 4009 seconds by postgrey-1.31 at gabe; Tue, 30 Aug 2011 20:14:44 PDT Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by gabe.freedesktop.org (Postfix) with ESMTP id 34C049E921 for ; Tue, 30 Aug 2011 20:14:44 -0700 (PDT) Received: from rtcsinet22.oracle.com (rtcsinet22.oracle.com [66.248.204.30]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p7V3EDHK001304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 31 Aug 2011 03:14:41 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p7V3AUwE025514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 31 Aug 2011 03:10:31 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p7V3APvr010266; Tue, 30 Aug 2011 22:10:25 -0500 Received: from phenom (/209.6.55.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 30 Aug 2011 20:10:24 -0700 Received: by phenom (Postfix, from userid 1000) id 1203856C2; Tue, 30 Aug 2011 23:09:42 -0400 (EDT) From: Konrad Rzeszutek Wilk To: thellstrom@vmware.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, bskeggs@redhat.com, j.glisse@redhat.com, thomas@shipmail.org, airlied@redhat.com, airlied@linux.ie, alexdeucher@gmail.com Subject: [PATCH 6/7] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime. Date: Tue, 30 Aug 2011 22:41:51 -0400 Message-Id: <1314758512-19285-7-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314758512-19285-1-git-send-email-konrad.wilk@oracle.com> References: <1314758512-19285-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090203.4E5DA721.00AA,ss=1,re=0.000,fgs=0 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 The TTM DMA only gets turned on when the SWIOTLB is enabled - but we might also want to turn it off when SWIOTLB is on to use the non-DMA TTM pool code. In the future this parameter can be removed. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 4 ++++ include/drm/ttm/ttm_page_alloc.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index c024c10..9940efd 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -51,6 +51,10 @@ #include #endif +int __read_mostly dma_ttm_disable; +MODULE_PARM_DESC(no_dma, "Disable TTM DMA pool"); +module_param_named(no_dma, dma_ttm_disable, bool, S_IRUGO); + #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(struct page *)) #define SMALL_ALLOCATION 16 #define FREE_ALL_PAGES (~0U) diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 192c5f8..e75af77 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h @@ -103,10 +103,10 @@ extern struct ttm_page_alloc_func ttm_page_alloc_default; #ifdef CONFIG_SWIOTLB /* Defined in ttm_page_alloc_dma.c */ extern struct ttm_page_alloc_func ttm_page_alloc_dma; - +extern int dma_ttm_disable; static inline bool ttm_page_alloc_need_dma(void) { - if (swiotlb_enabled()) { + if (!dma_ttm_disable && swiotlb_enabled()) { ttm_page_alloc = &ttm_page_alloc_dma; return true; }