lkml.org 
[lkml]   [2017]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF
Em Fri, 17 Nov 2017 15:49:23 +0900
Alexandre Courbot <acourbot@chromium.org> escreveu:

> > @@ -178,6 +179,12 @@ static int vb2_queue_or_prepare_buf(struct
> > vb2_queue *q, struct v4l2_buffer *b,
> > return -EINVAL;
> > }
> >
> > + if ((b->fence_fd != 0 && b->fence_fd != -1) &&
>
> Why do we need to consider both values invalid? Can 0 ever be a valid fence
> fd?

Programs that don't use fences will initialize reserved2/fence_fd field
at the uAPI call to zero.

So, I guess using fd=0 here could be a problem. Anyway, I would, instead,
do:

if ((b->fence_fd < 1) &&
...

as other negative values are likely invalid as well.

--
Thanks,
Mauro

\
 
 \ /
  Last update: 2017-11-17 17:19    [W:0.138 / U:2.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site