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