Skip to content

Commit

Permalink
media: hantro: vp9: use double buffering if needed
Browse files Browse the repository at this point in the history
Some G2 variants need double buffering to be enabled in order to work
correctly, like that found in Allwinner H6 SoC.

Add platform quirk for that.

Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Jernej Skrabec authored and Mauro Carvalho Chehab committed Dec 16, 2021
1 parent ea71631 commit e67a09d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/media/hantro/hantro.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct hantro_irq {
* @num_clocks: number of clocks in the array
* @reg_names: array of register range names
* @num_regs: number of register range names in the array
* @double_buffer: core needs double buffering
*/
struct hantro_variant {
unsigned int enc_offset;
Expand All @@ -94,6 +95,7 @@ struct hantro_variant {
int num_clocks;
const char * const *reg_names;
int num_regs;
unsigned int double_buffer : 1;
};

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/media/hantro/hantro_g2_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
#define g2_apf_threshold G2_DEC_REG(55, 0, 0xffff)

#define g2_clk_gate_e G2_DEC_REG(58, 16, 0x1)
#define g2_double_buffer_e G2_DEC_REG(58, 15, 0x1)
#define g2_buswidth G2_DEC_REG(58, 8, 0x7)
#define g2_max_burst G2_DEC_REG(58, 0, 0xff)

Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/media/hantro/hantro_g2_vp9_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ config_registers(struct hantro_ctx *ctx, const struct v4l2_ctrl_vp9_frame *dec_p
hantro_reg_write(ctx->dev, &g2_clk_gate_e, 1);
hantro_reg_write(ctx->dev, &g2_max_cb_size, 6);
hantro_reg_write(ctx->dev, &g2_min_cb_size, 3);
if (ctx->dev->variant->double_buffer)
hantro_reg_write(ctx->dev, &g2_double_buffer_e, 1);

config_output(ctx, dst, dec_params);

Expand Down

0 comments on commit e67a09d

Please sign in to comment.