diff mbox

[4/6] drm/vmwgfx: Use swiotlb_in_use() to know if swiotlb is enabled.

Message ID 1440615127-25834-5-git-send-email-jglisse@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jerome Glisse Aug. 26, 2015, 6:52 p.m. UTC
From: Jérôme Glisse <jglisse@redhat.com>

We can not rely on swiotlb_nr_tbl() to know if swiotlb is in use or
not for our device. Use the new helper to determine that.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: lkml@vger.kernel.org
Cc: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 620bb5c..a2b0ec0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -517,10 +517,8 @@  static int vmw_dma_select_mode(struct vmw_private *dev_priv)
 
 	if (dma_ops->sync_single_for_cpu)
 		dev_priv->map_mode = vmw_dma_alloc_coherent;
-#ifdef CONFIG_SWIOTLB
-	if (swiotlb_nr_tbl() == 0)
+	if (!swiotlb_in_use(dev_priv->dev->dev))
 		dev_priv->map_mode = vmw_dma_map_populate;
-#endif
 
 #ifdef CONFIG_INTEL_IOMMU
 out_fixup: