diff options
author | Dave Airlie <airlied@redhat.com> | 2009-06-12 00:11:41 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-06-18 20:21:42 -0400 |
commit | 07613ba2f464f59949266f4337b75b91eb610795 (patch) | |
tree | 8e43a82571686492aba2269c2e7a49c323783af1 /drivers/char/agp/parisc-agp.c | |
parent | 2908826d045a89805714e0a3055a99dc40565d41 (diff) |
agp: switch AGP to use page array instead of unsigned long array
This switches AGP to use an array of pages for tracking the
pages allocated to the GART. This should enable GEM on PAE to work
a lot better as we can pass highmem pages to the PAT code and it will
do the right thing with them.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/agp/parisc-agp.c')
-rw-r--r-- | drivers/char/agp/parisc-agp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c index 699e3422ad93..f4bb43fb8016 100644 --- a/drivers/char/agp/parisc-agp.c +++ b/drivers/char/agp/parisc-agp.c | |||
@@ -31,6 +31,10 @@ | |||
31 | #define AGP8X_MODE_BIT 3 | 31 | #define AGP8X_MODE_BIT 3 |
32 | #define AGP8X_MODE (1 << AGP8X_MODE_BIT) | 32 | #define AGP8X_MODE (1 << AGP8X_MODE_BIT) |
33 | 33 | ||
34 | static unsigned long | ||
35 | parisc_agp_mask_memory(struct agp_bridge_data *bridge, unsigned long addr, | ||
36 | int type); | ||
37 | |||
34 | static struct _parisc_agp_info { | 38 | static struct _parisc_agp_info { |
35 | void __iomem *ioc_regs; | 39 | void __iomem *ioc_regs; |
36 | void __iomem *lba_regs; | 40 | void __iomem *lba_regs; |
@@ -149,12 +153,12 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
149 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { | 153 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { |
150 | unsigned long paddr; | 154 | unsigned long paddr; |
151 | 155 | ||
152 | paddr = mem->memory[i]; | 156 | paddr = page_to_phys(mem->pages[i]); |
153 | for (k = 0; | 157 | for (k = 0; |
154 | k < info->io_pages_per_kpage; | 158 | k < info->io_pages_per_kpage; |
155 | k++, j++, paddr += info->io_page_size) { | 159 | k++, j++, paddr += info->io_page_size) { |
156 | info->gatt[j] = | 160 | info->gatt[j] = |
157 | agp_bridge->driver->mask_memory(agp_bridge, | 161 | parisc_agp_mask_memory(agp_bridge, |
158 | paddr, type); | 162 | paddr, type); |
159 | } | 163 | } |
160 | } | 164 | } |
@@ -185,9 +189,17 @@ parisc_agp_remove_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
185 | } | 189 | } |
186 | 190 | ||
187 | static unsigned long | 191 | static unsigned long |
188 | parisc_agp_mask_memory(struct agp_bridge_data *bridge, | 192 | parisc_agp_mask_memory(struct agp_bridge_data *bridge, unsigned long addr, |
189 | unsigned long addr, int type) | 193 | int type) |
194 | { | ||
195 | return SBA_PDIR_VALID_BIT | addr; | ||
196 | } | ||
197 | |||
198 | static unsigned long | ||
199 | parisc_agp_page_mask_memory(struct agp_bridge_data *bridge, struct page *page, | ||
200 | int type) | ||
190 | { | 201 | { |
202 | unsigned long addr = phys_to_gart(page_to_phys(page)); | ||
191 | return SBA_PDIR_VALID_BIT | addr; | 203 | return SBA_PDIR_VALID_BIT | addr; |
192 | } | 204 | } |
193 | 205 | ||