Skip to content

Commit

Permalink
agp/amd-k7: Allow binding user memory to the AGP GART.
Browse files Browse the repository at this point in the history
TTM-based DRM drivers need to be able to bind user memory to the AGP
aperture. This patch fixes the "[TTM] AGP Bind memory failed." errors
and the subsequent fallout seen with the nouveau driver.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Grzesiek Sójka <pld@pfu.pl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Francisco Jerez authored and Dave Airlie committed Oct 19, 2010
1 parent 965d380 commit f608613
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/agp/amd-k7-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type)

num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries;

if (type != 0 || mem->type != 0)
if (type != mem->type ||
agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type))
return -EINVAL;

if ((pg_start + mem->page_count) > num_entries)
Expand Down Expand Up @@ -348,7 +349,8 @@ static int amd_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
unsigned long __iomem *cur_gatt;
unsigned long addr;

if (type != 0 || mem->type != 0)
if (type != mem->type ||
agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type))
return -EINVAL;

for (i = pg_start; i < (mem->page_count + pg_start); i++) {
Expand Down

0 comments on commit f608613

Please sign in to comment.