]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amdgpu: make the VMID owner always 64bit
authorChristian König <christian.koenig@amd.com>
Wed, 4 May 2016 08:20:01 +0000 (10:20 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 May 2016 16:31:18 +0000 (12:31 -0400)
Otherwise we could (in theory) run into problems on 32bit systems.

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

index e42b0a357fb8cd5533085dd53aaea611376fc065..130c0a7c65d13d22a98c964cab755782b8086c7c 100644 (file)
@@ -897,7 +897,7 @@ struct amdgpu_vm_id {
        struct amdgpu_sync      active;
        struct fence            *last_flush;
        struct amdgpu_ring      *last_user;
-       atomic_long_t           owner;
+       atomic64_t              owner;
 
        uint64_t                pd_gpu_addr;
        /* last flushed PD/PT update */
index 62ce7253e91736ec9fc9267a7e37925e56033d1d..cd578987d6c0a91be4c9dc8b7969faec536e4393 100644 (file)
@@ -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) != vm->client_id)
+               if (atomic64_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, vm->client_id);
+       atomic64_set(&id->owner, vm->client_id);
        vm->ids[ring->idx] = id;
 
        *vm_id = id - adev->vm_manager.ids;