Re: [RFC 03/10] [media] vb2: add in-fence support to QBUF

Javier Martinez Canillas
2017-04-03T18:27:50Z

Hello Gustavo,

On 03/13/2017 04:20 PM, Gustavo Padovan wrote:

[snip]

>
> int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
> {
> + struct dma_fence *fence = NULL;
> int ret;
>
> if (vb2_fileio_is_active(q)) {
> @@ -565,7 +567,17 @@ int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
> }
>
> ret = vb2_queue_or_prepare_buf(q, b, "qbuf");
> - return ret ? ret : vb2_core_qbuf(q, b->index, b);
> +
> + if (b->flags & V4L2_BUF_FLAG_IN_FENCE) {
> + if (b->memory != VB2_MEMORY_DMABUF)
> + return -EINVAL;
> +

I wonder if is correct to check this. Only one side of the pipeline uses
V4L2_MEMORY_DMABUF while the other uses V4L2_MEMORY_MMAP + VIDIOC_EXPBUF.

So that means that fences can only be used in one direction?

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America