Commit c6e4e2c4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: vb2: drop VB2_BUF_STATE_REQUEUEING

The last user of this state has been converted, so we can now drop
this. Requeueing causes the queue to become unordered, which causes
problems with requests and (in the future) fences.

Since it is no longer needed, just get rid of this.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 0cd25448
...@@ -915,8 +915,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -915,8 +915,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
if (WARN_ON(state != VB2_BUF_STATE_DONE && if (WARN_ON(state != VB2_BUF_STATE_DONE &&
state != VB2_BUF_STATE_ERROR && state != VB2_BUF_STATE_ERROR &&
state != VB2_BUF_STATE_QUEUED && state != VB2_BUF_STATE_QUEUED))
state != VB2_BUF_STATE_REQUEUEING))
state = VB2_BUF_STATE_ERROR; state = VB2_BUF_STATE_ERROR;
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
...@@ -929,8 +928,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -929,8 +928,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
dprintk(4, "done processing on buffer %d, state: %d\n", dprintk(4, "done processing on buffer %d, state: %d\n",
vb->index, state); vb->index, state);
if (state != VB2_BUF_STATE_QUEUED && if (state != VB2_BUF_STATE_QUEUED) {
state != VB2_BUF_STATE_REQUEUEING) {
/* sync buffers */ /* sync buffers */
for (plane = 0; plane < vb->num_planes; ++plane) for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, finish, vb->planes[plane].mem_priv); call_void_memop(vb, finish, vb->planes[plane].mem_priv);
...@@ -938,8 +936,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -938,8 +936,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
} }
spin_lock_irqsave(&q->done_lock, flags); spin_lock_irqsave(&q->done_lock, flags);
if (state == VB2_BUF_STATE_QUEUED || if (state == VB2_BUF_STATE_QUEUED) {
state == VB2_BUF_STATE_REQUEUEING) {
vb->state = VB2_BUF_STATE_QUEUED; vb->state = VB2_BUF_STATE_QUEUED;
} else { } else {
/* Add the buffer to the done buffers list */ /* Add the buffer to the done buffers list */
...@@ -949,8 +946,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -949,8 +946,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
atomic_dec(&q->owned_by_drv_count); atomic_dec(&q->owned_by_drv_count);
if (state != VB2_BUF_STATE_QUEUED && vb->req_obj.req) { if (state != VB2_BUF_STATE_QUEUED && vb->req_obj.req) {
/* This is not supported at the moment */
WARN_ON(state == VB2_BUF_STATE_REQUEUEING);
media_request_object_unbind(&vb->req_obj); media_request_object_unbind(&vb->req_obj);
media_request_object_put(&vb->req_obj); media_request_object_put(&vb->req_obj);
} }
...@@ -962,10 +957,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -962,10 +957,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
switch (state) { switch (state) {
case VB2_BUF_STATE_QUEUED: case VB2_BUF_STATE_QUEUED:
return; return;
case VB2_BUF_STATE_REQUEUEING:
if (q->start_streaming_called)
__enqueue_in_driver(vb);
return;
default: default:
/* Inform any processes that may be waiting for buffers */ /* Inform any processes that may be waiting for buffers */
wake_up(&q->done_wq); wake_up(&q->done_wq);
......
...@@ -543,7 +543,6 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) ...@@ -543,7 +543,6 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
break; break;
case VB2_BUF_STATE_PREPARING: case VB2_BUF_STATE_PREPARING:
case VB2_BUF_STATE_DEQUEUED: case VB2_BUF_STATE_DEQUEUED:
case VB2_BUF_STATE_REQUEUEING:
/* nothing */ /* nothing */
break; break;
} }
......
...@@ -207,7 +207,6 @@ enum vb2_io_modes { ...@@ -207,7 +207,6 @@ enum vb2_io_modes {
* @VB2_BUF_STATE_IN_REQUEST: buffer is queued in media request. * @VB2_BUF_STATE_IN_REQUEST: buffer is queued in media request.
* @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf. * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf.
* @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver. * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver.
* @VB2_BUF_STATE_REQUEUEING: re-queue a buffer to the driver.
* @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used
* in a hardware operation. * in a hardware operation.
* @VB2_BUF_STATE_DONE: buffer returned from driver to videobuf, but * @VB2_BUF_STATE_DONE: buffer returned from driver to videobuf, but
...@@ -221,7 +220,6 @@ enum vb2_buffer_state { ...@@ -221,7 +220,6 @@ enum vb2_buffer_state {
VB2_BUF_STATE_IN_REQUEST, VB2_BUF_STATE_IN_REQUEST,
VB2_BUF_STATE_PREPARING, VB2_BUF_STATE_PREPARING,
VB2_BUF_STATE_QUEUED, VB2_BUF_STATE_QUEUED,
VB2_BUF_STATE_REQUEUEING,
VB2_BUF_STATE_ACTIVE, VB2_BUF_STATE_ACTIVE,
VB2_BUF_STATE_DONE, VB2_BUF_STATE_DONE,
VB2_BUF_STATE_ERROR, VB2_BUF_STATE_ERROR,
...@@ -384,10 +382,10 @@ struct vb2_buffer { ...@@ -384,10 +382,10 @@ struct vb2_buffer {
* driver can return an error if hardware fails, in that * driver can return an error if hardware fails, in that
* case all buffers that have been already given by * case all buffers that have been already given by
* the @buf_queue callback are to be returned by the driver * the @buf_queue callback are to be returned by the driver
* by calling vb2_buffer_done() with %VB2_BUF_STATE_QUEUED * by calling vb2_buffer_done() with %VB2_BUF_STATE_QUEUED.
* or %VB2_BUF_STATE_REQUEUEING. If you need a minimum * If you need a minimum number of buffers before you can
* number of buffers before you can start streaming, then * start streaming, then set
* set &vb2_queue->min_buffers_needed. If that is non-zero * &vb2_queue->min_buffers_needed. If that is non-zero
* then @start_streaming won't be called until at least * then @start_streaming won't be called until at least
* that many buffers have been queued up by userspace. * that many buffers have been queued up by userspace.
* @stop_streaming: called when 'streaming' state must be disabled; driver * @stop_streaming: called when 'streaming' state must be disabled; driver
...@@ -648,9 +646,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no); ...@@ -648,9 +646,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no);
* @state: state of the buffer, as defined by &enum vb2_buffer_state. * @state: state of the buffer, as defined by &enum vb2_buffer_state.
* Either %VB2_BUF_STATE_DONE if the operation finished * Either %VB2_BUF_STATE_DONE if the operation finished
* successfully, %VB2_BUF_STATE_ERROR if the operation finished * successfully, %VB2_BUF_STATE_ERROR if the operation finished
* with an error or any of %VB2_BUF_STATE_QUEUED or * with an error or %VB2_BUF_STATE_QUEUED.
* %VB2_BUF_STATE_REQUEUEING if the driver wants to
* requeue buffers (see below).
* *
* This function should be called by the driver after a hardware operation on * This function should be called by the driver after a hardware operation on
* a buffer is finished and the buffer may be returned to userspace. The driver * a buffer is finished and the buffer may be returned to userspace. The driver
...@@ -661,12 +657,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no); ...@@ -661,12 +657,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no);
* While streaming a buffer can only be returned in state DONE or ERROR. * While streaming a buffer can only be returned in state DONE or ERROR.
* The &vb2_ops->start_streaming op can also return them in case the DMA engine * The &vb2_ops->start_streaming op can also return them in case the DMA engine
* cannot be started for some reason. In that case the buffers should be * cannot be started for some reason. In that case the buffers should be
* returned with state QUEUED or REQUEUEING to put them back into the queue. * returned with state QUEUED to put them back into the queue.
*
* %VB2_BUF_STATE_REQUEUEING is like %VB2_BUF_STATE_QUEUED, but it also calls
* &vb2_ops->buf_queue to queue buffers back to the driver. Note that calling
* vb2_buffer_done(..., VB2_BUF_STATE_REQUEUEING) from interrupt context will
* result in &vb2_ops->buf_queue being called in interrupt context as well.
*/ */
void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state); void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment