Any buffer owned by the driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.
Change-Id: Idd2f3157ab5c0326c39e8d9160514ad6102301b6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
struct fimc_is_subdev *subdev,
struct fimc_is_video_ctx *vctx)
{
- int ret = 0;
+ struct vb2_queue *vbq = queue->vbq;
+ int ret, i;
BUG_ON(!queue);
BUG_ON(!device);
clear_bit(FIMC_IS_QUEUE_BUFFER_READY, &queue->state);
clear_bit(FIMC_IS_QUEUE_BUFFER_PREPARED, &queue->state);
+ /*
+ * Any buffers still owned by the driver will be released with the
+ * VB2_BUF_STATE_ERROR flag set.
+ */
+ for (i = 0; i < vbq->num_buffers; i++) {
+ if (vbq->bufs[i]->state == VB2_BUF_STATE_ACTIVE)
+ vb2_buffer_done(vbq->bufs[i], VB2_BUF_STATE_ERROR);
+ }
+
return ret;
}