Skip to content

Commit 17cc513

Browse files
committed
Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next
Two minor cleanups / fixes for -next. Signed-off-by: Dave Airlie <[email protected]> From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m=20=28VMware=29?= Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2d0720f + b401164 commit 17cc513

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ config DRM_TTM
179179
GPU memory types. Will be enabled automatically if a device driver
180180
uses it.
181181

182+
config DRM_TTM_DMA_PAGE_POOL
183+
bool
184+
depends on DRM_TTM && (SWIOTLB || INTEL_IOMMU)
185+
default y
186+
help
187+
Choose this if you need the TTM dma page pool
188+
182189
config DRM_VRAM_HELPER
183190
tristate
184191
depends on DRM

drivers/gpu/drm/ttm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
ttm-y := ttm_memory.o ttm_tt.o ttm_bo.o \
66
ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
7-
ttm_execbuf_util.o ttm_page_alloc.o ttm_bo_manager.o \
8-
ttm_page_alloc_dma.o
7+
ttm_execbuf_util.o ttm_page_alloc.o ttm_bo_manager.o
98
ttm-$(CONFIG_AGP) += ttm_agp_backend.o
9+
ttm-$(CONFIG_DRM_TTM_DMA_PAGE_POOL) += ttm_page_alloc_dma.o
1010

1111
obj-$(CONFIG_DRM_TTM) += ttm.o

drivers/gpu/drm/ttm/ttm_page_alloc_dma.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* when freed).
3434
*/
3535

36-
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
3736
#define pr_fmt(fmt) "[TTM] " fmt
3837

3938
#include <linux/dma-mapping.h>
@@ -1238,5 +1237,3 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
12381237
return 0;
12391238
}
12401239
EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs);
1241-
1242-
#endif

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,7 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
576576
else
577577
dev_priv->map_mode = vmw_dma_map_populate;
578578

579-
/* No TTM coherent page pool? FIXME: Ask TTM instead! */
580-
if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
579+
if (!IS_ENABLED(CONFIG_DRM_TTM_DMA_PAGE_POOL) &&
581580
(dev_priv->map_mode == vmw_dma_alloc_coherent))
582581
return -EINVAL;
583582

drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res)
336336
{
337337

338338
struct vmw_private *dev_priv = res->dev_priv;
339-
struct vmw_surface *srf;
340339
void *cmd;
341340

342341
if (res->func->destroy == vmw_gb_surface_destroy) {
@@ -360,7 +359,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res)
360359
*/
361360

362361
mutex_lock(&dev_priv->cmdbuf_mutex);
363-
srf = vmw_res_to_srf(res);
364362
dev_priv->used_memory_size -= res->backup_size;
365363
mutex_unlock(&dev_priv->cmdbuf_mutex);
366364
}

include/drm/ttm/ttm_page_alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt);
7474
*/
7575
int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
7676

77-
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
77+
#if defined(CONFIG_DRM_TTM_DMA_PAGE_POOL)
7878
/**
7979
* Initialize pool allocator.
8080
*/

0 commit comments

Comments
 (0)