Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79aeb3f3 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] vb2: return ENOBUFS in start_streaming in case of too few buffers



This works together with the retry_start_streaming mechanism to allow userspace
to start streaming even if not all required buffers have been queued.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarKamil Debski <k.debski@samsung.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent c108e660
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count)
	/* If buffer queue is empty, return error */
	if (list_empty(&layer->dma_queue)) {
		v4l2_err(&vpbe_dev->v4l2_dev, "buffer queue is empty\n");
		return -EINVAL;
		return -ENOBUFS;
	}
	/* Get the next frame from the buffer queue */
	layer->next_frm = layer->cur_frm = list_entry(layer->dma_queue.next,
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
	if (list_empty(&common->dma_queue)) {
		spin_unlock_irqrestore(&common->irqlock, flags);
		vpif_dbg(1, debug, "buffer queue is empty\n");
		return -EIO;
		return -ENOBUFS;
	}

	/* Get the next frame from the buffer queue */
+1 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
	if (list_empty(&common->dma_queue)) {
		spin_unlock_irqrestore(&common->irqlock, flags);
		vpif_err("buffer queue is empty\n");
		return -EIO;
		return -ENOBUFS;
	}

	/* Get the next frame from the buffer queue */
+1 −1
Original line number Diff line number Diff line
@@ -1863,7 +1863,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
		if (ctx->src_bufs_cnt < ctx->pb_count) {
			mfc_err("Need minimum %d OUTPUT buffers\n",
					ctx->pb_count);
			return -EINVAL;
			return -ENOBUFS;
		}
	}

+1 −1
Original line number Diff line number Diff line
@@ -948,7 +948,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)

	if (count == 0) {
		mxr_dbg(mdev, "no output buffers queued\n");
		return -EINVAL;
		return -ENOBUFS;
	}

	/* block any changes in output configuration */
Loading