diff options
author | 2020-01-07 10:44:48 +0100 | |
---|---|---|
committer | 2020-01-09 14:46:41 +0100 | |
commit | baf98b0ad304e1959222c51b9ffc5c8f85865ca0 (patch) | |
tree | 8eb476002c50fb20f1dc8ce9bfb515b9ac6b740c /drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | |
parent | media: davinci/vpfe_capture.c: Avoid BUG_ON for register failure (diff) | |
download | linux-dev-baf98b0ad304e1959222c51b9ffc5c8f85865ca0.tar.xz linux-dev-baf98b0ad304e1959222c51b9ffc5c8f85865ca0.zip |
media: mtk-vcodec: use v4l2_m2m_buffer where appropriate
Despite using M2M in both the decoder and encoder, this driver used
vb2_v4l2_buffer as its base buffer structure, and placed a list_head
right after the buffer declaration in order to match the layout of a
v4l2_m2m_buffer. This is very dangerous as it means the driver will
break should the layout of v4l2_m2m_buffer change.
Fix this by directly using v4l2_m2m_buffer and updating the sites that
accessed the buffer accordingly.
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fix checkpatch warning]
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c')
-rw-r--r-- | drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index 944771ee5f5c..100ae8c5e702 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -137,7 +137,7 @@ static int fops_vcodec_open(struct file *file) } src_vq = v4l2_m2m_get_vq(ctx->m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE); - ctx->empty_flush_buf->vb.vb2_buf.vb2_queue = src_vq; + ctx->empty_flush_buf->m2m_buf.vb.vb2_buf.vb2_queue = src_vq; ctx->empty_flush_buf->lastframe = true; mtk_vcodec_dec_set_default_params(ctx); |