diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/rs400.c')
-rw-r--r-- | drivers/gpu/drm/radeon/rs400.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 4519f9c93162..6c1fc339d228 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -208,17 +208,24 @@ void rs400_gart_fini(struct radeon_device *rdev) | |||
208 | radeon_gart_table_ram_free(rdev); | 208 | radeon_gart_table_ram_free(rdev); |
209 | } | 209 | } |
210 | 210 | ||
211 | #define RS400_PTE_UNSNOOPED (1 << 0) | ||
211 | #define RS400_PTE_WRITEABLE (1 << 2) | 212 | #define RS400_PTE_WRITEABLE (1 << 2) |
212 | #define RS400_PTE_READABLE (1 << 3) | 213 | #define RS400_PTE_READABLE (1 << 3) |
213 | 214 | ||
214 | void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, uint64_t addr) | 215 | void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, |
216 | uint64_t addr, uint32_t flags) | ||
215 | { | 217 | { |
216 | uint32_t entry; | 218 | uint32_t entry; |
217 | u32 *gtt = rdev->gart.ptr; | 219 | u32 *gtt = rdev->gart.ptr; |
218 | 220 | ||
219 | entry = (lower_32_bits(addr) & PAGE_MASK) | | 221 | entry = (lower_32_bits(addr) & PAGE_MASK) | |
220 | ((upper_32_bits(addr) & 0xff) << 4) | | 222 | ((upper_32_bits(addr) & 0xff) << 4); |
221 | RS400_PTE_WRITEABLE | RS400_PTE_READABLE; | 223 | if (flags & RADEON_GART_PAGE_READ) |
224 | addr |= RS400_PTE_READABLE; | ||
225 | if (flags & RADEON_GART_PAGE_WRITE) | ||
226 | addr |= RS400_PTE_WRITEABLE; | ||
227 | if (!(flags & RADEON_GART_PAGE_SNOOP)) | ||
228 | entry |= RS400_PTE_UNSNOOPED; | ||
222 | entry = cpu_to_le32(entry); | 229 | entry = cpu_to_le32(entry); |
223 | gtt[i] = entry; | 230 | gtt[i] = entry; |
224 | } | 231 | } |