Re: [PATCHv3 7/8] videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag

Sergey Senozhatsky
2021-07-26T01:40:22Z

On (21/07/22 19:33), Dafna Hirschfeld wrote:
[..]
> > int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
> > {
> > int ret = vb2_verify_memory_type(q, req->memory, req->type);
> > + u32 flags = req->flags;
> > fill_buf_caps(q, &req->capabilities);
> > - return ret ? ret : vb2_core_reqbufs(q, req->memory, 0, &req->count);
> > + validate_memory_flags(q, req->memory, &flags);
> > + req->flags = flags;
>
> you can do instead
>
> validate_memory_flags(q, req->memory, &req->flags);

->flags are u32 for create-bufs and u8 for reqi-bufs. So `*flags = <value>`
can write to ->reserved[] for req-bufs (if the value is huge enough).