media: s5p-mfc: Fix to handle reference queue during finishing
authorSmitha T Murthy <smitha.t@samsung.com>
Wed, 7 Sep 2022 10:32:27 +0000 (16:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:40 +0000 (11:11 +0100)
commitbff2698aab6f9b691e1e19adc4ca73e4149c8256
tree9baad15a39344426638da72355b3cfa56aebd6f3
parent67ffc6dc3002572fa2bd982d95736b08b3ee18e0
media: s5p-mfc: Fix to handle reference queue during finishing

commit d8a46bc4e1e0446459daa77c4ce14218d32dacf9 upstream.

On receiving last buffer driver puts MFC to MFCINST_FINISHING state which
in turn skips transferring of frame from SRC to REF queue. This causes
driver to stop MFC encoding and last frame is lost.

This patch guarantees safe handling of frames during MFCINST_FINISHING and
correct clearing of workbit to avoid early stopping of encoding.

Fixes: af9357467810 ("[media] MFC: Add MFC 5.1 V4L2 driver")

Cc: stable@vger.kernel.org
Cc: linux-fsd@tesla.com
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c