lkml.org 
[lkml]   [2020]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCHv2 02/12] videobuf2: handle V4L2 buffer cache flags
From
Date
On 2/19/20 9:13 AM, Sergey Senozhatsky wrote:
> On (20/02/19 09:07), Hans Verkuil wrote:
> [..]
>>> +static void set_buffer_cache_hints(struct vb2_queue *q,
>>> + struct vb2_buffer *vb,
>>> + struct v4l2_buffer *b)
>>> +{
>>> + /*
>>> + * DMA exporter should take care of cache syncs, so we can avoid
>>> + * explicit ->prepare()/->finish() syncs. For other ->memory types
>>> + * we always need ->prepare() or/and ->finish() cache sync.
>>> + */
>>> + if (q->memory == VB2_MEMORY_DMABUF) {
>>> + vb->need_cache_sync_on_finish = 0;
>>> + vb->need_cache_sync_on_prepare = 0;
>>> + return;
>>> + }
>>> +
>>> + if (!q->allow_cache_hints)
>>> + return;
>>> +
>>> + vb->need_cache_sync_on_prepare = 1;
>>
>> This needs a comment explaining why prepare is set to 1 by default. I remember
>> we discussed this earlier, and the conclusion of that discussion needs to be
>> documented here in a comment.
>
> Please ignore this patch. There is a follow up which sets _both_
> flags by default. The purpose is to preserve the existing behaviour,
> we can do all sorts of incremental changes (clear flags in more cases,
> etc.) later on. Do you want me to document this in the code?

Yes please!

Regards,

Hans

>
> -ss
>

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