From 178d7cb8d576ff837fea8e1b6460c769297615ec Mon Sep 17 00:00:00 2001 From: Chunming Zhou Date: Thu, 14 Apr 2016 15:53:55 +0800 Subject: [PATCH] drm/amdgpu: fix error checking when reuse vmid on same ring MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 2aff938f94c6..856116a874bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -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) -- 2.39.5