Skip to content

Commit

Permalink
agp/uninorth: Handle user memory types.
Browse files Browse the repository at this point in the history
This adds support for TTM to the uninorth AGP bridge.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Michel Dänzer authored and Dave Airlie committed Jun 18, 2009
1 parent 46f4b3e commit 6236902
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions drivers/char/agp/uninorth-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,20 @@ static int uninorth_insert_memory(struct agp_memory *mem, off_t pg_start,
{
int i, j, num_entries;
void *temp;
int mask_type;

temp = agp_bridge->current_size;
num_entries = A_SIZE_32(temp)->num_entries;

if (type != 0 || mem->type != 0)
if (type != mem->type)
return -EINVAL;

mask_type = agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type);
if (mask_type != 0) {
/* We know nothing of memory types */
return -EINVAL;
}

if ((pg_start + mem->page_count) > num_entries)
return -EINVAL;

Expand Down Expand Up @@ -184,13 +191,20 @@ static int u3_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
int i, num_entries;
void *temp;
u32 *gp;
int mask_type;

temp = agp_bridge->current_size;
num_entries = A_SIZE_32(temp)->num_entries;

if (type != 0 || mem->type != 0)
if (type != mem->type)
return -EINVAL;

mask_type = agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type);
if (mask_type != 0) {
/* We know nothing of memory types */
return -EINVAL;
}

if ((pg_start + mem->page_count) > num_entries)
return -EINVAL;

Expand Down

0 comments on commit 6236902

Please sign in to comment.