Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6adb0513 authored by Chunming Zhou's avatar Chunming Zhou Committed by Alex Deucher
Browse files

drm/amdgpu: must update page table after gpu reset



Record the gpu reset count in vmid to identify if gpu reset happened.

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChunming Zhou <David1.Zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 847b6cf9
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -897,6 +897,8 @@ struct amdgpu_vm_id {
	/* last flushed PD/PT update */
	/* last flushed PD/PT update */
	struct fence		*flushed_updates;
	struct fence		*flushed_updates;


	uint32_t                current_gpu_reset_count;

	uint32_t		gds_base;
	uint32_t		gds_base;
	uint32_t		gds_size;
	uint32_t		gds_size;
	uint32_t		gws_base;
	uint32_t		gws_base;
+3 −0
Original line number Original line Diff line number Diff line
@@ -255,6 +255,8 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
		/* Check all the prerequisites to using this VMID */
		/* Check all the prerequisites to using this VMID */
		if (!id)
		if (!id)
			continue;
			continue;
		if (id->current_gpu_reset_count != atomic_read(&adev->gpu_reset_counter))
			continue;


		if (atomic64_read(&id->owner) != vm->client_id)
		if (atomic64_read(&id->owner) != vm->client_id)
			continue;
			continue;
@@ -278,6 +280,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
		if (r)
		if (r)
			goto error;
			goto error;


		id->current_gpu_reset_count = atomic_read(&adev->gpu_reset_counter);
		list_move_tail(&id->list, &adev->vm_manager.ids_lru);
		list_move_tail(&id->list, &adev->vm_manager.ids_lru);
		vm->ids[ring->idx] = id;
		vm->ids[ring->idx] = id;