summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2016-04-25 10:23:34 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-05-11 12:31:15 -0400
commit1f207f81e371bed8aa4c898de091d5cfbf68f59e (patch)
tree6acfb912d1b2a90ba7c10373f670c6d45b198b43 /drivers
parent031e2983e8e385b9c99367586decabf6323ae049 (diff)
drm/amdgpu: make vmid owner be client_id
Using the pointer is not adequate. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 275378c46b9f..2c3d9557e1a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -185,7 +185,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
if (!id)
continue;
- if (atomic_long_read(&id->owner) != (long)vm)
+ if (atomic_long_read(&id->owner) != vm->client_id)
continue;
if (pd_addr != id->pd_gpu_addr)
@@ -261,7 +261,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
list_move_tail(&id->list, &adev->vm_manager.ids_lru);
id->last_user = ring;
- atomic_long_set(&id->owner, (long)vm);
+ atomic_long_set(&id->owner, vm->client_id);
vm->ids[ring->idx] = id;
*vm_id = id - adev->vm_manager.ids;
@@ -1485,7 +1485,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
list) {
if (!id)
continue;
- if (atomic_long_read(&id->owner) == (long)vm) {
+ if (atomic_long_read(&id->owner) == vm->client_id) {
atomic_long_set(&id->owner, 0);
id->pd_gpu_addr = 0;
}