diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-06 17:29:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-06 17:29:16 -0400 |
commit | 6106611e15b036bccfb4cfc0ed8bf83aab3ee226 (patch) | |
tree | 84364e663af7f5fbc37a032c57491f06b1d85ae3 | |
parent | f1ea7254726d25a333056619ec6b1a8ee1b7358d (diff) | |
parent | d99e90164e6cf2eb85fa94d547d6336f8127a107 (diff) |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: gart iommu have direct mapping when agp is present too
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 49285f8fd4d5..be33a5442d82 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -626,7 +626,6 @@ static __init int init_k8_gatt(struct agp_kern_info *info) | |||
626 | struct pci_dev *dev; | 626 | struct pci_dev *dev; |
627 | void *gatt; | 627 | void *gatt; |
628 | int i, error; | 628 | int i, error; |
629 | unsigned long start_pfn, end_pfn; | ||
630 | 629 | ||
631 | printk(KERN_INFO "PCI-DMA: Disabling AGP.\n"); | 630 | printk(KERN_INFO "PCI-DMA: Disabling AGP.\n"); |
632 | aper_size = aper_base = info->aper_size = 0; | 631 | aper_size = aper_base = info->aper_size = 0; |
@@ -672,12 +671,6 @@ static __init int init_k8_gatt(struct agp_kern_info *info) | |||
672 | printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n", | 671 | printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n", |
673 | aper_base, aper_size>>10); | 672 | aper_base, aper_size>>10); |
674 | 673 | ||
675 | /* need to map that range */ | ||
676 | end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT); | ||
677 | if (end_pfn > max_low_pfn_mapped) { | ||
678 | start_pfn = (aper_base>>PAGE_SHIFT); | ||
679 | init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT); | ||
680 | } | ||
681 | return 0; | 674 | return 0; |
682 | 675 | ||
683 | nommu: | 676 | nommu: |
@@ -727,7 +720,8 @@ void __init gart_iommu_init(void) | |||
727 | { | 720 | { |
728 | struct agp_kern_info info; | 721 | struct agp_kern_info info; |
729 | unsigned long iommu_start; | 722 | unsigned long iommu_start; |
730 | unsigned long aper_size; | 723 | unsigned long aper_base, aper_size; |
724 | unsigned long start_pfn, end_pfn; | ||
731 | unsigned long scratch; | 725 | unsigned long scratch; |
732 | long i; | 726 | long i; |
733 | 727 | ||
@@ -765,8 +759,16 @@ void __init gart_iommu_init(void) | |||
765 | return; | 759 | return; |
766 | } | 760 | } |
767 | 761 | ||
762 | /* need to map that range */ | ||
763 | aper_size = info.aper_size << 20; | ||
764 | aper_base = info.aper_base; | ||
765 | end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT); | ||
766 | if (end_pfn > max_low_pfn_mapped) { | ||
767 | start_pfn = (aper_base>>PAGE_SHIFT); | ||
768 | init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT); | ||
769 | } | ||
770 | |||
768 | printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); | 771 | printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); |
769 | aper_size = info.aper_size * 1024 * 1024; | ||
770 | iommu_size = check_iommu_size(info.aper_base, aper_size); | 772 | iommu_size = check_iommu_size(info.aper_base, aper_size); |
771 | iommu_pages = iommu_size >> PAGE_SHIFT; | 773 | iommu_pages = iommu_size >> PAGE_SHIFT; |
772 | 774 | ||