aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2016-06-29 02:01:15 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 15:06:16 -0400
commit192b7dcbb5b1724786521ce9a0f20b87ad65056d (patch)
treee68ad63405bf82c33bbd71efd28f48e7976f0e7f /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentfd53be302f0efabead8e37553eaeed1572d0f727 (diff)
drm/amdgpu: abstract amdgpu_vm_is_gpu_reset
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index f39679a556f3..60fc9a508c0b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -173,6 +173,13 @@ void amdgpu_vm_move_pt_bos_in_lru(struct amdgpu_device *adev,
173 spin_unlock(&glob->lru_lock); 173 spin_unlock(&glob->lru_lock);
174} 174}
175 175
176static bool amdgpu_vm_is_gpu_reset(struct amdgpu_device *adev,
177 struct amdgpu_vm_id *id)
178{
179 return id->current_gpu_reset_count !=
180 atomic_read(&adev->gpu_reset_counter) ? true : false;
181}
182
176/** 183/**
177 * amdgpu_vm_grab_id - allocate the next free VMID 184 * amdgpu_vm_grab_id - allocate the next free VMID
178 * 185 *
@@ -256,7 +263,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
256 /* Check all the prerequisites to using this VMID */ 263 /* Check all the prerequisites to using this VMID */
257 if (!id) 264 if (!id)
258 continue; 265 continue;
259 if (id->current_gpu_reset_count != atomic_read(&adev->gpu_reset_counter)) 266 if (amdgpu_vm_is_gpu_reset(adev, id))
260 continue; 267 continue;
261 268
262 if (atomic64_read(&id->owner) != vm->client_id) 269 if (atomic64_read(&id->owner) != vm->client_id)