Skip to content

Commit 9b5bf24

Browse files
Christoph Hellwigthomashvmw
authored andcommitted
drm/vmwgfx: remove CONFIG_INTEL_IOMMU ifdefs v2
intel_iommu_enabled is defined as always false for !CONFIG_INTEL_IOMMU, so remove the ifdefs around it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
1 parent 3f47d00 commit 9b5bf24

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,10 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
567567
[vmw_dma_map_bind] = "Giving up DMA mappings early."};
568568
const struct dma_map_ops *dma_ops = get_dma_ops(dev_priv->dev->dev);
569569

570-
#ifdef CONFIG_INTEL_IOMMU
571570
if (intel_iommu_enabled) {
572571
dev_priv->map_mode = vmw_dma_map_populate;
573572
goto out_fixup;
574573
}
575-
#endif
576574

577575
if (!(vmw_force_iommu || vmw_force_coherent)) {
578576
dev_priv->map_mode = vmw_dma_phys;
@@ -589,23 +587,19 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
589587
dev_priv->map_mode = vmw_dma_map_populate;
590588
#endif
591589

592-
#ifdef CONFIG_INTEL_IOMMU
593590
out_fixup:
594-
#endif
595591
if (dev_priv->map_mode == vmw_dma_map_populate &&
596592
vmw_restrict_iommu)
597593
dev_priv->map_mode = vmw_dma_map_bind;
598594

599595
if (vmw_force_coherent)
600596
dev_priv->map_mode = vmw_dma_alloc_coherent;
601597

602-
#if !defined(CONFIG_SWIOTLB) && !defined(CONFIG_INTEL_IOMMU)
603-
/*
604-
* No coherent page pool
605-
*/
606-
if (dev_priv->map_mode == vmw_dma_alloc_coherent)
598+
/* No TTM coherent page pool? FIXME: Ask TTM instead! */
599+
if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
600+
(dev_priv->map_mode == vmw_dma_alloc_coherent))
607601
return -EINVAL;
608-
#endif
602+
609603
DRM_INFO("DMA map mode: %s\n", names[dev_priv->map_mode]);
610604

611605
return 0;
@@ -619,7 +613,6 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
619613
* With 32-bit we can only handle 32 bit PFNs. Optionally set that
620614
* restriction also for 64-bit systems.
621615
*/
622-
#ifdef CONFIG_INTEL_IOMMU
623616
static int vmw_dma_masks(struct vmw_private *dev_priv)
624617
{
625618
struct drm_device *dev = dev_priv->dev;
@@ -631,12 +624,6 @@ static int vmw_dma_masks(struct vmw_private *dev_priv)
631624
}
632625
return 0;
633626
}
634-
#else
635-
static int vmw_dma_masks(struct vmw_private *dev_priv)
636-
{
637-
return 0;
638-
}
639-
#endif
640627

641628
static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
642629
{

0 commit comments

Comments
 (0)