Re: [PATCHv4 04/11] videobuf2: add queue memory consistency parameter

From: Ezequiel Garcia
Date: Tue Mar 24 2020 - 06:17:16 EST


On Tue, 2020-03-24 at 11:39 +0900, Sergey Senozhatsky wrote:
> On (20/03/20 14:46), Dafna Hirschfeld wrote:
> [..]
> > > +static void set_queue_consistency(struct vb2_queue *q, bool consistent_mem)
> > > +{
> > > + if (!vb2_queue_allows_cache_hints(q))
> > > + return;
> > > +
> > > + if (consistent_mem)
> > > + q->dma_attrs &= ~DMA_ATTR_NON_CONSISTENT;
> > > + else
> > > + q->dma_attrs |= DMA_ATTR_NON_CONSISTENT;
> > > +}
> > > +
> > > int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
> > > - unsigned int *count)
> > > + bool consistent_mem, unsigned int *count)
> > You extended the vb2_core_reqbufs accepting a new boolean that
> > is decided according to the setting of the V4L2_FLAG_MEMORY_NON_CONSISTENT
> > but in the future some other flags might be added, and so I think it
> > is better to replace the boolean with a u32 consisting of all the flags.
>
> Don't have any objections. Can change the `bool' to `u32'.
>

or maybe an enum instead? That would help get a cleaner
interface.

Thanks,
Ezequiel