|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 6/7] ttm: Add 'no_dma' parameter to turn the TTM DMA
To: |
thellstrom@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, thomas@xxxxxxxxxxxx |
Subject: |
[Xen-devel] [PATCH 6/7] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime. |
From: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Date: |
Tue, 13 Sep 2011 10:12:49 -0400 |
Cc: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, airlied@xxxxxxxx, Pekka Paalanen <pq@xxxxxx>, bskeggs@xxxxxxxxxx, alexdeucher@xxxxxxxxx, airlied@xxxxxxxxxx, j.glisse@xxxxxxxxxx |
Delivery-date: |
Tue, 13 Sep 2011 07:17:32 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1315923170-25568-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<1315923170-25568-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
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 <konrad.wilk@xxxxxxxxxx>
---
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 <asm/agp.h>
#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;
}
--
1.7.4.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|