aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-08-06 12:57:44 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-09-20 13:10:38 -0400
commit4bf3dd9264cfb71f18714fcf2f810e276a44170b (patch)
tree6081b06a18acbaf0c2fe91907c310f1e9df76dc4 /drivers/gpu/drm/radeon/radeon_ring.c
parent1f0e29435386e42c942ee8385d10dbfc814f5cfe (diff)
drm/radeon: cleanup VM id handling a bit
Store a reference to the VM into the IB structure, that makes calculating the IBs address a bit less complicated. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 43c431a2686d..b9b1eddcd097 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -58,7 +58,8 @@ int radeon_debugfs_sa_init(struct radeon_device *rdev);
58 * Returns 0 on success, error on failure. 58 * Returns 0 on success, error on failure.
59 */ 59 */
60int radeon_ib_get(struct radeon_device *rdev, int ring, 60int radeon_ib_get(struct radeon_device *rdev, int ring,
61 struct radeon_ib *ib, unsigned size) 61 struct radeon_ib *ib, struct radeon_vm *vm,
62 unsigned size)
62{ 63{
63 int i, r; 64 int i, r;
64 65
@@ -76,8 +77,15 @@ int radeon_ib_get(struct radeon_device *rdev, int ring,
76 ib->ring = ring; 77 ib->ring = ring;
77 ib->fence = NULL; 78 ib->fence = NULL;
78 ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo); 79 ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo);
79 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo); 80 ib->vm = vm;
80 ib->vm_id = 0; 81 if (vm) {
82 /* ib pool is bind at 0 in virtual address space,
83 * so gpu_addr is the offset inside the pool bo
84 */
85 ib->gpu_addr = ib->sa_bo->soffset;
86 } else {
87 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo);
88 }
81 ib->is_const_ib = false; 89 ib->is_const_ib = false;
82 for (i = 0; i < RADEON_NUM_RINGS; ++i) 90 for (i = 0; i < RADEON_NUM_RINGS; ++i)
83 ib->sync_to[i] = NULL; 91 ib->sync_to[i] = NULL;