diff options
author | Christian König <deathsimple@vodafone.de> | 2012-08-06 12:57:44 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-20 13:10:38 -0400 |
commit | 4bf3dd9264cfb71f18714fcf2f810e276a44170b (patch) | |
tree | 6081b06a18acbaf0c2fe91907c310f1e9df76dc4 /drivers/gpu/drm/radeon/ni.c | |
parent | 1f0e29435386e42c942ee8385d10dbfc814f5cfe (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/ni.c')
-rw-r--r-- | drivers/gpu/drm/radeon/ni.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 853800e8582f..fb6aa9dbd3a2 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -879,12 +879,13 @@ void cayman_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) | |||
879 | #endif | 879 | #endif |
880 | (ib->gpu_addr & 0xFFFFFFFC)); | 880 | (ib->gpu_addr & 0xFFFFFFFC)); |
881 | radeon_ring_write(ring, upper_32_bits(ib->gpu_addr) & 0xFF); | 881 | radeon_ring_write(ring, upper_32_bits(ib->gpu_addr) & 0xFF); |
882 | radeon_ring_write(ring, ib->length_dw | (ib->vm_id << 24)); | 882 | radeon_ring_write(ring, ib->length_dw | |
883 | (ib->vm ? (ib->vm->id << 24) : 0)); | ||
883 | 884 | ||
884 | /* flush read cache over gart for this vmid */ | 885 | /* flush read cache over gart for this vmid */ |
885 | radeon_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1)); | 886 | radeon_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1)); |
886 | radeon_ring_write(ring, (CP_COHER_CNTL2 - PACKET3_SET_CONFIG_REG_START) >> 2); | 887 | radeon_ring_write(ring, (CP_COHER_CNTL2 - PACKET3_SET_CONFIG_REG_START) >> 2); |
887 | radeon_ring_write(ring, ib->vm_id); | 888 | radeon_ring_write(ring, ib->vm ? ib->vm->id : 0); |
888 | radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3)); | 889 | radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3)); |
889 | radeon_ring_write(ring, PACKET3_TC_ACTION_ENA | PACKET3_SH_ACTION_ENA); | 890 | radeon_ring_write(ring, PACKET3_TC_ACTION_ENA | PACKET3_SH_ACTION_ENA); |
890 | radeon_ring_write(ring, 0xFFFFFFFF); | 891 | radeon_ring_write(ring, 0xFFFFFFFF); |