drm/amdgpu: use common fence for amdgpu_vm_fence
authorChristian König <christian.koenig@amd.com>
Tue, 3 Nov 2015 13:53:28 +0000 (14:53 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 16 Nov 2015 16:05:49 +0000 (11:05 -0500)
Just cleanup the function parameters.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 3630cb545d0dae27efec570ea726dbf9ce7bc719..b801b67028126e04b806d770bcf52c6bf2d014e2 100644 (file)
@@ -2332,7 +2332,7 @@ void amdgpu_vm_flush(struct amdgpu_ring *ring,
                     struct fence *updates);
 void amdgpu_vm_fence(struct amdgpu_device *adev,
                     struct amdgpu_vm *vm,
-                    struct amdgpu_fence *fence);
+                    struct fence *fence);
 uint64_t amdgpu_vm_map_gart(struct amdgpu_device *adev, uint64_t addr);
 int amdgpu_vm_update_page_directory(struct amdgpu_device *adev,
                                    struct amdgpu_vm *vm);
index e65987743871b18bb521113d86e0245c50686b57..3902e7a9f8cc74747c06a30f7c3012cbea853589 100644 (file)
@@ -216,7 +216,7 @@ int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs,
        }
 
        if (ib->vm)
-               amdgpu_vm_fence(adev, ib->vm, ib->fence);
+               amdgpu_vm_fence(adev, ib->vm, &ib->fence->base);
 
        amdgpu_ring_unlock_commit(ring);
        return 0;
index 8c80381b1ea9335de4d3e2b7b458743f683d2f8f..a9fcc995d27efa0936286a44643b0b96535427bd 100644 (file)
@@ -241,16 +241,16 @@ void amdgpu_vm_flush(struct amdgpu_ring *ring,
  */
 void amdgpu_vm_fence(struct amdgpu_device *adev,
                     struct amdgpu_vm *vm,
-                    struct amdgpu_fence *fence)
+                    struct fence *fence)
 {
-       unsigned ridx = fence->ring->idx;
-       unsigned vm_id = vm->ids[ridx].id;
+       struct amdgpu_ring *ring = amdgpu_ring_from_fence(fence);
+       unsigned vm_id = vm->ids[ring->idx].id;
 
        fence_put(adev->vm_manager.active[vm_id]);
-       adev->vm_manager.active[vm_id] = fence_get(&fence->base);
+       adev->vm_manager.active[vm_id] = fence_get(fence);
 
-       fence_put(vm->ids[ridx].last_id_use);
-       vm->ids[ridx].last_id_use = fence_get(&fence->base);
+       fence_put(vm->ids[ring->idx].last_id_use);
+       vm->ids[ring->idx].last_id_use = fence_get(fence);
 }
 
 /**