lkml.org 
[lkml]   [2020]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCHv2 05/12] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT flag
On (20/02/19 09:48), Hans Verkuil wrote:
[..]
> > int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
> > {
> > int ret = vb2_verify_memory_type(q, req->memory, req->type);
> > + bool consistent = true;
> > +
> > + if (req->flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
> > + consistent = false;
>
> There is no check against allow_cache_hints: if that's 0, then
> the V4L2_FLAG_MEMORY_NON_CONSISTENT flag should be cleared since it is
> not supported.

The check is in set_queue_consistency()

static void set_queue_consistency(struct vb2_queue *q, bool consistent_mem)
{
if (!q->allow_cache_hints)
return;

if (consistent_mem)
q->dma_attrs &= ~DMA_ATTR_NON_CONSISTENT;
else
q->dma_attrs |= DMA_ATTR_NON_CONSISTENT;
}

I don't explicitly clear DMA_ATTR_NON_CONSISTENT attr for
!->allow_cache_hints queues just in case if the driver for
some reason sets that flag. ->allow_cache_hints is, thus,
only for cases when user-space asks us to set or clear it.

-ss

\
 
 \ /
  Last update: 2020-02-19 10:05    [W:0.576 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site