[PATCH v4 02/14] Documentation: media: description of DMABUF importing in V4L2
remi at remlab.net
Fri Apr 20 03:56:53 PDT 2012
On Fri, 20 Apr 2012 10:41:37 +0200, Tomasz Stanislawski
<t.stanislaws at samsung.com> wrote:
>> Am I understanding wrong or are you saying that you want to drop
>> from V4L2 API in long-term? If so, why?
> Dropping userptr is just some brainstorming idea.
> It was found out that userptr is not a good mean
> for buffer exchange between to two devices.
I can believe that. But I am also inclined to believe that DMABUF is
targetted at device-to-device transfer, while USERPTR is targetted at
device-to-user (or user-to-device) transfers. Are you saying applications
should use DMABUF and memory map the buffers? Or would you care to explain
how DMABUF addresses the problem space of USERPTR?
> The USERPTR simplifies userspace code but introduce
> a lot of complexity problems for the kernel drivers
> and frameworks.
It is not only a simplification. In some cases, USERPTR is the only I/O
method that supports zero copy in pretty much any circumstance. When the
user cannot reliably predict the maximum number of required buffers,
predicts a value larger than the device will negotiate, or needs buffers to
outlive STREAMOFF (?), MMAP requires memory copying. USERPTR does not.
Now, I do realize that some devices cannot support USERPTR efficiently,
then they should not support USERPTR. But for those devices that can, it
seems quite a nice performance enhancement.
Sent from my collocated server
More information about the dri-devel