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

Sergey Senozhatsky
2021-07-26T04:06:06Z

On (21/07/26 10:40), Sergey Senozhatsky wrote:
> 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).

I guess ->flags can become u8 for both create-bufs and req-bufs.
We had ->flags in both structs as u32, but then decided to leave
some reserved[] space in req-bufs and switched to u8 there.