summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/venus/vdec.c
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2020-04-18 12:06:22 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-05 14:07:47 +0300
commit4470ff693833ad2cf06d4d07067b2e6a2458c6c1 (patch)
treee934cbca4dd3e637c833507723a3838a8912d360 /drivers/media/platform/qcom/venus/vdec.c
parent85872f861d4cc535b0dbfd0a9062bdbdcbed20c3 (diff)
downloadlinux-4470ff693833ad2cf06d4d07067b2e6a2458c6c1.tar.xz
media: venus: venc,vdec: Return EBUSY on S_FMT while streaming
According to the v4l spec s_fmt must return EBUSY while the particular queue is streaming. Add such check in encoder and decoder s_fmt methods. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/venus/vdec.c')
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 527944c822b5..7c4c483d5438 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -276,6 +276,14 @@ static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
const struct venus_format *fmt;
struct v4l2_format format;
u32 pixfmt_out = 0, pixfmt_cap = 0;
+ struct vb2_queue *q;
+
+ q = v4l2_m2m_get_vq(inst->m2m_ctx, f->type);
+ if (!q)
+ return -EINVAL;
+
+ if (vb2_is_busy(q))
+ return -EBUSY;
orig_pixmp = *pixmp;