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

Commit 8db588d5 authored by Felix Kuehling's avatar Felix Kuehling Committed by Alex Deucher
Browse files

drm/amdgpu: Avoid setting off KFD eviction fences in amdgpu_vm



Use FENCE_OWNER_KFD to synchronize PT/PD initialization and clearing
of page table entries. This avoids triggering KFD eviction fences on
the PD reservation objects of compute VMs.

Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c60cd590
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -828,7 +828,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,


	WARN_ON(job->ibs[0].length_dw > 64);
	WARN_ON(job->ibs[0].length_dw > 64);
	r = amdgpu_sync_resv(adev, &job->sync, bo->tbo.resv,
	r = amdgpu_sync_resv(adev, &job->sync, bo->tbo.resv,
			     AMDGPU_FENCE_OWNER_UNDEFINED, false);
			     AMDGPU_FENCE_OWNER_KFD, false);
	if (r)
	if (r)
		goto error_free;
		goto error_free;


@@ -1748,9 +1748,9 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
	params.adev = adev;
	params.adev = adev;
	params.vm = vm;
	params.vm = vm;


	/* sync to everything on unmapping */
	/* sync to everything except eviction fences on unmapping */
	if (!(flags & AMDGPU_PTE_VALID))
	if (!(flags & AMDGPU_PTE_VALID))
		owner = AMDGPU_FENCE_OWNER_UNDEFINED;
		owner = AMDGPU_FENCE_OWNER_KFD;


	if (vm->use_cpu_for_update) {
	if (vm->use_cpu_for_update) {
		/* params.src is used as flag to indicate system Memory */
		/* params.src is used as flag to indicate system Memory */