[PATCH 03/11] drm/amdgpu: use DMA_RESV_USAGE_BOOKKEEP
Felix Kuehling
felix.kuehling at amd.com
Thu Aug 25 15:10:18 UTC 2022
Am 2022-08-25 um 09:31 schrieb Christian König:
> Use DMA_RESV_USAGE_BOOKKEEP for VM page table updates and KFD preemption fence.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index cbd593f7d553..85eb68ec692e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -297,7 +297,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo,
> */
> replacement = dma_fence_get_stub();
> dma_resv_replace_fences(bo->tbo.base.resv, ef->base.context,
> - replacement, DMA_RESV_USAGE_READ);
> + replacement, DMA_RESV_USAGE_BOOKKEEP);
This is only for the dummy fence when removing a real eviction fence.
I'd expect another change where the eviction fence gets added.
Regards,
Felix
> dma_fence_put(replacement);
> return 0;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
> index 1fd3cbca20a2..03ec099d64e0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
> @@ -112,7 +112,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
> swap(p->vm->last_unlocked, tmp);
> dma_fence_put(tmp);
> } else {
> - amdgpu_bo_fence(p->vm->root.bo, f, true);
> + dma_resv_add_fence(p->vm->root.bo->tbo.base.resv, f,
> + DMA_RESV_USAGE_BOOKKEEP);
> }
>
> if (fence && !p->immediate)
More information about the amd-gfx
mailing list