Skip to content

Commit e67a09d

Browse files
jernejskmchehab
authored andcommitted
media: hantro: vp9: use double buffering if needed
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 <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent ea71631 commit e67a09d

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

drivers/staging/media/hantro/hantro.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct hantro_irq {
7373
* @num_clocks: number of clocks in the array
7474
* @reg_names: array of register range names
7575
* @num_regs: number of register range names in the array
76+
* @double_buffer: core needs double buffering
7677
*/
7778
struct hantro_variant {
7879
unsigned int enc_offset;
@@ -94,6 +95,7 @@ struct hantro_variant {
9495
int num_clocks;
9596
const char * const *reg_names;
9697
int num_regs;
98+
unsigned int double_buffer : 1;
9799
};
98100

99101
/**

drivers/staging/media/hantro/hantro_g2_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@
270270
#define g2_apf_threshold G2_DEC_REG(55, 0, 0xffff)
271271

272272
#define g2_clk_gate_e G2_DEC_REG(58, 16, 0x1)
273+
#define g2_double_buffer_e G2_DEC_REG(58, 15, 0x1)
273274
#define g2_buswidth G2_DEC_REG(58, 8, 0x7)
274275
#define g2_max_burst G2_DEC_REG(58, 0, 0xff)
275276

drivers/staging/media/hantro/hantro_g2_vp9_dec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,8 @@ config_registers(struct hantro_ctx *ctx, const struct v4l2_ctrl_vp9_frame *dec_p
847847
hantro_reg_write(ctx->dev, &g2_clk_gate_e, 1);
848848
hantro_reg_write(ctx->dev, &g2_max_cb_size, 6);
849849
hantro_reg_write(ctx->dev, &g2_min_cb_size, 3);
850+
if (ctx->dev->variant->double_buffer)
851+
hantro_reg_write(ctx->dev, &g2_double_buffer_e, 1);
850852

851853
config_output(ctx, dst, dec_params);
852854

0 commit comments

Comments
 (0)