Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: hantro: Simplify postprocessor

Add a 'postprocessed' boolean property to struct hantro_fmt
to signal that a format is produced by the post-processor.
This will allow to introduce the G2 post-processor in a simple way.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Ezequiel Garcia and committed by
Mauro Carvalho Chehab
53a3e710 04dad52e

+6 -7
+2
drivers/staging/media/hantro/hantro.h
··· 263 263 * @max_depth: Maximum depth, for bitstream formats 264 264 * @enc_fmt: Format identifier for encoder registers. 265 265 * @frmsize: Supported range of frame sizes (only for bitstream formats). 266 + * @postprocessed: Indicates if this format needs the post-processor. 266 267 */ 267 268 struct hantro_fmt { 268 269 char *name; ··· 273 272 int max_depth; 274 273 enum hantro_enc_fmt enc_fmt; 275 274 struct v4l2_frmsize_stepwise frmsize; 275 + bool postprocessed; 276 276 }; 277 277 278 278 struct hantro_reg {
+1 -7
drivers/staging/media/hantro/hantro_postproc.c
··· 53 53 bool hantro_needs_postproc(const struct hantro_ctx *ctx, 54 54 const struct hantro_fmt *fmt) 55 55 { 56 - struct hantro_dev *vpu = ctx->dev; 57 - 58 56 if (ctx->is_encoder) 59 57 return false; 60 - 61 - if (!vpu->variant->postproc_fmts) 62 - return false; 63 - 64 - return fmt->fourcc != V4L2_PIX_FMT_NV12; 58 + return fmt->postprocessed; 65 59 } 66 60 67 61 static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
+1
drivers/staging/media/hantro/imx8m_vpu_hw.c
··· 82 82 { 83 83 .fourcc = V4L2_PIX_FMT_YUYV, 84 84 .codec_mode = HANTRO_MODE_NONE, 85 + .postprocessed = true, 85 86 }, 86 87 }; 87 88
+1
drivers/staging/media/hantro/rockchip_vpu_hw.c
··· 62 62 { 63 63 .fourcc = V4L2_PIX_FMT_YUYV, 64 64 .codec_mode = HANTRO_MODE_NONE, 65 + .postprocessed = true, 65 66 }, 66 67 }; 67 68
+1
drivers/staging/media/hantro/sama5d4_vdec_hw.c
··· 15 15 { 16 16 .fourcc = V4L2_PIX_FMT_YUYV, 17 17 .codec_mode = HANTRO_MODE_NONE, 18 + .postprocessed = true, 18 19 }, 19 20 }; 20 21