From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: "Rémi Denis-Courmont" <remi@remlab.net>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
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, robdclark@gmail.com,
pawel@osciak.com, linaro-mm-sig@lists.linaro.org,
hverkuil@xs4all.nl, subashrp@gmail.com
Subject: Re: [PATCH v4 02/14] Documentation: media: description of DMABUF importing in V4L2
Date: Fri, 20 Apr 2012 11:48:41 -0300 [thread overview]
Message-ID: <4F917749.1080803@redhat.com> (raw)
In-Reply-To: <4F91559D.6060900@samsung.com>
Em 20-04-2012 09:25, Tomasz Stanislawski escreveu:
> Hi Remi,
>> Now, I do realize that some devices cannot support USERPTR efficiently,
>> then they should not support USERPTR.
>
> The problem is not there is *NO* device that can handle USERPTR reliably.
> The can handle USERPTR generated by malloc or page cache (not sure).
> Memory mmaped from other devices, frameworks etc may or may not work.
> Even if the device has its IOMMU the DMA layer provides no generic way to
> transform from one device to the mapping in some other device.
>
> It is done using platform-defendant hacks like extracting PFNs from mappings,
> hack-forming them into struct pages or scatterlists, mapping it and hoping
> that the memory is not going to release it in some other thread.
>
> The only sure way is to copy data from userptr to MMAP buffer.
All you're talking about is related to userptr abuse that happened
on Embedded devices, of using it for something that were never
meant to be used (dev2dev).
While the DMABUF patches aren't applied, there's just one mode defined
at the V4L2 API for dev2dev: overlay mode[1].
Most embedded applications and drivers decided that, instead of using
overlay mode, to abuse of userptr to do dev2dev. As you've pointed,
it was noticed in practice that this sometimes fail.
Yes, such abuse should be dropped, and DMABUF is the right way to
address it.
That doesn't mean that USERPTR should be dropped for the thing it were
originally created: dev2user or user2dev.
Regards,
Mauro
[1] Even so, not all PC motherboards are capable of supporting the overlay mode:
it is known that several chipsets have problems on their DMA engines,
with causes data losses when a DMA transfer happens without passing through
the system main memory (PCI2PCI transfers). So, drivers check the PCI quirks
table to detect if dev2dev is supported, before exposing overlay mode to
userspace.
next prev parent reply other threads:[~2012-04-20 14:49 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 15:47 [PATCH v4 00/14] Integration of videobuf2 with dmabuf Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 01/14] v4l: Add DMABUF as a memory type Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 02/14] Documentation: media: description of DMABUF importing in V4L2 Tomasz Stanislawski
2012-04-16 23:25 ` Laurent Pinchart
2012-04-19 14:32 ` Tomasz Stanislawski
2012-04-19 20:36 ` Mauro Carvalho Chehab
2012-04-19 20:37 ` Mauro Carvalho Chehab
2012-04-20 8:41 ` Tomasz Stanislawski
2012-04-20 10:56 ` Rémi Denis-Courmont
2012-04-20 12:25 ` Tomasz Stanislawski
2012-04-20 13:03 ` Rémi Denis-Courmont
2012-04-21 17:10 ` Laurent Pinchart
2012-04-20 14:48 ` Mauro Carvalho Chehab [this message]
2012-04-20 13:36 ` Mauro Carvalho Chehab
2012-04-23 7:50 ` Marek Szyprowski
2012-04-23 14:00 ` Mauro Carvalho Chehab
2012-04-13 15:47 ` [PATCH v4 03/14] v4l: vb2: add support for shared buffer (dma_buf) Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 04/14] v4l: vb: remove warnings about MEMORY_DMABUF Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 05/14] v4l: vb2-dma-contig: Shorten vb2_dma_contig prefix to vb2_dc Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 06/14] v4l: vb2-dma-contig: Remove unneeded allocation context structure Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 07/14] v4l: vb2-dma-contig: Reorder functions Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 08/14] v4l: vb2-dma-contig: add support for scatterlist in userptr mode Tomasz Stanislawski
2012-04-17 0:43 ` Laurent Pinchart
2012-04-20 8:52 ` Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 09/14] v4l: vb2: add prepare/finish callbacks to allocators Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 10/14] v4l: vb2-dma-contig: add prepare/finish to dma-contig allocator Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 11/14] v4l: vb2-dma-contig: add support for dma_buf importing Tomasz Stanislawski
2012-04-17 0:57 ` Laurent Pinchart
2012-04-19 11:38 ` Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 12/14] v4l: vb2-dma-contig: change map/unmap behaviour for importers Tomasz Stanislawski
2012-04-17 1:03 ` Laurent Pinchart
2012-04-13 15:47 ` [PATCH v4 13/14] v4l: s5p-tv: mixer: support for dmabuf importing Tomasz Stanislawski
2012-04-13 15:47 ` [PATCH v4 14/14] v4l: fimc: " Tomasz Stanislawski
2012-04-20 12:56 ` Sylwester Nawrocki
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=4F917749.1080803@redhat.com \
--to=mchehab@redhat.com \
--cc=airlied@redhat.com \
--cc=daeinki@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pawel@osciak.com \
--cc=remi@remlab.net \
--cc=robdclark@gmail.com \
--cc=subashrp@gmail.com \
--cc=sumit.semwal@ti.com \
--cc=t.stanislaws@samsung.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).