lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 06/15] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT in CREATE_BUFS
On (20/01/10 10:59), Hans Verkuil wrote:
[..]
> >
> > num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);
> > diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> > index 0eabb589684f..48d123a1ac2a 100644
> > --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
> > +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> > @@ -730,6 +730,7 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
> > unsigned requested_sizes[VIDEO_MAX_PLANES];
> > struct v4l2_format *f = &create->format;
> > int ret = vb2_verify_memory_type(q, create->memory, f->type);
> > + bool consistent = true;
> > unsigned i;
> >
> > fill_buf_caps(q, &create->capabilities);
> > @@ -775,7 +776,11 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
> > for (i = 0; i < requested_planes; i++)
> > if (requested_sizes[i] == 0)
> > return -EINVAL;
> > - return ret ? ret : vb2_core_create_bufs(q, create->memory,
> > +
> > + if (create->flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
> > + consistent = false;
> > +
> > + return ret ? ret : vb2_core_create_bufs(q, create->memory, consistent,
> > &create->count, requested_planes, requested_sizes);
>
> As mentioned before: we need a V4L2_BUF_CAP capability.

I can add V4L2_BUF_CAP for memory consistency. Isn't it just q->memory
property though? User space may request MMAP consistent memory or MMAP
inconsistent memory.

-ss

\
 
 \ /
  Last update: 2020-01-23 04:42    [W:0.094 / U:3.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site