diff options
author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2019-06-27 14:09:34 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-05 15:57:28 +0200 |
commit | 059790467bf4a75441615c69e5efd2b4bac3cba4 (patch) | |
tree | 68c11966a97693c5d56da7780501d9c284bdf23c /drivers/media/platform | |
parent | media: venus: make decoder compliant with stateful codec API (diff) | |
download | linux-059790467bf4a75441615c69e5efd2b4bac3cba4.tar.xz linux-059790467bf4a75441615c69e5efd2b4bac3cba4.zip |
media: venus: helpers: handle correctly vbuf field
Correct handling of OUTPUT buffers field and make v4l2-compliance
happy.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/qcom/venus/helpers.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 176facdd415d..c948c4e809b5 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -998,6 +998,17 @@ int venus_helper_vb2_buf_prepare(struct vb2_buffer *vb) { struct venus_inst *inst = vb2_get_drv_priv(vb->vb2_queue); unsigned int out_buf_size = venus_helper_get_opb_size(inst); + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); + + if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) { + if (vbuf->field == V4L2_FIELD_ANY) + vbuf->field = V4L2_FIELD_NONE; + if (vbuf->field != V4L2_FIELD_NONE) { + dev_err(inst->core->dev, "%s field isn't supported\n", + __func__); + return -EINVAL; + } + } if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && vb2_plane_size(vb, 0) < out_buf_size) |