dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Mikko Perttunen <cyndis@kapsi.fi>
To: Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	sumit.semwal@linaro.org, gustavo@padovan.org
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	talho@nvidia.com, bhuntsman@nvidia.com,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Erik Faye-Lund <kusmabite@gmail.com>
Subject: Re: [RFC] Host1x/TegraDRM UAPI (sync points)
Date: Tue, 30 Jun 2020 13:26:16 +0300	[thread overview]
Message-ID: <3b058989-a93a-6796-8d94-f60ce39e3fba@kapsi.fi> (raw)
In-Reply-To: <f1a88006-ab3e-9068-e220-15eee17aeba0@gmail.com>

On 6/29/20 10:42 PM, Dmitry Osipenko wrote:
> 
> Secondly, I suppose neither GPU, nor DLA could wait on a host1x sync
> point, correct? Or are they integrated with Host1x HW?
> 

They can access syncpoints directly. (That's what I alluded to in the 
"Introduction to the hardware" section :) all those things have hardware 
access to syncpoints)

 >
 > .. rest ..
 >

Let me try to summarize once more for my own understanding:

* When submitting a job, you would allocate new syncpoints for the job
* After submitting the job, those syncpoints are not usable anymore
* Postfences of that job would keep references to those syncpoints so 
they aren't freed and cleared before the fences have been released
* Once postfences have been released, syncpoints would be returned to 
the pool and reset to zero

The advantage of this would be that at any point in time, there would be 
a 1:1 correspondence between allocated syncpoints and jobs; so you could 
  shuffle the jobs around channels or reorder them.

Please correct if I got that wrong :)

---

I have two concerns:

* A lot of churn on syncpoints - any time you submit a job you might not 
get a syncpoint for an indefinite time. If we allocate syncpoints 
up-front at least you know beforehand, and then you have the syncpoint 
as long as you need it.
* Plumbing the dma-fence/sync_file everywhere, and keeping it alive 
until waits on it have completed, is more work than just having the 
ID/threshold. This is probably mainly a problem for downstream, where 
updating code for this would be difficult. I know that's not a proper 
argument but I hope we can reach something that works for both worlds.

Here's a proposal in between:

* Keep syncpoint allocation and submission in jobs as in my original 
proposal
* Don't attempt to recover user channel contexts. What this means:
   * If we have a hardware channel per context (MLOCKing), just tear 
down the channel
   * Otherwise, we can just remove (either by patching or by full 
teardown/resubmit of the channel) all jobs submitted by the user channel 
context that submitted the hanging job. Jobs of other contexts would be 
undisturbed (though potentially delayed, which could be taken into 
account and timeouts adjusted)
* If this happens, we can set removed jobs' post-fences to error status 
and user will have to resubmit them.
* We should be able to keep the syncpoint refcounting based on fences.

This can be made more fine-grained by not caring about the user channel 
context, but tearing down all jobs with the same syncpoint. I think the 
result would be that we can get either what you described (or how I 
understood it in the summary in the beginning of the message), or a more 
traditional syncpoint-per-userctx workflow, depending on how the 
userspace decides to allocate syncpoints.

If needed, the kernel can still do e.g. reordering (you mentioned job 
priorities) at syncpoint granularity, which, if the userspace followed 
the model you described, would be the same thing as job granularity.

(Maybe it would be more difficult with current drm_scheduler, sorry, 
haven't had the time yet to read up on that. Dealing with clearing work 
stuff up before summer vacation)

Mikko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-06-30 10:26 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 12:09 [RFC] Host1x/TegraDRM UAPI Mikko Perttunen
2020-06-24 20:55 ` Dmitry Osipenko
2020-06-25  9:17   ` Mikko Perttunen
2020-06-24 22:33 ` Dmitry Osipenko
2020-06-25  9:27   ` Mikko Perttunen
2020-06-25 22:50     ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_relocation) Dmitry Osipenko
2020-06-26  9:01       ` Mikko Perttunen
2020-06-24 23:11 ` [RFC] Host1x/TegraDRM UAPI Dmitry Osipenko
2020-06-25  9:16   ` Mikko Perttunen
2020-06-25 23:24     ` Dmitry Osipenko
2020-06-26  9:05       ` Mikko Perttunen
2020-06-24 23:18 ` Dmitry Osipenko
2020-06-25  0:59   ` Dmitry Osipenko
2020-06-24 23:23 ` Dmitry Osipenko
2020-06-25  9:19   ` Mikko Perttunen
2020-06-25  0:47 ` Dmitry Osipenko
2020-06-25  9:23   ` Mikko Perttunen
2020-06-25 22:47 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_channel_map) Dmitry Osipenko
2020-06-26  7:34   ` Thierry Reding
2020-06-26 16:35     ` Dmitry Osipenko
2020-06-28 11:16       ` Mikko Perttunen
2020-06-28 22:59         ` Dmitry Osipenko
2020-06-30 10:55           ` Mikko Perttunen
2020-06-30 19:48             ` Dmitry Osipenko
2020-06-26 11:06 ` [RFC] Host1x/TegraDRM UAPI Karol Herbst
2020-06-26 11:13   ` Mikko Perttunen
2020-06-26 11:16     ` Karol Herbst
2020-06-26 11:40   ` Thierry Reding
2020-06-26 13:38     ` Daniel Vetter
2020-06-26 13:59       ` Dmitry Osipenko
2020-06-30  9:09         ` Daniel Vetter
2020-06-27 21:47 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_syncpt_incr) Dmitry Osipenko
2020-06-28 11:10   ` Mikko Perttunen
2020-06-27 22:32 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_command) Dmitry Osipenko
2020-06-28 10:28   ` Mikko Perttunen
2020-06-29  0:00     ` Dmitry Osipenko
2020-06-30 10:40       ` Mikko Perttunen
2020-06-27 23:27 ` [RFC] Host1x/TegraDRM UAPI (sync points) Dmitry Osipenko
2020-06-28  9:44   ` Mikko Perttunen
2020-06-29  2:36     ` Dmitry Osipenko
2020-06-29 10:27       ` Mikko Perttunen
2020-06-29 19:28         ` Dmitry Osipenko
2020-06-29 19:33         ` Dmitry Osipenko
2020-06-29 19:42         ` Dmitry Osipenko
2020-06-30 10:26           ` Mikko Perttunen [this message]
2020-07-01  0:22             ` Dmitry Osipenko
2020-07-02 12:10               ` Mikko Perttunen
2020-07-07 11:06                 ` Dmitry Osipenko
2020-07-08 10:06                   ` Mikko Perttunen
2020-07-09  9:28                     ` Dmitry Osipenko

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=3b058989-a93a-6796-8d94-f60ce39e3fba@kapsi.fi \
    --to=cyndis@kapsi.fi \
    --cc=airlied@linux.ie \
    --cc=bhuntsman@nvidia.com \
    --cc=daniel@ffwll.ch \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=jonathanh@nvidia.com \
    --cc=kusmabite@gmail.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=talho@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).