770b00b88a1353e3c18e3953a40f0a6b9b32cf37
[openwrt/staging/ldir.git] /
1 From 4f745137c92902f4f541ebe5e458dd2c4e89a42d Mon Sep 17 00:00:00 2001
2 From: David Plowman <david.plowman@raspberrypi.com>
3 Date: Thu, 28 May 2020 11:09:48 +0100
4 Subject: [PATCH] media: bcm2835-unicam: change minimum number of
5 vb2_queue buffers to 1
6
7 Since the unicam driver was modified to write to a dummy buffer when no
8 user-supplied buffer is available, it can now write to and return a
9 buffer even when there's only a single one. Enable this by changing the
10 min_buffers_needed in the vb2_queue; it will be useful for enabling
11 still captures without allocating more memory than absolutely necessary.
12
13 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
14 ---
15 drivers/media/platform/bcm2835/bcm2835-unicam.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
19 +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
20 @@ -2387,7 +2387,7 @@ static int register_node(struct unicam_d
21 q->buf_struct_size = sizeof(struct unicam_buffer);
22 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
23 q->lock = &node->lock;
24 - q->min_buffers_needed = 2;
25 + q->min_buffers_needed = 1;
26 q->dev = &unicam->pdev->dev;
27
28 ret = vb2_queue_init(q);