diff options
Diffstat (limited to 'drivers/char/agp')
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 13 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 8 |
2 files changed, 14 insertions, 7 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 52f4361eb6e4..d765afda9c2a 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -271,15 +271,15 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, | |||
271 | nb_order = (nb_order >> 1) & 7; | 271 | nb_order = (nb_order >> 1) & 7; |
272 | pci_read_config_dword(nb, AMD64_GARTAPERTUREBASE, &nb_base); | 272 | pci_read_config_dword(nb, AMD64_GARTAPERTUREBASE, &nb_base); |
273 | nb_aper = nb_base << 25; | 273 | nb_aper = nb_base << 25; |
274 | if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) { | ||
275 | return 0; | ||
276 | } | ||
277 | 274 | ||
278 | /* Northbridge seems to contain crap. Try the AGP bridge. */ | 275 | /* Northbridge seems to contain crap. Try the AGP bridge. */ |
279 | 276 | ||
280 | pci_read_config_word(agp, cap+0x14, &apsize); | 277 | pci_read_config_word(agp, cap+0x14, &apsize); |
281 | if (apsize == 0xffff) | 278 | if (apsize == 0xffff) { |
279 | if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) | ||
280 | return 0; | ||
282 | return -1; | 281 | return -1; |
282 | } | ||
283 | 283 | ||
284 | apsize &= 0xfff; | 284 | apsize &= 0xfff; |
285 | /* Some BIOS use weird encodings not in the AGPv3 table. */ | 285 | /* Some BIOS use weird encodings not in the AGPv3 table. */ |
@@ -301,6 +301,11 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, | |||
301 | order = nb_order; | 301 | order = nb_order; |
302 | } | 302 | } |
303 | 303 | ||
304 | if (nb_order >= order) { | ||
305 | if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) | ||
306 | return 0; | ||
307 | } | ||
308 | |||
304 | dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n", | 309 | dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n", |
305 | aper, 32 << order); | 310 | aper, 32 << order); |
306 | if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order)) | 311 | if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order)) |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index c7714185f831..4373adb2119a 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -633,13 +633,15 @@ static void intel_i830_init_gtt_entries(void) | |||
633 | break; | 633 | break; |
634 | } | 634 | } |
635 | } | 635 | } |
636 | if (gtt_entries > 0) | 636 | if (gtt_entries > 0) { |
637 | dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", | 637 | dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", |
638 | gtt_entries / KB(1), local ? "local" : "stolen"); | 638 | gtt_entries / KB(1), local ? "local" : "stolen"); |
639 | else | 639 | gtt_entries /= KB(4); |
640 | } else { | ||
640 | dev_info(&agp_bridge->dev->dev, | 641 | dev_info(&agp_bridge->dev->dev, |
641 | "no pre-allocated video memory detected\n"); | 642 | "no pre-allocated video memory detected\n"); |
642 | gtt_entries /= KB(4); | 643 | gtt_entries = 0; |
644 | } | ||
643 | 645 | ||
644 | intel_private.gtt_entries = gtt_entries; | 646 | intel_private.gtt_entries = gtt_entries; |
645 | } | 647 | } |