All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/amdgpu: Reserve shared fence for eviction fence
@ 2019-05-06 20:23 Kuehling, Felix
       [not found] ` <20190506202331.7456-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Kuehling, Felix @ 2019-05-06 20:23 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Kuehling, Felix

Need to reserve space for the shared eviction fence when initializing
a KFD VM.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 20cf8e1e7445..e1cae4a37113 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -875,6 +875,9 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
 				  AMDGPU_FENCE_OWNER_KFD, false);
 	if (ret)
 		goto wait_pd_fail;
+	ret = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv, 1);
+	if (ret)
+		goto reserve_shared_fail;
 	amdgpu_bo_fence(vm->root.base.bo,
 			&vm->process_info->eviction_fence->base, true);
 	amdgpu_bo_unreserve(vm->root.base.bo);
@@ -888,6 +891,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
 
 	return 0;
 
+reserve_shared_fail:
 wait_pd_fail:
 validate_pd_fail:
 	amdgpu_bo_unreserve(vm->root.base.bo);
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] drm/amdgpu: Reserve shared fence for eviction fence
       [not found] ` <20190506202331.7456-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-07 17:54   ` Kasiviswanathan, Harish
  0 siblings, 0 replies; 2+ messages in thread
From: Kasiviswanathan, Harish @ 2019-05-07 17:54 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>


On 2019-05-06 4:23 p.m., Kuehling, Felix wrote:
> [CAUTION: External Email]
>
> Need to reserve space for the shared eviction fence when initializing
> a KFD VM.
>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 20cf8e1e7445..e1cae4a37113 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -875,6 +875,9 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
>                                   AMDGPU_FENCE_OWNER_KFD, false);
>         if (ret)
>                 goto wait_pd_fail;
> +       ret = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv, 1);
> +       if (ret)
> +               goto reserve_shared_fail;
>         amdgpu_bo_fence(vm->root.base.bo,
>                         &vm->process_info->eviction_fence->base, true);
>         amdgpu_bo_unreserve(vm->root.base.bo);
> @@ -888,6 +891,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
>
>         return 0;
>
> +reserve_shared_fail:
>  wait_pd_fail:
>  validate_pd_fail:
>         amdgpu_bo_unreserve(vm->root.base.bo);
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-07 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 20:23 [PATCH 1/1] drm/amdgpu: Reserve shared fence for eviction fence Kuehling, Felix
     [not found] ` <20190506202331.7456-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2019-05-07 17:54   ` Kasiviswanathan, Harish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.