Skip to content

Commit

Permalink
drm/radeon: simplify and cleanup setting the dma mask
Browse files Browse the repository at this point in the history
Use dma_set_mask_and_coherent to set both masks in one go, and remove
the no longer required fallback, as the kernel now always accepts
larger than required DMA masks.  Fail the driver probe if we can't
set the DMA mask, as that means the system can only support a larger
mask.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christoph Hellwig authored and Alex Deucher committed Aug 15, 2019
1 parent 90489ce commit 03127c5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/gpu/drm/radeon/radeon_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,15 +1382,10 @@ int radeon_device_init(struct radeon_device *rdev,
dma_bits = 32;
#endif

r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
r = dma_set_mask_and_coherent(&rdev->pdev->dev, DMA_BIT_MASK(dma_bits));
if (r) {
dma_bits = 32;
pr_warn("radeon: No suitable DMA available\n");
}
r = pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
if (r) {
pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(32));
pr_warn("radeon: No coherent DMA available\n");
return r;
}
rdev->need_swiotlb = drm_need_swiotlb(dma_bits);

Expand Down

0 comments on commit 03127c5

Please sign in to comment.