History

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.

Ezequiel Garcia committed 4 years ago

Commit 53a3e711 parent 04dad525 files · +6 −7Browse files

Unified · Split

5 files
  1. drivers/staging/media/hantro/hantro.h +2 −0
  2. drivers/staging/media/hantro/hantro_postproc.c +1 −7
  3. drivers/staging/media/hantro/imx8m_vpu_hw.c +1 −0
  4. drivers/staging/media/hantro/rockchip_vpu_hw.c +1 −0
  5. drivers/staging/media/hantro/sama5d4_vdec_hw.c +1 −0
drivers/staging/media/hantro/hantro.h+2−0
@@ -263,6 +263,7 @@ struct hantro_ctx { · 262 unmodified lines
263263 * @max_depth: Maximum depth, for bitstream formats
264264 * @enc_fmt: Format identifier for encoder registers.
265265 * @frmsize: Supported range of frame sizes (only for bitstream formats).
266+ * @postprocessed: Indicates if this format needs the post-processor.
266267 */
267268 struct hantro_fmt {
268269 char *name;
@@ -272,6 +273,7 @@ struct hantro_fmt { · 3 unmodified lines
272273 int max_depth;
273274 enum hantro_enc_fmt enc_fmt;
274275 struct v4l2_frmsize_stepwise frmsize;
276+ bool postprocessed;
275277 };
276278
277279 struct hantro_reg {
drivers/staging/media/hantro/hantro_postproc.c+1−7
@@ -53,15 +53,9 @@ const struct hantro_postproc_regs hantro_g1_postproc_regs = { · 52 unmodified lines
5353 bool hantro_needs_postproc(const struct hantro_ctx *ctx,
5454 const struct hantro_fmt *fmt)
5555 {
56− struct hantro_dev *vpu = ctx->dev;
57−
5856 if (ctx->is_encoder)
5957 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;
6559 }
6660
6761 static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
drivers/staging/media/hantro/imx8m_vpu_hw.c+1−0
@@ -82,6 +82,7 @@ static const struct hantro_fmt imx8m_vpu_postproc_fmts[] = { · 81 unmodified lines
8282 {
8383 .fourcc = V4L2_PIX_FMT_YUYV,
8484 .codec_mode = HANTRO_MODE_NONE,
85+ .postprocessed = true,
8586 },
8687 };
8788
drivers/staging/media/hantro/rockchip_vpu_hw.c+1−0
@@ -62,6 +62,7 @@ static const struct hantro_fmt rockchip_vpu1_postproc_fmts[] = { · 61 unmodified lines
6262 {
6363 .fourcc = V4L2_PIX_FMT_YUYV,
6464 .codec_mode = HANTRO_MODE_NONE,
65+ .postprocessed = true,
6566 },
6667 };
6768
drivers/staging/media/hantro/sama5d4_vdec_hw.c+1−0
@@ -15,6 +15,7 @@ static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = { · 14 unmodified lines
1515 {
1616 .fourcc = V4L2_PIX_FMT_YUYV,
1717 .codec_mode = HANTRO_MODE_NONE,
18+ .postprocessed = true,
1819 },
1920 };
2021