Skip to content

Commit 3f6702e

Browse files
hfruchet-sthverkuil
authored andcommitted
media: verisilicon: postproc: 4K support
Support input larger than 4096x2048 using extended input width/height fields of swreg92. This is needed to decode large WebP or JPEG pictures. Signed-off-by: Hugues Fruchet <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Signed-off-by: Nicolas Dufresne <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent f7546da commit 3f6702e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

drivers/media/platform/verisilicon/hantro.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ struct hantro_postproc_regs {
323323
struct hantro_reg output_fmt;
324324
struct hantro_reg orig_width;
325325
struct hantro_reg display_width;
326+
struct hantro_reg input_width_ext;
327+
struct hantro_reg input_height_ext;
326328
};
327329

328330
struct hantro_vp9_decoded_buffer_info {

drivers/media/platform/verisilicon/hantro_g1_regs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
#define G1_REG_PP_CONTROL_OUT_WIDTH(v) (((v) << 4) & GENMASK(14, 4))
351351
#define G1_REG_PP_MASK1_ORIG_WIDTH G1_SWREG(88)
352352
#define G1_REG_PP_ORIG_WIDTH(v) (((v) << 23) & GENMASK(31, 23))
353-
#define G1_REG_PP_DISPLAY_WIDTH G1_SWREG(92)
353+
#define G1_REG_PP_DISPLAY_WIDTH_IN_EXT G1_SWREG(92)
354354
#define G1_REG_PP_FUSE G1_SWREG(99)
355355

356356
#endif /* HANTRO_G1_REGS_H_ */

drivers/media/platform/verisilicon/hantro_postproc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ static const struct hantro_postproc_regs hantro_g1_postproc_regs = {
4949
.input_fmt = {G1_REG_PP_CONTROL, 29, 0x7},
5050
.output_fmt = {G1_REG_PP_CONTROL, 26, 0x7},
5151
.orig_width = {G1_REG_PP_MASK1_ORIG_WIDTH, 23, 0x1ff},
52-
.display_width = {G1_REG_PP_DISPLAY_WIDTH, 0, 0xfff},
52+
.display_width = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 0, 0xfff},
53+
.input_width_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 26, 0x7},
54+
.input_height_ext = {G1_REG_PP_DISPLAY_WIDTH_IN_EXT, 29, 0x7},
5355
};
5456

5557
bool hantro_needs_postproc(const struct hantro_ctx *ctx,
@@ -103,6 +105,8 @@ static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
103105
HANTRO_PP_REG_WRITE(vpu, output_height, ctx->dst_fmt.height);
104106
HANTRO_PP_REG_WRITE(vpu, orig_width, MB_WIDTH(ctx->dst_fmt.width));
105107
HANTRO_PP_REG_WRITE(vpu, display_width, ctx->dst_fmt.width);
108+
HANTRO_PP_REG_WRITE(vpu, input_width_ext, MB_WIDTH(ctx->dst_fmt.width) >> 9);
109+
HANTRO_PP_REG_WRITE(vpu, input_height_ext, MB_HEIGHT(ctx->dst_fmt.height >> 8));
106110
}
107111

108112
static int down_scale_factor(struct hantro_ctx *ctx)

0 commit comments

Comments
 (0)