]> Pileus Git - ~andy/linux/commitdiff
drm/ttm: Enable the dma page pool also for intel IOMMUs
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 24 Oct 2013 08:24:54 +0000 (01:24 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 6 Nov 2013 11:55:52 +0000 (03:55 -0800)
Used by the vmwgfx driver

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/gpu/drm/ttm/Makefile
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
include/drm/ttm/ttm_page_alloc.h

index b2b33dde2afb06a1c78ffcbeb2e826a28ec0bb58..b433b9f040c984ff6e6703f33fa45601d8fac81d 100644 (file)
@@ -5,10 +5,6 @@ ccflags-y := -Iinclude/drm
 ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \
        ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
        ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \
-       ttm_bo_manager.o
-
-ifeq ($(CONFIG_SWIOTLB),y)
-ttm-y += ttm_page_alloc_dma.o
-endif
+       ttm_bo_manager.o ttm_page_alloc_dma.o
 
 obj-$(CONFIG_DRM_TTM) += ttm.o
index 7957beeeaf733752e58c6b57f5d5a5a531113a09..fb8259f698395a286e28fbe1053bc70e04821694 100644 (file)
@@ -33,6 +33,7 @@
  *   when freed).
  */
 
+#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
 #define pr_fmt(fmt) "[TTM] " fmt
 
 #include <linux/dma-mapping.h>
@@ -1142,3 +1143,5 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
        return 0;
 }
 EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs);
+
+#endif
index 706b962c6467e7145f6b1a1c42700b406bfb203c..d1f61bfe0ebe49841cc5f249c8307b75973b98a7 100644 (file)
@@ -62,7 +62,7 @@ extern void ttm_pool_unpopulate(struct ttm_tt *ttm);
 extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
 
 
-#ifdef CONFIG_SWIOTLB
+#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
 /**
  * Initialize pool allocator.
  */
@@ -94,6 +94,15 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
 {
        return 0;
 }
+static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma,
+                                  struct device *dev)
+{
+       return -ENOMEM;
+}
+static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
+                                     struct device *dev)
+{
+}
 #endif
 
 #endif