Skip to content

Commit

Permalink
[AGP] Allocate AGP pages with GFP_DMA32 by default
Browse files Browse the repository at this point in the history
Not all graphic page remappers support physical addresses over the 4GB
mark for remapping, so while some do (the AMD64 GART always did, and I
just fixed the i965 to do so properly), we're safest off just forcing
GFP_DMA32 allocations to make sure graphics pages get allocated in the
low 32-bit address space by default.

AGP sub-drivers that really care, and can do better, could just choose
to implement their own allocator (or we could add another "64-bit safe"
default allocator for their use), but quite frankly, you're not likely
to care in practice.

So for now, this trivial change means that we won't be allocating pages
that we can't map correctly by mistake on x86-64.

[ On traditional 32-bit x86, this could never happen, because GFP_KERNEL
  would never allocate any highmem memory anyway ]

Acked-by: Andi Kleen <ak@suse.de>
Acked-by: Dave Jones <davej@redhat.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linus Torvalds committed Nov 22, 2006
1 parent 7d915a3 commit 66c669b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge)
{
struct page * page;

page = alloc_page(GFP_KERNEL);
page = alloc_page(GFP_KERNEL | GFP_DMA32);
if (page == NULL)
return NULL;

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void *i8xx_alloc_pages(void)
{
struct page * page;

page = alloc_pages(GFP_KERNEL, 2);
page = alloc_pages(GFP_KERNEL | GFP_DMA32, 2);
if (page == NULL)
return NULL;

Expand Down

0 comments on commit 66c669b

Please sign in to comment.