Skip to content

Commit

Permalink
x86: convert gart to use is_buffer_dma_capable helper function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Sep 10, 2008
1 parent 636dc67 commit ac4ff65
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions arch/x86/kernel/pci-gart_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,14 @@ static void iommu_full(struct device *dev, size_t size, int dir)
static inline int
need_iommu(struct device *dev, unsigned long addr, size_t size)
{
u64 mask = *dev->dma_mask;
int high = addr + size > mask;
int mmu = high;

if (force_iommu)
mmu = 1;

return mmu;
return force_iommu ||
!is_buffer_dma_capable(*dev->dma_mask, addr, size);
}

static inline int
nonforced_iommu(struct device *dev, unsigned long addr, size_t size)
{
u64 mask = *dev->dma_mask;
int high = addr + size > mask;
int mmu = high;

return mmu;
return !is_buffer_dma_capable(*dev->dma_mask, addr, size);
}

/* Map a single continuous physical area into the IOMMU.
Expand Down

0 comments on commit ac4ff65

Please sign in to comment.