]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amdgpu: fix error checking when reuse vmid on same ring
authorChunming Zhou <David1.Zhou@amd.com>
Thu, 14 Apr 2016 07:53:55 +0000 (15:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:22:58 +0000 (20:22 -0400)
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 2aff938f94c67364de9b22c782dcaf8494288d37..856116a874bb29da99b189f1baa236c99f6293a2 100644 (file)
@@ -191,7 +191,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
                if (pd_addr != id->pd_gpu_addr)
                        continue;
 
-               if (id != vm->ids[ring->idx] &&
+               if (id->last_user != ring &&
                    (!id->last_flush || !fence_is_signaled(id->last_flush)))
                        continue;
 
@@ -200,7 +200,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
                        continue;
 
                /* Good we can use this VMID */
-               if (id == vm->ids[ring->idx]) {
+               if (id->last_user == ring) {
                        r = amdgpu_sync_fence(ring->adev, sync,
                                              id->first);
                        if (r)