From: Nicolas Dufresne nicolas.dufresne@collabora.com
[ Upstream commit 311e40e877bd980bc665e6c8d3b15d96f0ec2aa8 ]
Tested on RK3588, this decoder is capable of handling WUHD, so bump the maximum width and height accordingly.
Reviewed-by: Benjamin Gaignard benjamin.gaignard@collabora.com Signed-off-by: Nicolas Dufresne nicolas.dufresne@collabora.com Signed-off-by: Hans Verkuil hverkuil@xs4all.nl Signed-off-by: Sasha Levin sashal@kernel.org ---
**YES** This commit should be backported to stable kernel trees. ## Analysis This is a **bug fix** that corrects an artificial limitation in the AV1 decoder driver, not a new feature addition. Here's my detailed analysis: ### Nature of the Change The commit changes format capability declarations from `FMT_UHD_WIDTH/HEIGHT` (3840x2160) to `FMT_4K_WIDTH/HEIGHT` (4096x2304) for the RK3588 AV1 decoder. Looking at the constants in the codebase: - `FMT_UHD_WIDTH` = 3840, `FMT_UHD_HEIGHT` = 2160 (standard UHD) - `FMT_4K_WIDTH` = 4096, `FMT_4K_HEIGHT` = 2304 (Cinema 4K) ### Why This is a Bug Fix 1. **Hardware Capability vs Driver Limitation**: The commit message states this was "Tested on RK3588" and confirms the decoder is "capable of handling WUHD", indicating the hardware already supports these resolutions but the driver was artificially limiting them. 2. **User- Visible Problem**: Users with Cinema 4K content (4096x2160 or wider) would experience decode failures despite having capable hardware. 3. **No New Hardware Features**: This doesn't enable new hardware functionality - it simply removes an incorrect software limitation. ### Risk Assessment - Very Low 1. **Minimal Code Changes**: Only changes constant values in format capability arrays - no algorithmic logic changes. 2. **Backward Compatibility**: Existing UHD content (3840x2160) continues to work exactly as before. 3. **Self-Contained**: Changes are isolated to the verisilicon media driver, affecting only format capability declarations. 4. **No API Changes**: No changes to userspace interfaces or kernel APIs. ### Comparison to Similar Backported Commit This change is very similar to commit #5 in the reference examples (marked "Backport Status: YES"): - Both increase maximum supported resolution after hardware testing - Both are minimal, low-risk changes to capability declarations - Both fix user-visible decode failures for content the hardware can actually handle ### Stable Tree Benefits 1. **Fixes decode failures** for users with Cinema 4K AV1 content 2. **Improves hardware utilization** by removing artificial limitations 3. **Very low regression risk** due to minimal, well-contained changes 4. **Meets all stable tree criteria**: important fix, minimal risk, no new features This commit clearly qualifies for stable backporting as it fixes a user-visible bug with minimal risk and no architectural changes.
.../platform/verisilicon/rockchip_vpu_hw.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c index f975276707835..94fedb34f87ff 100644 --- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c +++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c @@ -86,10 +86,10 @@ static const struct hantro_fmt rockchip_vpu981_postproc_fmts[] = { .postprocessed = true, .frmsize = { .min_width = ROCKCHIP_VPU981_MIN_SIZE, - .max_width = FMT_UHD_WIDTH, + .max_width = FMT_4K_WIDTH, .step_width = MB_DIM, .min_height = ROCKCHIP_VPU981_MIN_SIZE, - .max_height = FMT_UHD_HEIGHT, + .max_height = FMT_4K_HEIGHT, .step_height = MB_DIM, }, }, @@ -100,10 +100,10 @@ static const struct hantro_fmt rockchip_vpu981_postproc_fmts[] = { .postprocessed = true, .frmsize = { .min_width = ROCKCHIP_VPU981_MIN_SIZE, - .max_width = FMT_UHD_WIDTH, + .max_width = FMT_4K_WIDTH, .step_width = MB_DIM, .min_height = ROCKCHIP_VPU981_MIN_SIZE, - .max_height = FMT_UHD_HEIGHT, + .max_height = FMT_4K_HEIGHT, .step_height = MB_DIM, }, }, @@ -319,10 +319,10 @@ static const struct hantro_fmt rockchip_vpu981_dec_fmts[] = { .match_depth = true, .frmsize = { .min_width = ROCKCHIP_VPU981_MIN_SIZE, - .max_width = FMT_UHD_WIDTH, + .max_width = FMT_4K_WIDTH, .step_width = MB_DIM, .min_height = ROCKCHIP_VPU981_MIN_SIZE, - .max_height = FMT_UHD_HEIGHT, + .max_height = FMT_4K_HEIGHT, .step_height = MB_DIM, }, }, @@ -332,10 +332,10 @@ static const struct hantro_fmt rockchip_vpu981_dec_fmts[] = { .match_depth = true, .frmsize = { .min_width = ROCKCHIP_VPU981_MIN_SIZE, - .max_width = FMT_UHD_WIDTH, + .max_width = FMT_4K_WIDTH, .step_width = MB_DIM, .min_height = ROCKCHIP_VPU981_MIN_SIZE, - .max_height = FMT_UHD_HEIGHT, + .max_height = FMT_4K_HEIGHT, .step_height = MB_DIM, }, }, @@ -345,10 +345,10 @@ static const struct hantro_fmt rockchip_vpu981_dec_fmts[] = { .max_depth = 2, .frmsize = { .min_width = ROCKCHIP_VPU981_MIN_SIZE, - .max_width = FMT_UHD_WIDTH, + .max_width = FMT_4K_WIDTH, .step_width = MB_DIM, .min_height = ROCKCHIP_VPU981_MIN_SIZE, - .max_height = FMT_UHD_HEIGHT, + .max_height = FMT_4K_HEIGHT, .step_height = MB_DIM, }, },