Commit f66a607d authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 60c74167
...@@ -1001,13 +1001,7 @@ static int coda_try_encoder_cmd(struct file *file, void *fh, ...@@ -1001,13 +1001,7 @@ static int coda_try_encoder_cmd(struct file *file, void *fh,
if (ctx->inst_type != CODA_INST_ENCODER) if (ctx->inst_type != CODA_INST_ENCODER)
return -ENOTTY; return -ENOTTY;
if (ec->cmd != V4L2_ENC_CMD_STOP) return v4l2_m2m_ioctl_try_encoder_cmd(file, fh, ec);
return -EINVAL;
if (ec->flags & V4L2_ENC_CMD_STOP_AT_GOP_END)
return -EINVAL;
return 0;
} }
static int coda_encoder_cmd(struct file *file, void *fh, 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, ...@@ -1043,16 +1037,7 @@ static int coda_try_decoder_cmd(struct file *file, void *fh,
if (ctx->inst_type != CODA_INST_DECODER) if (ctx->inst_type != CODA_INST_DECODER)
return -ENOTTY; return -ENOTTY;
if (dc->cmd != V4L2_DEC_CMD_STOP) return v4l2_m2m_ioctl_try_decoder_cmd(file, fh, dc);
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;
} }
static int coda_decoder_cmd(struct file *file, void *fh, static int coda_decoder_cmd(struct file *file, void *fh,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment