From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 1/2] drm/amdgpu: amdgpu_ctx_add_fence can't fail
Date: Mon, 27 Aug 2018 10:09:54 +0800 [thread overview]
Message-ID: <5B835D72.8090002@amd.com> (raw)
In-Reply-To: <20180824125016.1315-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
On 08/24/2018 08:50 PM, Christian König wrote:
> No more waiting for a fence done here.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 10 +---------
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 +++-----
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 6 +++---
> 3 files changed, 7 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index fd3902983195..80ad23061f1c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1217,15 +1217,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
> job->owner = p->filp;
> p->fence = dma_fence_get(&job->base.s_fence->finished);
>
> - r = amdgpu_ctx_add_fence(p->ctx, entity, p->fence, &seq);
> - if (r) {
> - dma_fence_put(p->fence);
> - dma_fence_put(&job->base.s_fence->finished);
> - amdgpu_job_free(job);
> - amdgpu_mn_unlock(p->mn);
> - return r;
> - }
> -
> + amdgpu_ctx_add_fence(p->ctx, entity, p->fence, &seq);
> amdgpu_cs_post_dependencies(p);
>
> if ((job->preamble_status & AMDGPU_PREAMBLE_IB_PRESENT) &&
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 987b7f256463..f9b54236102d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -434,9 +434,9 @@ int amdgpu_ctx_put(struct amdgpu_ctx *ctx)
> return 0;
> }
>
> -int amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx,
> - struct drm_sched_entity *entity,
> - struct dma_fence *fence, uint64_t* handle)
> +void amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx,
> + struct drm_sched_entity *entity,
> + struct dma_fence *fence, uint64_t* handle)
> {
> struct amdgpu_ctx_entity *centity = to_amdgpu_ctx_entity(entity);
> uint64_t seq = centity->sequence;
> @@ -458,8 +458,6 @@ int amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx,
> dma_fence_put(other);
> if (handle)
> *handle = seq;
> -
> - return 0;
> }
>
> struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> index d67c1d285a4f..b3b012c0a7da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> @@ -65,9 +65,9 @@ int amdgpu_ctx_put(struct amdgpu_ctx *ctx);
>
> int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
> u32 ring, struct drm_sched_entity **entity);
> -int amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx,
> - struct drm_sched_entity *entity,
> - struct dma_fence *fence, uint64_t *seq);
> +void amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx,
> + struct drm_sched_entity *entity,
> + struct dma_fence *fence, uint64_t *seq);
> struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
> struct drm_sched_entity *entity,
> uint64_t seq);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2018-08-27 2:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 12:50 [PATCH 1/2] drm/amdgpu: amdgpu_ctx_add_fence can't fail Christian König
[not found] ` <20180824125016.1315-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-24 12:50 ` [PATCH 2/2] drm/amdgpu: fix holding mn_lock while allocating memory Christian König
[not found] ` <20180824125016.1315-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-24 13:35 ` Chunming Zhou
2018-08-24 13:24 ` [PATCH 1/2] drm/amdgpu: amdgpu_ctx_add_fence can't fail Chunming Zhou
2018-08-27 2:09 ` Zhang, Jerry (Junwei) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B835D72.8090002@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.