On 1/24/19 6:49 AM, Tomasz Figa wrote:
> Hi Hans,
>
> On Wed, Jan 23, 2019 at 5:30 PM Hans Verkuil <[email protected]> wrote:
>>
>> There really is no reason why vb2_find_timestamp can't just find
>> buffers in any state. Drop that part of the test.
>>
>> This also means that vb->timestamp should only be set to 0 when a
>> capture buffer is queued AND when the driver doesn't copy timestamps.
>>
>> This change allows for more efficient pipelining (i.e. you can use
>> a buffer for a reference frame even when it is queued).
>>
>> Signed-off-by: Hans Verkuil <[email protected]>
>> ---
>> diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c
>> b/drivers/media/common/videobuf2/videobuf2-v4l2.c
>> index 75ea90e795d8..2a093bff0bf5 100644
>> --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
>> +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
>> @@ -567,7 +567,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb,
>> struct vb2_plane *planes)
>> struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
>> unsigned int plane;
>>
>> - if (!vb->vb2_queue->is_output || !vb->vb2_queue->copy_timestamp)
>> + if (!vb->vb2_queue->is_output && !vb->vb2_queue->copy_timestamp)
>
> Is the change fully as expected?
>
> Current behavior:
>
> COPY !COPY
> CAP 0 0
> OUT keep 0
>
> New behavior:
>
> COPY !COPY
> CAP keep 0
> OUT keep keep
>
> Don't we still want to zero OUT if !COPY? I suppose that would make
> the condition as simple as if (!vb->vb2_queue->copy_timestamp).
Ouch. Yes, you are completely correct. I'll make a new patch for this.
Regards,
Hans