Skip to content

Commit

Permalink
media: venus: venc,vdec: Return EBUSY on S_FMT while streaming
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanimir Varbanov authored and Mauro Carvalho Chehab committed May 5, 2020
1 parent 85872f8 commit 4470ff6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/media/platform/qcom/venus/vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions drivers/media/platform/qcom/venus/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,14 @@ static int venc_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;

Expand Down

0 comments on commit 4470ff6

Please sign in to comment.