Messages in this thread | | | Date | Fri, 28 Feb 2020 10:20:42 +0900 | From | Sergey Senozhatsky <> | Subject | Re: [PATCHv3 02/11] videobuf2: handle V4L2 buffer cache flags |
| |
On (20/02/27 12:58), Hans Verkuil wrote: [..] > > There are two possible alternative approaches: > > - The first one is to move cache sync from ->finish() to dqbuf(). > > But this breaks some drivers, that need to fix-up buffers before > > dequeueing them. > > > > - The second one is to move ->finish() call from ->done() to dqbuf. > > It's not clear what the purpose is of describing these alternative approaches. > I'd just drop that. It's a bit confusing.
OK.
> > +/** > > + * vb2_queue_allows_cache_hints() - Return true if the queue allows cache > > + * and memory consistency hints. > > + * > > + * @q: pointer to &struct vb2_queue with videobuf2 queue > > + */ > > +static inline bool vb2_queue_allows_cache_hints(struct vb2_queue *q) > > +{ > > + return (q->allow_cache_hints != 0) && (q->memory == VB2_MEMORY_MMAP); > > Simply to: > > return q->allow_cache_hints && q->memory == VB2_MEMORY_MMAP; >
OK. I saw vb2_is_busy()
static inline bool vb2_is_busy(struct vb2_queue *q) { return (q->num_buffers > 0); }
in the very same header file and concluded that maybe this is the preferred style.
-ss
| |