From: zhoucm1 <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 3/3] drm/amdgpu: add sched sync for amdgpu job
Date: Wed, 10 May 2017 09:58:33 +0800 [thread overview]
Message-ID: <591273C9.9000507@amd.com> (raw)
In-Reply-To: <1ccd8f37-0297-315e-0355-f38b1b511924-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
On 2017年05月09日 19:16, Christian König wrote:
> What's the background of this change? E.g. why it is needed?
price question, maybe I should describe more in patch comment, I think
this is an improvement for previous patch, the sched_sync is to store
fence that could be skipped as scheduled, when job is executed, we
didn't need pipeline_sync if all fences in sched_sync are signalled,
otherwise insert pipeline_sync still.
Regards,
David Zhou
>
> Christian.
>
> Am 09.05.2017 um 10:14 schrieb Chunming Zhou:
>> Change-Id: I26d3a2794272ba94b25753d4bf367326d12f6939
>> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 +++++-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 ++++-
>> 3 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 787acd7..ef018bf 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -1162,6 +1162,7 @@ struct amdgpu_job {
>> struct amdgpu_vm *vm;
>> struct amdgpu_ring *ring;
>> struct amdgpu_sync sync;
>> + struct amdgpu_sync sched_sync;
>> struct amdgpu_ib *ibs;
>> struct fence *fence; /* the hw fence */
>> uint32_t preamble_status;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> index 2c6624d..d7f75bc 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> @@ -167,8 +167,12 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring,
>> unsigned num_ibs,
>> return r;
>> }
>> - if (ring->funcs->emit_pipeline_sync && job &&
>> job->need_pipeline_sync)
>> + if (ring->funcs->emit_pipeline_sync && job &&
>> + (tmp = amdgpu_sync_get_fence(&job->sched_sync))) {
>> + job->need_pipeline_sync = true;
>> amdgpu_ring_emit_pipeline_sync(ring);
>> + fence_put(tmp);
>> + }
>> if (vm) {
>> amdgpu_ring_insert_nop(ring, extra_nop); /* prevent CE go
>> too fast than DE */
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> index cfa97ab..fa0c8b1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> @@ -60,6 +60,7 @@ int amdgpu_job_alloc(struct amdgpu_device *adev,
>> unsigned num_ibs,
>> (*job)->need_pipeline_sync = false;
>> amdgpu_sync_create(&(*job)->sync);
>> + amdgpu_sync_create(&(*job)->sched_sync);
>> return 0;
>> }
>> @@ -98,6 +99,7 @@ static void amdgpu_job_free_cb(struct amd_sched_job
>> *s_job)
>> fence_put(job->fence);
>> amdgpu_sync_free(&job->sync);
>> + amdgpu_sync_free(&job->sched_sync);
>> kfree(job);
>> }
>> @@ -107,6 +109,7 @@ void amdgpu_job_free(struct amdgpu_job *job)
>> fence_put(job->fence);
>> amdgpu_sync_free(&job->sync);
>> + amdgpu_sync_free(&job->sched_sync);
>> kfree(job);
>> }
>> @@ -154,7 +157,7 @@ static struct fence
>> *amdgpu_job_dependency(struct amd_sched_job *sched_job)
>> }
>> if (amd_sched_dependency_optimized(fence, sched_job->s_entity))
>> - job->need_pipeline_sync = true;
>> + amdgpu_sync_fence(job->adev, &job->sched_sync, fence);
>> return fence;
>> }
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-05-10 1:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 8:14 [PATCH 1/3] drm/amd: fix init order of sched job Chunming Zhou
[not found] ` <1494317649-16751-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-05-09 8:14 ` [PATCH 2/3] drm/amdgpu: fix dependency issue Chunming Zhou
[not found] ` <1494317649-16751-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-05-09 8:38 ` Zhang, Jerry (Junwei)
2017-05-09 11:14 ` Christian König
2017-05-09 8:14 ` [PATCH 3/3] drm/amdgpu: add sched sync for amdgpu job Chunming Zhou
[not found] ` <1494317649-16751-3-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-05-09 11:16 ` Christian König
[not found] ` <1ccd8f37-0297-315e-0355-f38b1b511924-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-10 1:58 ` zhoucm1 [this message]
2017-05-09 8:33 ` [PATCH 1/3] drm/amd: fix init order of sched job Zhang, Jerry (Junwei)
[not found] ` <59117EE0.2040007-5C7GfCeVMHo@public.gmane.org>
2017-05-09 11:10 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2017-05-09 8:19 [PATCH 3/3] drm/amdgpu: add sched sync for amdgpu job Chunming Zhou
[not found] ` <1494317990-25036-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-05-09 8:40 ` Zhang, Jerry (Junwei)
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=591273C9.9000507@amd.com \
--to=david1.zhou-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@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.