firmware-utils: bump to git HEAD
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0975-staging-bcm2835-codec-Use-a-define-the-completion-ti.patch
1 From 7ad713e695d67b78b3cb69927d099a29593444b1 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 30 Sep 2020 12:12:32 +0100
4 Subject: [PATCH] staging: bcm2835-codec: Use a define the completion
5 timeout
6
7 Hiding a use of "HZ" as a timeout is a little nasty.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
10 ---
11 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 6 +++++-
12 1 file changed, 5 insertions(+), 1 deletion(-)
13
14 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
15 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
16 @@ -89,6 +89,9 @@ static const char * const components[] =
17 "ril.isp",
18 };
19
20 +/* Timeout for stop_streaming to allow all buffers to return */
21 +#define COMPLETE_TIMEOUT (2 * HZ)
22 +
23 #define MIN_W 32
24 #define MIN_H 32
25 #define MAX_W 1920
26 @@ -2366,7 +2369,8 @@ static void bcm2835_codec_stop_streaming
27 while (atomic_read(&port->buffers_with_vpu)) {
28 v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Waiting for buffers to be returned - %d outstanding\n",
29 __func__, atomic_read(&port->buffers_with_vpu));
30 - ret = wait_for_completion_timeout(&ctx->frame_cmplt, HZ);
31 + ret = wait_for_completion_timeout(&ctx->frame_cmplt,
32 + COMPLETE_TIMEOUT);
33 if (ret <= 0) {
34 v4l2_err(&ctx->dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n",
35 __func__,