aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2019-06-18 12:45:09 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-24 14:16:05 -0400
commitf66a607d73389263694c9d597bcf8d36ffe3b12d (patch)
treed8dd4c802740a7a9ff5782d103bc3490d5bdbbd8 /drivers/media
parentmedia: coda: implement CMD_START to restart decoding (diff)
downloadlinux-dev-f66a607d73389263694c9d597bcf8d36ffe3b12d.tar.xz
linux-dev-f66a607d73389263694c9d597bcf8d36ffe3b12d.zip
media: coda: use mem2mem try_en/decoder_cmd helpers
Use mem2mem try_en/decoder_cmd helpers to ensure consistent behaviour with other video codec drivers. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/coda/coda-common.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index c7dcab4d1f6c..8347169fadc0 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1001,13 +1001,7 @@ static int coda_try_encoder_cmd(struct file *file, void *fh,
if (ctx->inst_type != CODA_INST_ENCODER)
return -ENOTTY;
- if (ec->cmd != V4L2_ENC_CMD_STOP)
- return -EINVAL;
-
- if (ec->flags & V4L2_ENC_CMD_STOP_AT_GOP_END)
- return -EINVAL;
-
- return 0;
+ return v4l2_m2m_ioctl_try_encoder_cmd(file, fh, ec);
}
static int coda_encoder_cmd(struct file *file, void *fh,
@@ -1043,16 +1037,7 @@ static int coda_try_decoder_cmd(struct file *file, void *fh,
if (ctx->inst_type != CODA_INST_DECODER)
return -ENOTTY;
- if (dc->cmd != V4L2_DEC_CMD_STOP)
- return -EINVAL;
-
- if (dc->flags & V4L2_DEC_CMD_STOP_TO_BLACK)
- return -EINVAL;
-
- if (!(dc->flags & V4L2_DEC_CMD_STOP_IMMEDIATELY) && (dc->stop.pts != 0))
- return -EINVAL;
-
- return 0;
+ return v4l2_m2m_ioctl_try_decoder_cmd(file, fh, dc);
}
static int coda_decoder_cmd(struct file *file, void *fh,