aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-09-11 10:10:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-09-20 13:10:42 -0400
commite971bd5e45764ff76df0ff110a19bf6b924f84d6 (patch)
treeddbb71c68d5cd1d3d525ba815b5357ef73194c02 /drivers/gpu/drm/radeon/radeon.h
parentd59f70216b7166f03fa732964deafc6453d62eb6 (diff)
drm/radeon: rework the VM code a bit more (v2)
Roughly based on how nouveau is handling it. Instead of adding the bo_va when the address is set add the bo_va when the handle is opened, but set the address to zero until userspace tells us where to place it. This fixes another bunch of problems with glamor. v2: agd5f: fix build after dropping patch 7/8. Signed-off-by: Christian König <deathsimple@vodafone.de>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 8cca1d2f0510..4d67f0f5a5a3 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -292,17 +292,20 @@ struct radeon_mman {
292 292
293/* bo virtual address in a specific vm */ 293/* bo virtual address in a specific vm */
294struct radeon_bo_va { 294struct radeon_bo_va {
295 /* bo list is protected by bo being reserved */ 295 /* protected by bo being reserved */
296 struct list_head bo_list; 296 struct list_head bo_list;
297 /* vm list is protected by vm mutex */
298 struct list_head vm_list;
299 /* constant after initialization */
300 struct radeon_vm *vm;
301 struct radeon_bo *bo;
302 uint64_t soffset; 297 uint64_t soffset;
303 uint64_t eoffset; 298 uint64_t eoffset;
304 uint32_t flags; 299 uint32_t flags;
305 bool valid; 300 bool valid;
301 unsigned ref_count;
302
303 /* protected by vm mutex */
304 struct list_head vm_list;
305
306 /* constant after initialization */
307 struct radeon_vm *vm;
308 struct radeon_bo *bo;
306}; 309};
307 310
308struct radeon_bo { 311struct radeon_bo {
@@ -1848,14 +1851,15 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev,
1848 struct radeon_bo *bo); 1851 struct radeon_bo *bo);
1849struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm, 1852struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm,
1850 struct radeon_bo *bo); 1853 struct radeon_bo *bo);
1851int radeon_vm_bo_add(struct radeon_device *rdev, 1854struct radeon_bo_va *radeon_vm_bo_add(struct radeon_device *rdev,
1852 struct radeon_vm *vm, 1855 struct radeon_vm *vm,
1853 struct radeon_bo *bo, 1856 struct radeon_bo *bo);
1854 uint64_t offset, 1857int radeon_vm_bo_set_addr(struct radeon_device *rdev,
1855 uint32_t flags); 1858 struct radeon_bo_va *bo_va,
1859 uint64_t offset,
1860 uint32_t flags);
1856int radeon_vm_bo_rmv(struct radeon_device *rdev, 1861int radeon_vm_bo_rmv(struct radeon_device *rdev,
1857 struct radeon_vm *vm, 1862 struct radeon_bo_va *bo_va);
1858 struct radeon_bo *bo);
1859 1863
1860/* audio */ 1864/* audio */
1861void r600_audio_update_hdmi(struct work_struct *work); 1865void r600_audio_update_hdmi(struct work_struct *work);