diff options
author | Thomas Hellstrom <thomas@tungstengraphics.com> | 2007-01-23 04:33:43 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-02-03 17:16:24 -0500 |
commit | a030ce4477baa06dd9c037ccd3c8d171aac9ed44 (patch) | |
tree | 1961f175a2785cc7d5325f45139558de471c4733 /drivers/char/agp/alpha-agp.c | |
parent | 0316fe8319ff62e527d0d91a3bc7df1c59eafae8 (diff) |
[AGPGART] Allow drm-populated agp memory types
This patch allows drm to populate an agpgart structure with pages of its own.
It's needed for the new drm memory manager which dynamically flips pages in and out of AGP.
The patch modifies the generic functions as well as the intel agp driver. The intel drm driver is
currently the only one supporting the new memory manager.
Other agp drivers may need some minor fixing up once they have a corresponding memory manager enabled drm driver.
AGP memory types >= AGP_USER_TYPES are not populated by the agpgart driver, but the drm is expected
to do that, as well as taking care of cache- and tlb flushing when needed.
It's not possible to request these types from user space using agpgart ioctls.
The Intel driver also gets a new memory type for pages that can be bound cached to the intel GTT.
Signed-off-by: Thomas Hellstrom <thomas@tungstengraphics.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp/alpha-agp.c')
-rw-r--r-- | drivers/char/agp/alpha-agp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c index b4e00a343da9..b0acf41c0db9 100644 --- a/drivers/char/agp/alpha-agp.c +++ b/drivers/char/agp/alpha-agp.c | |||
@@ -91,6 +91,9 @@ static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start, | |||
91 | int num_entries, status; | 91 | int num_entries, status; |
92 | void *temp; | 92 | void *temp; |
93 | 93 | ||
94 | if (type >= AGP_USER_TYPES || mem->type >= AGP_USER_TYPES) | ||
95 | return -EINVAL; | ||
96 | |||
94 | temp = agp_bridge->current_size; | 97 | temp = agp_bridge->current_size; |
95 | num_entries = A_SIZE_FIX(temp)->num_entries; | 98 | num_entries = A_SIZE_FIX(temp)->num_entries; |
96 | if ((pg_start + mem->page_count) > num_entries) | 99 | if ((pg_start + mem->page_count) > num_entries) |
@@ -142,6 +145,7 @@ struct agp_bridge_driver alpha_core_agp_driver = { | |||
142 | .free_by_type = agp_generic_free_by_type, | 145 | .free_by_type = agp_generic_free_by_type, |
143 | .agp_alloc_page = agp_generic_alloc_page, | 146 | .agp_alloc_page = agp_generic_alloc_page, |
144 | .agp_destroy_page = agp_generic_destroy_page, | 147 | .agp_destroy_page = agp_generic_destroy_page, |
148 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | ||
145 | }; | 149 | }; |
146 | 150 | ||
147 | struct agp_bridge_data *alpha_bridge; | 151 | struct agp_bridge_data *alpha_bridge; |