lkml.org 
[lkml]   [2019]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/8] media: cedrus: Add support for V4L2_DEC_CMD_FLUSH
On Thu, 22 Aug 2019 21:45:00 +0200
Jernej Skrabec <jernej.skrabec@siol.net> wrote:

> This command is useful for explicitly flushing last decoded frame.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
> .../staging/media/sunxi/cedrus/cedrus_video.c | 34 +++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index 5153b2bba21e..9eae69d5741c 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -331,6 +331,37 @@ static int cedrus_s_fmt_vid_out(struct file *file, void *priv,
> return 0;
> }
>
> +static int cedrus_try_decoder_cmd(struct file *file, void *fh,
> + struct v4l2_decoder_cmd *dc)
> +{
> + if (dc->cmd != V4L2_DEC_CMD_FLUSH)
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static int cedrus_decoder_cmd(struct file *file, void *fh,
> + struct v4l2_decoder_cmd *dc)
> +{
> + struct cedrus_ctx *ctx = cedrus_file2ctx(file);
> + struct vb2_v4l2_buffer *out_vb, *cap_vb;
> + int ret;
> +
> + ret = cedrus_try_decoder_cmd(file, fh, dc);
> + if (ret < 0)
> + return ret;

Not directly related to this patch, but it seems most drivers
implementing ->vdioc_decoder_cmd() call ->vidioc_try_decoder_cmd()
internally to make sure the cmd is supported. Maybe something
we could automate at the v4l2-ioctl.c level.


\
 
 \ /
  Last update: 2019-08-26 20:56    [W:0.150 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site