drm/radeon: rework the vm_flush interface
Pass the vm and ring index rather than an IB. This allows
us to use the vm_flush interface for non-IB cases in the
future.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index f920a2c..9a46f7d 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1565,10 +1565,9 @@
* Update the page table base and flush the VM TLB
* using the CP (cayman-si).
*/
-void cayman_vm_flush(struct radeon_device *rdev, struct radeon_ib *ib)
+void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
{
- struct radeon_ring *ring = &rdev->ring[ib->ring];
- struct radeon_vm *vm = ib->vm;
+ struct radeon_ring *ring = &rdev->ring[ridx];
if (vm == NULL)
return;
@@ -1588,5 +1587,5 @@
/* bits 0-7 are the VM contexts0-7 */
radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0));
- radeon_ring_write(ring, 1 << ib->vm->id);
+ radeon_ring_write(ring, 1 << vm->id);
}