Skip to content

Commit 3dbd4e8

Browse files
amazingfateigorpecovnik
authored andcommitted
rockchip64-6.18: add patch to fix av1 decoding on rk3588
1 parent 22a5c46 commit 3dbd4e8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Benjamin Gaignard <[email protected]>
3+
Date: Mon, 22 Sep 2025 13:15:02 +0200
4+
Subject: media: verisilicon: AV1: Fix enable cdef computation
5+
6+
Testing V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF flag isn't enough
7+
to know if cdef bit has to be set.
8+
If any of the used cdef fields isn't zero then we must enable
9+
cdef feature on the hardware.
10+
11+
Signed-off-by: Benjamin Gaignard <[email protected]>
12+
Fixes: 727a400686a2c ("media: verisilicon: Add Rockchip AV1 decoder")
13+
---
14+
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c | 10 ++++++++--
15+
1 file changed, 8 insertions(+), 2 deletions(-)
16+
17+
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
18+
index 111111111111..222222222222 100644
19+
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
20+
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
21+
@@ -1396,8 +1396,16 @@ static void rockchip_vpu981_av1_dec_set_cdef(struct hantro_ctx *ctx)
22+
u16 luma_sec_strength = 0;
23+
u32 chroma_pri_strength = 0;
24+
u16 chroma_sec_strength = 0;
25+
+ bool enable_cdef;
26+
int i;
27+
28+
+ enable_cdef = !(cdef->bits == 0 &&
29+
+ cdef->damping_minus_3 == 0 &&
30+
+ cdef->y_pri_strength[0] == 0 &&
31+
+ cdef->y_sec_strength[0] == 0 &&
32+
+ cdef->uv_pri_strength[0] == 0 &&
33+
+ cdef->uv_sec_strength[0] == 0);
34+
+ hantro_reg_write(vpu, &av1_enable_cdef, enable_cdef);
35+
hantro_reg_write(vpu, &av1_cdef_bits, cdef->bits);
36+
hantro_reg_write(vpu, &av1_cdef_damping, cdef->damping_minus_3);
37+
38+
@@ -1953,8 +1961,6 @@ static void rockchip_vpu981_av1_dec_set_parameters(struct hantro_ctx *ctx)
39+
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_SHOW_FRAME));
40+
hantro_reg_write(vpu, &av1_switchable_motion_mode,
41+
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE));
42+
- hantro_reg_write(vpu, &av1_enable_cdef,
43+
- !!(ctrls->sequence->flags & V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF));
44+
hantro_reg_write(vpu, &av1_allow_masked_compound,
45+
!!(ctrls->sequence->flags
46+
& V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND));
47+
--
48+
Armbian
49+

0 commit comments

Comments
 (0)