linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Christian König" <christian.koenig@amd.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	Gustavo Padovan <gustavo@padovan.org>,
	dri-devel@lists.freedesktop.org, marcheu@google.com,
	Daniel Stone <daniels@collabora.com>,
	seanpaul@google.com, linux-kernel@vger.kernel.org,
	laurent.pinchart@ideasonboard.com,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	John Harrison <John.C.Harrison@Intel.com>,
	m.chehab@samsung.com
Subject: Re: [PATCH v7 0/3] drm: add explict fencing
Date: Tue, 8 Nov 2016 13:52:06 +0100	[thread overview]
Message-ID: <20161108125206.f7l42lqlpt76wd5a@phenom.ffwll.local> (raw)
In-Reply-To: <d42b453d-2d8c-cfe9-af6d-524394fc2ad5@amd.com>

On Tue, Nov 08, 2016 at 01:44:34PM +0100, Christian König wrote:
> Am 08.11.2016 um 12:45 schrieb Chris Wilson:
> > On Tue, Nov 08, 2016 at 12:32:56PM +0100, Daniel Vetter wrote:
> > > On Tue, Nov 08, 2016 at 10:35:08AM +0000, Chris Wilson wrote:
> > > > On Tue, Nov 08, 2016 at 03:54:47PM +0900, Gustavo Padovan wrote:
> > > > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > This is yet another version of the DRM fences patches. Please refer
> > > > > to the cover letter[1] in a previous version to check for more details.
> > > > Explicit fencing is not a superset of the implicit fences. The driver
> > > > may be using implicit fences (on a reservation object) to serialise
> > > > asynchronous operations wrt to each other (such as dispatching threads
> > > > to flush cpu caches to memory, manipulating page tables and the like
> > > > before the flip).  Since the user doesn't know about these operations,
> > > > they are not included in the explicit fence they provide, at which point
> > > > we can't trust their fence to the exclusion of the implicit fences...
> > > My thoughts are that in atomic_check drivers just fill in the fence from
> > > the reservation_object (i.e. the uapi implicit fencing part). If there's
> > > any additional work that's queued up in ->prepare_fb then I guess the
> > > driver needs to track that internally, but _only_ for kernel-internally
> > > queued work.
> > That's not a trivial task to work out which of the fence contexts within
> > the reservation object are required and which are to be replaced by the
> > explicit fence, esp. when you have to consider external fences.
> > > The reason for that is that with explicit fencing we want to allow
> > > userspace to overwrite any existing implicit fences that might hang
> > > around.
> > I'm just suggesting the danger of that when userspace doesn't know
> > everything and the current interfaces do not allow for userspace to know,
> > we only tell userspace about its own action (more or less).
> 
> It's even worse than that. See the kernel can for example swap out objects
> any time it wants.
> 
> Userspace doesn't know about such operations and so can't provide them as
> explicit fence.
> 
> Same is true for example in situations where one userspace process doesn't
> know about operations another process does. E.g. for backward compatibility
> with DRI2/3 for example.
> 
> So we will always have a mixture of implicit fences and explicit fences.
> 
> The approach we used for amdgpu is that we implicit wait for all fences
> which the initiator of an operation can't know about (e.g. from another
> process or kernel internally) and explicitly wait for all additional fences
> provided by the initiator or an operation.

On android userspace is also supposed to know about explicit fences from
other users, i.e. shared buffers. So there you shouldn't wait for implicit
fences from other processes, only for kernel-internal stuff.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-11-08 12:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  6:54 [PATCH v7 0/3] drm: add explict fencing Gustavo Padovan
2016-11-08  6:54 ` [PATCH v7 1/3] drm/fence: add in-fences support Gustavo Padovan
2016-11-08 11:06   ` Daniel Vetter
2016-11-08 15:27   ` Brian Starkey
2016-11-08 16:11     ` Daniel Vetter
2016-11-08  6:54 ` [PATCH v7 2/3] drm/fence: add fence timeline to drm_crtc Gustavo Padovan
2016-11-08  6:54 ` [PATCH v7 3/3] drm/fence: add out-fences support Gustavo Padovan
2016-11-08 13:15   ` Daniel Vetter
2016-11-09  2:39     ` Gustavo Padovan
2016-11-09 10:18       ` Daniel Vetter
2016-11-08 15:36   ` Brian Starkey
2016-11-08 10:35 ` [PATCH v7 0/3] drm: add explict fencing Chris Wilson
2016-11-08 11:32   ` Daniel Vetter
2016-11-08 11:45     ` Chris Wilson
2016-11-08 12:43       ` Daniel Vetter
2016-11-08 12:52         ` Chris Wilson
2016-11-08 12:44       ` Christian König
2016-11-08 12:52         ` Daniel Vetter [this message]
2016-11-08 13:18 ` Daniel Vetter

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=20161108125206.f7l42lqlpt76wd5a@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=John.C.Harrison@Intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=marcheu@google.com \
    --cc=seanpaul@google.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).