@@ -567,12 +567,10 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
567
567
[vmw_dma_map_bind ] = "Giving up DMA mappings early." };
568
568
const struct dma_map_ops * dma_ops = get_dma_ops (dev_priv -> dev -> dev );
569
569
570
- #ifdef CONFIG_INTEL_IOMMU
571
570
if (intel_iommu_enabled ) {
572
571
dev_priv -> map_mode = vmw_dma_map_populate ;
573
572
goto out_fixup ;
574
573
}
575
- #endif
576
574
577
575
if (!(vmw_force_iommu || vmw_force_coherent )) {
578
576
dev_priv -> map_mode = vmw_dma_phys ;
@@ -589,23 +587,19 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
589
587
dev_priv -> map_mode = vmw_dma_map_populate ;
590
588
#endif
591
589
592
- #ifdef CONFIG_INTEL_IOMMU
593
590
out_fixup :
594
- #endif
595
591
if (dev_priv -> map_mode == vmw_dma_map_populate &&
596
592
vmw_restrict_iommu )
597
593
dev_priv -> map_mode = vmw_dma_map_bind ;
598
594
599
595
if (vmw_force_coherent )
600
596
dev_priv -> map_mode = vmw_dma_alloc_coherent ;
601
597
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 ))
607
601
return - EINVAL ;
608
- #endif
602
+
609
603
DRM_INFO ("DMA map mode: %s\n" , names [dev_priv -> map_mode ]);
610
604
611
605
return 0 ;
@@ -619,7 +613,6 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
619
613
* With 32-bit we can only handle 32 bit PFNs. Optionally set that
620
614
* restriction also for 64-bit systems.
621
615
*/
622
- #ifdef CONFIG_INTEL_IOMMU
623
616
static int vmw_dma_masks (struct vmw_private * dev_priv )
624
617
{
625
618
struct drm_device * dev = dev_priv -> dev ;
@@ -631,12 +624,6 @@ static int vmw_dma_masks(struct vmw_private *dev_priv)
631
624
}
632
625
return 0 ;
633
626
}
634
- #else
635
- static int vmw_dma_masks (struct vmw_private * dev_priv )
636
- {
637
- return 0 ;
638
- }
639
- #endif
640
627
641
628
static int vmw_driver_load (struct drm_device * dev , unsigned long chipset )
642
629
{
0 commit comments