diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-06-15 16:56:15 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-06-19 09:27:20 +1000 |
commit | 62369028c7e2039b821799b3db52f0d622f0e8b5 (patch) | |
tree | 9f0a6f505c736615fe144832c9b5056f6812a3df /drivers | |
parent | 46f4b3eab73e621bc239bfa62ebdc44dcc0a877a (diff) |
agp/uninorth: Handle user memory types.
This adds support for TTM to the uninorth AGP bridge.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/agp/uninorth-agp.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 03f95ec08f5..880d3f6d5b9 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -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; @@ -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; |