bcm27xx: update patches from RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0496-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch
1 From b2ea711d2c21ec021de4ff09a0a2b5b4224f9749 Mon Sep 17 00:00:00 2001
2 From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
3 Date: Fri, 11 Oct 2019 06:32:42 -0300
4 Subject: [PATCH] media: videodev2.h: add V4L2_DEC_CMD_FLUSH
5
6 Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.
7
8 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
9 Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
10 Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
12 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
13 ---
14 Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 10 +++++++++-
15 Documentation/media/videodev2.h.rst.exceptions | 1 +
16 include/uapi/linux/videodev2.h | 1 +
17 3 files changed, 11 insertions(+), 1 deletion(-)
18
19 --- a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
20 +++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
21 @@ -208,7 +208,15 @@ introduced in Linux 3.3. They are, howev
22 been started yet, the driver will return an ``EPERM`` error code. When
23 the decoder is already running, this command does nothing. No
24 flags are defined for this command.
25 -
26 + * - ``V4L2_DEC_CMD_FLUSH``
27 + - 4
28 + - Flush any held capture buffers. Only valid for stateless decoders.
29 + This command is typically used when the application reached the
30 + end of the stream and the last output buffer had the
31 + ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
32 + dequeueing the capture buffer containing the last decoded frame.
33 + So this command can be used to explicitly flush that final decoded
34 + frame. This command does nothing if there are no held capture buffers.
35
36 Return Value
37 ============
38 --- a/Documentation/media/videodev2.h.rst.exceptions
39 +++ b/Documentation/media/videodev2.h.rst.exceptions
40 @@ -434,6 +434,7 @@ replace define V4L2_DEC_CMD_START decode
41 replace define V4L2_DEC_CMD_STOP decoder-cmds
42 replace define V4L2_DEC_CMD_PAUSE decoder-cmds
43 replace define V4L2_DEC_CMD_RESUME decoder-cmds
44 +replace define V4L2_DEC_CMD_FLUSH decoder-cmds
45
46 replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
47 replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
48 --- a/include/uapi/linux/videodev2.h
49 +++ b/include/uapi/linux/videodev2.h
50 @@ -1989,6 +1989,7 @@ struct v4l2_encoder_cmd {
51 #define V4L2_DEC_CMD_STOP (1)
52 #define V4L2_DEC_CMD_PAUSE (2)
53 #define V4L2_DEC_CMD_RESUME (3)
54 +#define V4L2_DEC_CMD_FLUSH (4)
55
56 /* Flags for V4L2_DEC_CMD_START */
57 #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)