Commit 17cc5139 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next

Two minor cleanups / fixes for -next.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m=20=28VMware=29?=
Link: https://patchwork.freedesktop.org/patch/msgid/20191114131703.8607-1-thomas_os@shipmail.org
parents 2d0720f5 b4011644
...@@ -179,6 +179,13 @@ config DRM_TTM ...@@ -179,6 +179,13 @@ config DRM_TTM
GPU memory types. Will be enabled automatically if a device driver GPU memory types. Will be enabled automatically if a device driver
uses it. uses it.
config DRM_TTM_DMA_PAGE_POOL
bool
depends on DRM_TTM && (SWIOTLB || INTEL_IOMMU)
default y
help
Choose this if you need the TTM dma page pool
config DRM_VRAM_HELPER config DRM_VRAM_HELPER
tristate tristate
depends on DRM depends on DRM
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
ttm-y := ttm_memory.o ttm_tt.o ttm_bo.o \ ttm-y := ttm_memory.o ttm_tt.o ttm_bo.o \
ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
ttm_execbuf_util.o ttm_page_alloc.o ttm_bo_manager.o \ ttm_execbuf_util.o ttm_page_alloc.o ttm_bo_manager.o
ttm_page_alloc_dma.o
ttm-$(CONFIG_AGP) += ttm_agp_backend.o ttm-$(CONFIG_AGP) += ttm_agp_backend.o
ttm-$(CONFIG_DRM_TTM_DMA_PAGE_POOL) += ttm_page_alloc_dma.o
obj-$(CONFIG_DRM_TTM) += ttm.o obj-$(CONFIG_DRM_TTM) += ttm.o
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* when freed). * when freed).
*/ */
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
#define pr_fmt(fmt) "[TTM] " fmt #define pr_fmt(fmt) "[TTM] " fmt
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
...@@ -1238,5 +1237,3 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data) ...@@ -1238,5 +1237,3 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs); EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs);
#endif
...@@ -576,8 +576,7 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv) ...@@ -576,8 +576,7 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
else else
dev_priv->map_mode = vmw_dma_map_populate; dev_priv->map_mode = vmw_dma_map_populate;
/* No TTM coherent page pool? FIXME: Ask TTM instead! */ if (!IS_ENABLED(CONFIG_DRM_TTM_DMA_PAGE_POOL) &&
if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
(dev_priv->map_mode == vmw_dma_alloc_coherent)) (dev_priv->map_mode == vmw_dma_alloc_coherent))
return -EINVAL; return -EINVAL;
......
...@@ -336,7 +336,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) ...@@ -336,7 +336,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res)
{ {
struct vmw_private *dev_priv = res->dev_priv; struct vmw_private *dev_priv = res->dev_priv;
struct vmw_surface *srf;
void *cmd; void *cmd;
if (res->func->destroy == vmw_gb_surface_destroy) { if (res->func->destroy == vmw_gb_surface_destroy) {
...@@ -360,7 +359,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) ...@@ -360,7 +359,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res)
*/ */
mutex_lock(&dev_priv->cmdbuf_mutex); mutex_lock(&dev_priv->cmdbuf_mutex);
srf = vmw_res_to_srf(res);
dev_priv->used_memory_size -= res->backup_size; dev_priv->used_memory_size -= res->backup_size;
mutex_unlock(&dev_priv->cmdbuf_mutex); mutex_unlock(&dev_priv->cmdbuf_mutex);
} }
......
...@@ -74,7 +74,7 @@ void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt); ...@@ -74,7 +74,7 @@ void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt);
*/ */
int ttm_page_alloc_debugfs(struct seq_file *m, void *data); int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU) #if defined(CONFIG_DRM_TTM_DMA_PAGE_POOL)
/** /**
* Initialize pool allocator. * Initialize pool allocator.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment