From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757745Ab1I2Uel (ORCPT ); Thu, 29 Sep 2011 16:34:41 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:44948 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757598Ab1I2UeO (ORCPT ); Thu, 29 Sep 2011 16:34:14 -0400 From: Konrad Rzeszutek Wilk To: linux-kernel@vger.kernel.org, thellstrom@vmware.com, dri-devel@lists.freedesktop.org, bskeggs@redhat.com, j.glisse@redhat.com, thomas@shipmail.org, airlied@redhat.com, airlied@linux.ie, alexdeucher@gmail.com Cc: xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk Subject: [PATCH 6/9] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime. Date: Thu, 29 Sep 2011 16:33:49 -0400 Message-Id: <1317328432-25620-7-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1317328432-25620-1-git-send-email-konrad.wilk@oracle.com> References: <1317328432-25620-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090206.4E84D63F.007B,ss=1,re=0.000,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 5a5739c..5909d28 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 a58331d..1dde3bd 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_nr_tbl()) { + if (!dma_ttm_disable && swiotlb_nr_tbl()) { ttm_page_alloc = &ttm_page_alloc_dma; return true; } -- 1.7.4.1