From mboxrd@z Thu Jan 1 00:00:00 1970 From: "=?iso-8859-1?q?R=E9mi?= Denis-Courmont" Subject: Re: [PATCHv2 3/9] v4l: add buffer exporting via dmabuf Date: Tue, 31 Jul 2012 17:18:02 +0300 Message-ID: <201207311718.05738.remi@remlab.net> References: <1339684349-28882-1-git-send-email-t.stanislaws@samsung.com> <201207311639.02693.remi@remlab.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-media-owner@vger.kernel.org To: Rob Clark Cc: Laurent Pinchart , Hans Verkuil , Tomasz Stanislawski , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@redhat.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, sumit.semwal@ti.com, daeinki@gmail.com, daniel.vetter@ffwll.ch, pawel@osciak.com, linaro-mm-sig@lists.linaro.org, subashrp@gmail.com, mchehab@redhat.com, g.liakhovetski@gmx.de List-Id: dri-devel@lists.freedesktop.org Le mardi 31 juillet 2012 17:03:52 Rob Clark, vous avez =E9crit : > On Tue, Jul 31, 2012 at 8:39 AM, R=E9mi Denis-Courmont =20 wrote: > > Le mardi 31 juillet 2012 14:56:14 Laurent Pinchart, vous avez =E9cr= it : > >> > For that matter, wouldn't it be useful to support exporting a us= erptr > >> > buffer at some point in the future? > >>=20 > >> Shouldn't USERPTR usage be discouraged once we get dma-buf support= ? > >=20 > > USERPTR, where available, is currently the only way to perform zero= -copy > > from kernel to userspace. READWRITE does not support zero-copy at a= ll. > > MMAP only supports zero-copy if userspace knows a boundary on the n= umber > > of concurrent buffers *and* the device can deal with that number of > > buffers; in general, MMAP requires memory copying. >=20 > hmm, this sounds like the problem is device pre-allocating buffers? Basically, yes. > Anyways, last time I looked, the vb2 core supported changing dmabuf f= d > each time you QBUF, in a similar way to what you can do w/ userptr. > So that seems to get you the advantages you miss w/ mmap without the > pitfalls of userptr. It might work albeit with a higher system calls count overhead. But what about libv4l2 transparent format conversion? Emulated USERBUF,= with =20 MMAP in the back-end would provide by far the least overhead. I don't s= ee how=20 DMABUF would work there. --=20 R=E9mi Denis-Courmont http://www.remlab.net/ http://fi.linkedin.com/in/remidenis