lkml.org 
[lkml]   [2020]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM
From
Date
Hi Daniel,

On 03.10.2020 11:40, Daniel Vetter wrote:
>> After he three places above should use pin_user_pages_fast(), then
>> this whole broken API should be moved into videobuf2-memops.c and a
>> big fat "THIS DOESN'T WORK" stuck on it.
>>
>> videobuf2 should probably use P2P DMA buf for this instead.
> Yup this should be done with dma_buf instead, and v4l has that.

Yes, V4L2 has dma_buf support NOW. That days, using so called V4L2
USERPTR method was the only way to achieve zero copy buffer sharing
between devices, so this is just a historical baggage. I've been
actively involved in implementing that. I've tried to make it secure as
much as possible assuming the limitation of that approach. With a few
assumptions it works fine. Buffers are refcounted both by the
vm_ops->open or by incrementing the refcount of the vm->file. This
basically works with any sane driver, which doesn't free the mmaped
buffer until the file is released. This is true for V4L2 and FBdev devices.

This API is considered as deprecated in V4L2 world, so I think
supporting this hack can be removed one day as nowadays userspace should
use dma buf.

> ...

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

\
 
 \ /
  Last update: 2020-10-07 12:48    [W:0.139 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site