Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/agp: tighten check to update amd nb aperture

Impact: fix bug to make agp work with dri

Jeffrey reported that dri does work with 64bit, but doesn't work with
32bit it turns out NB aperture is 32M, aperture on agp is 128M

64bit is using 64M for vaidation for 64 iommu/gart 32bit is only using
32M..., and will not update the nb aperture.

So try to compare nb apterture and agp apterture before leaving not
touch nb aperture.

Reported-by: Jeffrey Trull <jetrull@sbcglobal.net>
Tested-by: Jeffrey Trull <jetrull@sbcglobal.net>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Dave Airlie <airlied@linux.ie>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Yinghai Lu and committed by
Linus Torvalds
2f688913 5a891ed5

+9 -4
+9 -4
drivers/char/agp/amd64-agp.c
··· 271 271 nb_order = (nb_order >> 1) & 7; 272 272 pci_read_config_dword(nb, AMD64_GARTAPERTUREBASE, &nb_base); 273 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 275 /* Northbridge seems to contain crap. Try the AGP bridge. */ 279 276 280 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 281 return -1; 282 + } 283 283 284 284 apsize &= 0xfff; 285 285 /* Some BIOS use weird encodings not in the AGPv3 table. */ ··· 299 299 dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n", 300 300 32 << order); 301 301 order = nb_order; 302 + } 303 + 304 + if (nb_order >= order) { 305 + if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) 306 + return 0; 302 307 } 303 308 304 309 dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n",