x86: convert gart to use is_buffer_dma_capable helper function
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
636dc67cbf
commit
ac4ff656c0
@@ -214,24 +214,14 @@ static void iommu_full(struct device *dev, size_t size, int dir)
|
|||||||
static inline int
|
static inline int
|
||||||
need_iommu(struct device *dev, unsigned long addr, size_t size)
|
need_iommu(struct device *dev, unsigned long addr, size_t size)
|
||||||
{
|
{
|
||||||
u64 mask = *dev->dma_mask;
|
return force_iommu ||
|
||||||
int high = addr + size > mask;
|
!is_buffer_dma_capable(*dev->dma_mask, addr, size);
|
||||||
int mmu = high;
|
|
||||||
|
|
||||||
if (force_iommu)
|
|
||||||
mmu = 1;
|
|
||||||
|
|
||||||
return mmu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
nonforced_iommu(struct device *dev, unsigned long addr, size_t size)
|
nonforced_iommu(struct device *dev, unsigned long addr, size_t size)
|
||||||
{
|
{
|
||||||
u64 mask = *dev->dma_mask;
|
return !is_buffer_dma_capable(*dev->dma_mask, addr, size);
|
||||||
int high = addr + size > mask;
|
|
||||||
int mmu = high;
|
|
||||||
|
|
||||||
return mmu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Map a single continuous physical area into the IOMMU.
|
/* Map a single continuous physical area into the IOMMU.
|
||||||
|
Reference in New Issue
Block a user