Skip to content

Commit 4cbfa1e

Browse files
committed
drm/vmwgfx: Fix setting of dma masks
Previously we set only the dma mask and not the coherent mask. Fix that. Also, for clarity, make sure both are initially set to 64 bits. Cc: <stable@vger.kernel.org> Fixes: 0d00c48: ("drm/vmwgfx: Fix the driver for large dma addresses") Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
1 parent 479d590 commit 4cbfa1e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,16 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
600600
static int vmw_dma_masks(struct vmw_private *dev_priv)
601601
{
602602
struct drm_device *dev = dev_priv->dev;
603+
int ret = 0;
603604

604-
if (intel_iommu_enabled &&
605+
ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
606+
if (dev_priv->map_mode != vmw_dma_phys &&
605607
(sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
606608
DRM_INFO("Restricting DMA addresses to 44 bits.\n");
607-
return dma_set_mask(dev->dev, DMA_BIT_MASK(44));
609+
return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
608610
}
609-
return 0;
611+
612+
return ret;
610613
}
611614

612615
static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)

0 commit comments

Comments
 (0)