hantro: Move hantro_enc_buf_finish to JPEG codec_ops.done
authorEzequiel Garcia <ezequiel@collabora.com>
Wed, 1 Jul 2020 13:16:05 +0000 (15:16 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 19 Jul 2020 11:25:22 +0000 (13:25 +0200)
commite765dba11ec26d7ea42974ec4d470b5ce00be3de
tree2a1329c8dff5f4a0a5b1791d9fbd1ca0bcfea9ad
parent21f0315b7b3ee6ca909d81a963744671fb27bf71
hantro: Move hantro_enc_buf_finish to JPEG codec_ops.done

hantro_enc_buf_finish is used only for JPEG, and so should
be moved to JPEG codec_ops.done.

This cleanup is also taking care of addressing
a subtle issue: checking the non-NULL bounce buffer
using ctx->jpeg_enc, which is a member of a union is
confusing and error-prone.

Note that the issue is currently innocuous because an
encoder context only supports JPEG.

The codec_ops.done has an argument that codec-specific code
shouldn't need, so drop that as well.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/hantro/hantro.h
drivers/staging/media/hantro/hantro_drv.c
drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
drivers/staging/media/hantro/hantro_hw.h
drivers/staging/media/hantro/rk3288_vpu_hw.c