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

jglisse at redhat.com jglisse at redhat.com
Wed Aug 26 11:52:05 PDT 2015


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

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:
-- 
2.1.0



More information about the dri-devel mailing list