OSDN Git Service

media: mtk-vcodec: use v4l2_m2m_buffer where appropriate
authorAlexandre Courbot <acourbot@chromium.org>
Tue, 7 Jan 2020 09:44:48 +0000 (10:44 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 9 Jan 2020 13:46:41 +0000 (14:46 +0100)
commitbaf98b0ad304e1959222c51b9ffc5c8f85865ca0
tree8eb476002c50fb20f1dc8ce9bfb515b9ac6b740c
parentb0e4cfae483fe1e3db71ab2d8509490df60e52c6
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>
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h