* [PATCH] drm/amdgpu: Reserve space for shared fence
@ 2019-06-11 16:20 Zeng, Oak
[not found] ` <1560270022-4934-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Zeng, Oak @ 2019-06-11 16:20 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Kuehling, Felix, Zeng, Oak
Call reservation_object_reserve_shared to reserve
space for shared fence. Otherwise it will trigger
BUG_ON condition in reservation_object_add_shared_fence.
Change-Id: Ib0fae16247e33ee68f95bffa723451c0cd619344
Signed-off-by: Oak Zeng <Oak.Zeng@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 81e0e75..74e8695 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
* Add process eviction fence to bo so they can
* evict each other.
*/
+ ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
+ if (ret)
+ goto reserve_shared_fail;
amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
amdgpu_bo_unreserve(gws_bo);
mutex_unlock(&(*mem)->process_info->lock);
return ret;
+reserve_shared_fail:
bo_validation_failure:
amdgpu_bo_unreserve(gws_bo);
bo_reservation_failure:
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Reserve space for shared fence
[not found] ` <1560270022-4934-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
@ 2019-06-12 7:58 ` Christian König
2019-06-12 18:11 ` Kuehling, Felix
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2019-06-12 7:58 UTC (permalink / raw)
To: Zeng, Oak,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Kuehling, Felix
Am 11.06.19 um 18:20 schrieb Zeng, Oak:
> Call reservation_object_reserve_shared to reserve
> space for shared fence. Otherwise it will trigger
> BUG_ON condition in reservation_object_add_shared_fence.
>
> Change-Id: Ib0fae16247e33ee68f95bffa723451c0cd619344
> Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Acked-by: Christian König <christian.koenig@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 81e0e75..74e8695 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
> * Add process eviction fence to bo so they can
> * evict each other.
> */
> + ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
> + if (ret)
> + goto reserve_shared_fail;
> amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
> amdgpu_bo_unreserve(gws_bo);
> mutex_unlock(&(*mem)->process_info->lock);
>
> return ret;
>
> +reserve_shared_fail:
> bo_validation_failure:
> amdgpu_bo_unreserve(gws_bo);
> bo_reservation_failure:
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Reserve space for shared fence
[not found] ` <1560270022-4934-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
2019-06-12 7:58 ` Christian König
@ 2019-06-12 18:11 ` Kuehling, Felix
1 sibling, 0 replies; 3+ messages in thread
From: Kuehling, Felix @ 2019-06-12 18:11 UTC (permalink / raw)
To: Zeng, Oak,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
On 2019-06-11 9:20, Zeng, Oak wrote:
> Call reservation_object_reserve_shared to reserve
> space for shared fence. Otherwise it will trigger
> BUG_ON condition in reservation_object_add_shared_fence.
>
> Change-Id: Ib0fae16247e33ee68f95bffa723451c0cd619344
> Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-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 81e0e75..74e8695 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
> * Add process eviction fence to bo so they can
> * evict each other.
> */
> + ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
> + if (ret)
> + goto reserve_shared_fail;
> amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
> amdgpu_bo_unreserve(gws_bo);
> mutex_unlock(&(*mem)->process_info->lock);
>
> return ret;
>
> +reserve_shared_fail:
> bo_validation_failure:
> amdgpu_bo_unreserve(gws_bo);
> bo_reservation_failure:
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-12 18:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-11 16:20 [PATCH] drm/amdgpu: Reserve space for shared fence Zeng, Oak
[not found] ` <1560270022-4934-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
2019-06-12 7:58 ` Christian König
2019-06-12 18:11 ` Kuehling, Felix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox