All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Chris Wilson <chris-Y6uKTt2uX1cEflXRtASbqLVCufUGDwFn@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Mikko Perttunen
	<mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 0/3] drm/tegra: Add support for fence FDs
Date: Fri, 12 Jan 2018 16:14:38 +0100	[thread overview]
Message-ID: <20180112151438.GD19999@ulmo> (raw)
In-Reply-To: <151575361658.23681.15835882826597063093-M6iVdVfohj6unts5RBS2dVaTQe2KTcn/@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]

On Fri, Jan 12, 2018 at 10:40:16AM +0000, Chris Wilson wrote:
> Quoting Thierry Reding (2018-01-11 22:22:46)
> > From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> > 
> > This set of patches adds support for fences to Tegra DRM and complements
> > the fence FD support for Nouveau. Technically this isn't necessary for a
> > fence-based synchronization loop with Nouveau because the KMS core takes
> > care of all that, but engines behind host1x can use the IOCTL extensions
> > provided here to emit fence FDs that in turn can be used to synchronize
> > their jobs with either the scanout engine or the GPU.
> 
> Whilst hooking up fences, I advise you to also hook up drm_syncobj.
> Internally they each resolve to another fence, so the mechanics are
> identical, you just need another array in the uABI for in/out syncobj.
> The advantage of drm_syncobj is that userspace can track internal fences
> using inexhaustible handles, reserving the precious fd for IPC or KMS.

I'm not sure that I properly understand how to use these. It looks as if
they are better fence FDs, so in case where you submit internal work you
would go with a drm_syncobj and when you need access to the fence from a
different process or driver, you should use an FD.

Doesn't this mean we can cover this by just adding a flag that marks the
fence as being a handle or an FD? Do we have situations where we want an
FD *and* a handle returned as result of the job submission?

For the above it would suffice to add two additional flags:

	#define DRM_TEGRA_SUBMIT_WAIT_SYNCOBJ (1 << 2)
	#define DRM_TEGRA_SUBMIT_EMIT_SYNCOBJ (1 << 3)

which would even allow both to be combined:

	DRM_TEGRA_SUBMIT_WAIT_SYNCOBJ | DRM_TEGRA_SUBMIT_EMIT_FENCE_FD

would allow the job to wait for an internal syncobj (defined by handle
in the fence member) and return a fence (as FD in the fence member) to
pass on to another process or driver as prefence.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2018-01-12 15:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 22:22 [PATCH 0/3] drm/tegra: Add support for fence FDs Thierry Reding
     [not found] ` <20180111222249.29105-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-11 22:22   ` [PATCH 1/3] gpu: host1x: Add support for DMA fences Thierry Reding
     [not found]     ` <20180111222249.29105-2-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-11 23:25       ` Dmitry Osipenko
2018-01-11 22:22   ` [PATCH 2/3] drm/tegra: Add sync file support to submit interface Thierry Reding
2018-01-11 22:22   ` [PATCH 3/3] drm/tegra: Support for sync file-based fences in submit Thierry Reding
2018-01-12 10:40   ` [PATCH 0/3] drm/tegra: Add support for fence FDs Chris Wilson
     [not found]     ` <151575361658.23681.15835882826597063093-M6iVdVfohj6unts5RBS2dVaTQe2KTcn/@public.gmane.org>
2018-01-12 15:14       ` Thierry Reding [this message]
2018-01-12 15:38         ` Chris Wilson
     [not found]           ` <151577153600.24367.14807966085718429746-M6iVdVfohj6unts5RBS2dVaTQe2KTcn/@public.gmane.org>
2018-01-12 16:04             ` Thierry Reding
2018-01-15 13:57               ` Chris Wilson

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=20180112151438.GD19999@ulmo \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=chris-Y6uKTt2uX1cEflXRtASbqLVCufUGDwFn@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.