From: "Christian König" <christian.koenig@amd.com>
To: Eric Anholt <eric@anholt.net>, dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: Re: drm/scheduler for vc5
Date: Wed, 4 Apr 2018 09:13:56 +0200 [thread overview]
Message-ID: <04b94fba-c4a5-8c4d-aac5-be5e8360b77f@amd.com> (raw)
In-Reply-To: <87zi2jhoqu.fsf@anholt.net>
Am 04.04.2018 um 01:08 schrieb Eric Anholt:
> Christian König <christian.koenig@amd.com> writes:
>
>> Hi Eric,
>>
>> nice to see that the scheduler gets used more and more.
>>
>> The feature your need to solve both your binning/rendering as well as
>> your MMU problem is dependency handling. See the "dependency" callback
>> of the backend operations.
>>
>> With this callback the driver can return dma_fences which need to signal
>> (or at least be scheduled if it targets the same ring buffer/fifo).
>>
>> Now you need dma_fences as result of your run_job callback for the
>> binning step anyway. So when you return this fence from the binning step
>> as dependency for your rendering step the scheduler does exactly what
>> you want, e.g. not start the rendering before the binning is finished.
> It looks like in order to use the bin's fence returned from run_job,
> render first needs to depend on exec->bin.base.s_fence->scheduled so
> that run_job has been called. Is there any reason not to just depend on
> exec->bin.base.s_fence->finished, instead? Finished will be signaled
> basically immediately after the run_job fence completes, right?
Yes exec->bin.base.s_fence->finished should be sufficient as well.
See there are three fences involved in the scheduler:
1. The hardware fence returned by the run_job callback.
The scheduler will register on that one to be notified for completion so
that it can schedule the next job.
If you use the timeout feature it can be that we push a job to the
hardware multiple times and replace this fence when we do so.
2. s_fence->scheduled this one is signaled when the scheduler has picked
up a job.
It is the first one signaled and generally means that the job entered
the hardware fifo.
3. s_fence->finished this one is signaled when the underlying hardware
fence is signaled.
The difference to the hardware fence is that it is created much earlier
during command submission.
I should probably write all this into some kind of documentation.
Regards,
Christian.
>
> Also, I hadn't quite followed your suggestion about MMU switching
> before. Your trick was that you return a newly-generated dependency on
> MMU switching as the final dependency, so that you only decide on
> serializing the MMU switch once you're ready to run and the scheduler
> was about to pick your job anyway. This seems good to me.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2018-04-04 7:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-30 20:05 drm/scheduler for vc5 Eric Anholt
2018-03-31 17:46 ` Christian König
2018-04-02 18:49 ` Eric Anholt
2018-04-03 9:18 ` Christian König
2018-04-03 23:08 ` Eric Anholt
2018-04-04 7:13 ` Christian König [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=04b94fba-c4a5-8c4d-aac5-be5e8360b77f@amd.com \
--to=christian.koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox