]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: mtk-vcodec: make flush buffer reusable by encoder
authorAlexandre Courbot <acourbot@chromium.org>
Fri, 6 Aug 2021 04:15:20 +0000 (06:15 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 12 Aug 2021 13:44:23 +0000 (15:44 +0200)
commit3f6d11fd8b7b0cc2d36f2f9bb0bf0d0cf1e2d80b
tree8675e511207b8dd508bb164120139b9fdc9e1704
parentdfeef202b699f3e2a8ff4d0c0a05bbb6a203a470
media: mtk-vcodec: make flush buffer reusable by encoder

The flush buffer is a special buffer that tells the decoder driver to
send an empty CAPTURE frame to the client with V4L2_BUF_FLAG_LAST set.

We need similar functionality for the encoder ; however currently the
flush buffer depends on decoder-specific structures and thus cannot be
reused with the encoder.

Fix this by testing for this buffer by its VB2 address, and not through
a dedicated flag stored in a higher-level decoder structure. This also
allows us to remove said flag and simplify the code a bit.

Since the flush buffer should never be used in the stateless decoder,
also add safeguards to check against it.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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_drv.h