Skip to content

Commit

Permalink
media: hantro: Support RK3399 VP8 decoding
Browse files Browse the repository at this point in the history
Rockchip RK3399 SoC has the same Hantro G1 IP block
as RK3288, but the registers are entirely different.

In a similar fashion as MPEG-2 decoding, it's simpler
to just add a separate implementation.

Signed-off-by: Jeffy Chen <[email protected]>
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
JeffyCN authored and mchehab committed Jul 25, 2019
1 parent 613326d commit 73fb5bf
Show file tree
Hide file tree
Showing 4 changed files with 618 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/staging/media/hantro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ hantro-vpu-y += \
hantro_g1_vp8_dec.o \
rk3399_vpu_hw_jpeg_enc.o \
rk3399_vpu_hw_mpeg2_dec.o \
rk3399_vpu_hw_vp8_dec.o \
hantro_jpeg.o \
hantro_mpeg2.o \
hantro_vp8.o
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/media/hantro/hantro_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ int hantro_mpeg2_dec_init(struct hantro_ctx *ctx);
void hantro_mpeg2_dec_exit(struct hantro_ctx *ctx);

void hantro_g1_vp8_dec_run(struct hantro_ctx *ctx);
void rk3399_vpu_vp8_dec_run(struct hantro_ctx *ctx);
int hantro_vp8_dec_init(struct hantro_ctx *ctx);
void hantro_vp8_dec_exit(struct hantro_ctx *ctx);
void hantro_vp8_prob_update(struct hantro_ctx *ctx,
Expand Down
22 changes: 21 additions & 1 deletion drivers/staging/media/hantro/rk3399_vpu_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ static const struct hantro_fmt rk3399_vpu_dec_fmts[] = {
.step_height = MPEG2_MB_DIM,
},
},
{
.fourcc = V4L2_PIX_FMT_VP8_FRAME,
.codec_mode = HANTRO_MODE_VP8_DEC,
.max_depth = 2,
.frmsize = {
.min_width = 48,
.max_width = 3840,
.step_width = VP8_MB_DIM,
.min_height = 48,
.max_height = 2160,
.step_height = VP8_MB_DIM,
},
},
};

static irqreturn_t rk3399_vepu_irq(int irq, void *dev_id)
Expand Down Expand Up @@ -154,6 +167,12 @@ static const struct hantro_codec_ops rk3399_vpu_codec_ops[] = {
.init = hantro_mpeg2_dec_init,
.exit = hantro_mpeg2_dec_exit,
},
[HANTRO_MODE_VP8_DEC] = {
.run = rk3399_vpu_vp8_dec_run,
.reset = rk3399_vpu_dec_reset,
.init = hantro_vp8_dec_init,
.exit = hantro_vp8_dec_exit,
},
};

/*
Expand All @@ -176,7 +195,8 @@ const struct hantro_variant rk3399_vpu_variant = {
.dec_offset = 0x400,
.dec_fmts = rk3399_vpu_dec_fmts,
.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
.codec = HANTRO_JPEG_ENCODER | HANTRO_MPEG2_DECODER,
.codec = HANTRO_JPEG_ENCODER | HANTRO_MPEG2_DECODER |
HANTRO_VP8_DECODER,
.codec_ops = rk3399_vpu_codec_ops,
.irqs = rk3399_irqs,
.num_irqs = ARRAY_SIZE(rk3399_irqs),
Expand Down
Loading

0 comments on commit 73fb5bf

Please sign in to comment.