aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-08-07 13:25:37 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-08-18 16:20:57 +0200
commita007e0ef14bcb8795a72ed8b217639788a66a89a (patch)
treed363df79b5a8dd5093b98ad35bd2ff8e129426ae
parentc9b76c839a0fe467f9b4cd54dcf77e1e8e4aa8ca (diff)
vim2m: support read-only requests on the capture queue
Added support for read-only requests on the capture queue in order to test this feature. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/test-drivers/vim2m.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/test-drivers/vim2m.c b/drivers/media/test-drivers/vim2m.c
index b73de65c0006..7c738b9fd637 100644
--- a/drivers/media/test-drivers/vim2m.c
+++ b/drivers/media/test-drivers/vim2m.c
@@ -602,7 +602,11 @@ static void device_run(void *priv)
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
- /* Apply request controls if any */
+ /*
+ * Apply request controls if any.
+ * The dst_buf queue has read-only requests, so no need to
+ * setup any controls for that buffer.
+ */
v4l2_ctrl_request_setup(src_buf->vb2_buf.req_obj.req,
&ctx->hdl);
@@ -611,6 +615,8 @@ static void device_run(void *priv)
/* Complete request controls if any */
v4l2_ctrl_request_complete(src_buf->vb2_buf.req_obj.req,
&ctx->hdl);
+ v4l2_ctrl_request_complete(dst_buf->vb2_buf.req_obj.req,
+ &ctx->hdl);
/* Run delayed work, which simulates a hardware irq */
schedule_delayed_work(&ctx->work_run, msecs_to_jiffies(ctx->transtime));
@@ -1143,6 +1149,8 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
dst_vq->mem_ops = &vb2_vmalloc_memops;
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
dst_vq->lock = &ctx->vb_mutex;
+ dst_vq->supports_requests = true;
+ dst_vq->supports_ro_requests = true;
return vb2_queue_init(dst_vq);
}

Privacy Policy