linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dave Airlie <airlied@gmail.com>
Cc: Sumit Semwal <sumit.semwal@ti.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
	linux-media@vger.kernel.org, linux@arm.linux.org.uk,
	arnd@arndb.de, jesse.barker@linaro.org, daniel@ffwll.ch
Subject: Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
Date: Fri, 25 Nov 2011 17:02:54 +0100	[thread overview]
Message-ID: <20111125160254.GA3980@phenom.ffwll.local> (raw)
In-Reply-To: <CAPM=9tzAgCSDgdvi=9QZa-gEVXwKp_gpCPTtQ10XS=Z9K4805w@mail.gmail.com>

On Fri, Nov 25, 2011 at 02:13:22PM +0000, Dave Airlie wrote:
> On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal <sumit.semwal@ti.com> wrote:
> > This is the first step in defining a dma buffer sharing mechanism.
> >
> > A new buffer object dma_buf is added, with operations and API to allow easy
> > sharing of this buffer object across devices.
> >
> > The framework allows:
> > - a new buffer-object to be created with fixed size.
> > - different devices to 'attach' themselves to this buffer, to facilitate
> >  backing storage negotiation, using dma_buf_attach() API.
> > - association of a file pointer with each user-buffer and associated
> >   allocator-defined operations on that buffer. This operation is called the
> >   'export' operation.
> > - this exported buffer-object to be shared with the other entity by asking for
> >   its 'file-descriptor (fd)', and sharing the fd across.
> > - a received fd to get the buffer object back, where it can be accessed using
> >   the associated exporter-defined operations.
> > - the exporter and user to share the scatterlist using get_scatterlist and
> >   put_scatterlist operations.
> >
> > Atleast one 'attach()' call is required to be made prior to calling the
> > get_scatterlist() operation.
> >
> > Couple of building blocks in get_scatterlist() are added to ease introduction
> > of sync'ing across exporter and users, and late allocation by the exporter.
> >
> > mmap() file operation is provided for the associated 'fd', as wrapper over the
> > optional allocator defined mmap(), to be used by devices that might need one.
> >
> > More details are there in the documentation patch.
> >
> 
> Some questions, I've started playing around with using this framework
> to do buffer sharing between DRM devices,
> 
> Why struct scatterlist and not struct sg_table? it seems like I really
> want to use an sg_table,

No reason at all besides that intel-gtt is using scatterlist internally
(and only kludges the sg_table together in an ad-hoc fashion) and so I
haven't noticed. sg_table for more consistency with the dma api sounds
good.

> I'm not convinced fd's are really useful over just some idr allocated
> handle, so far I'm just returning the "fd" to userspace as a handle,
> and passing it back in the other side, so I'm not really sure what an
> fd wins us here, apart from the mmap thing which I think shouldn't be
> here anyways.
> (if fd's do win us more we should probably record that in the docs patch).

Imo fds are nice because their known and there's already all the
preexisting infrastructure for them around. And if we ever get fancy with
e.g. sync objects we can easily add poll support (or some insane ioctls).
But I agree that "we can mmap" is bust as a reason and should just die.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-11-25 16:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11  9:23 [RFC 0/2] " Sumit Semwal
2011-10-11  9:23 ` [RFC 1/2] dma-buf: " Sumit Semwal
2011-10-12 12:41   ` [Linaro-mm-sig] " Dave Airlie
2011-10-12 13:28     ` Rob Clark
2011-10-12 13:35       ` Dave Airlie
2011-10-12 13:50         ` Rob Clark
2011-10-12 14:01           ` Dave Airlie
2011-10-12 14:24             ` Rob Clark
2011-10-12 14:34               ` Dave Airlie
2011-10-12 14:49                 ` Daniel Vetter
2011-10-12 15:15                 ` Rob Clark
2011-10-14 10:00   ` Tomasz Stanislawski
2011-10-14 14:13     ` Sumit Semwal
2011-10-14 15:34     ` Rob Clark
2011-10-14 15:35     ` Daniel Vetter
2011-11-03  8:04       ` Marek Szyprowski
2011-11-08 16:59         ` Clark, Rob
2011-11-08 17:42           ` [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanismch Daniel Vetter
2011-11-08 17:55             ` Russell King - ARM Linux
2011-11-08 18:43               ` Daniel Vetter
2011-11-28  7:47                 ` Marek Szyprowski
2011-11-28 10:34                   ` Daniel Vetter
2011-11-25 14:13   ` [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism Dave Airlie
2011-11-25 16:02     ` Daniel Vetter [this message]
2011-11-25 16:15   ` Dave Airlie
2011-11-25 16:28     ` Dave Airlie
2011-11-26 14:00       ` Daniel Vetter
2011-11-27  6:59         ` Rob Clark
2011-12-01  5:51           ` Semwal, Sumit
2011-12-01  5:55             ` Semwal, Sumit
2011-10-11  9:23 ` [RFC 2/2] dma-buf: Documentation for buffer sharing framework Sumit Semwal
2011-10-12 22:30   ` Randy Dunlap
2011-10-13  4:48     ` Semwal, Sumit

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=20111125160254.GA3980@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesse.barker@linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sumit.semwal@ti.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