diff options
-rw-r--r-- | drivers/gpu/drm/ttm/Makefile | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 3 | ||||
-rw-r--r-- | include/drm/ttm/ttm_page_alloc.h | 11 |
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/Makefile b/drivers/gpu/drm/ttm/Makefile index b2b33dde2afb..b433b9f040c9 100644 --- a/drivers/gpu/drm/ttm/Makefile +++ b/drivers/gpu/drm/ttm/Makefile | |||
@@ -5,10 +5,6 @@ ccflags-y := -Iinclude/drm | |||
5 | ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \ | 5 | ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \ |
6 | ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ | 6 | ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ |
7 | ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \ | 7 | ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \ |
8 | ttm_bo_manager.o | 8 | ttm_bo_manager.o ttm_page_alloc_dma.o |
9 | |||
10 | ifeq ($(CONFIG_SWIOTLB),y) | ||
11 | ttm-y += ttm_page_alloc_dma.o | ||
12 | endif | ||
13 | 9 | ||
14 | obj-$(CONFIG_DRM_TTM) += ttm.o | 10 | obj-$(CONFIG_DRM_TTM) += ttm.o |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 7957beeeaf73..fb8259f69839 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | |||
@@ -33,6 +33,7 @@ | |||
33 | * when freed). | 33 | * when freed). |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU) | ||
36 | #define pr_fmt(fmt) "[TTM] " fmt | 37 | #define pr_fmt(fmt) "[TTM] " fmt |
37 | 38 | ||
38 | #include <linux/dma-mapping.h> | 39 | #include <linux/dma-mapping.h> |
@@ -1142,3 +1143,5 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data) | |||
1142 | return 0; | 1143 | return 0; |
1143 | } | 1144 | } |
1144 | EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs); | 1145 | EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs); |
1146 | |||
1147 | #endif | ||
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 706b962c6467..d1f61bfe0ebe 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h | |||
@@ -62,7 +62,7 @@ extern void ttm_pool_unpopulate(struct ttm_tt *ttm); | |||
62 | extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data); | 62 | extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data); |
63 | 63 | ||
64 | 64 | ||
65 | #ifdef CONFIG_SWIOTLB | 65 | #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU) |
66 | /** | 66 | /** |
67 | * Initialize pool allocator. | 67 | * Initialize pool allocator. |
68 | */ | 68 | */ |
@@ -94,6 +94,15 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data) | |||
94 | { | 94 | { |
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, | ||
98 | struct device *dev) | ||
99 | { | ||
100 | return -ENOMEM; | ||
101 | } | ||
102 | static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, | ||
103 | struct device *dev) | ||
104 | { | ||
105 | } | ||
97 | #endif | 106 | #endif |
98 | 107 | ||
99 | #endif | 108 | #endif |