Re: [PATCH 2/3] media: qcom: venus: relax encoder frame/blur dimension steps on v4

Dikshita Agarwal
2026-04-06T06:01:28Z

On 3/31/2026 10:07 AM, Renjiang Han wrote:
> Encoder HFI capabilities on v4 advertise a 16-pixel step for frame and
> blur dimensions. This is overly restrictive and can cause userspace caps
> negotiation to fail even for valid resolutions.
>
> Relax the advertised step size to 1 and keep alignment enforcement in
> buffer layout and size calculations.
>
> Fixes: 8b88cabef404e ("media: venus: hfi_plat_v4: Populate codecs and capabilities for v4")
> Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/venus/hfi_platform_v4.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v4.c b/drivers/media/platform/qcom/venus/hfi_platform_v4.c
> index cda888b56b5d4806f10d062371b9a4969e27d9b4..e0b3652bb44093111ce610fb09366c38db516966 100644
> --- a/drivers/media/platform/qcom/venus/hfi_platform_v4.c
> +++ b/drivers/media/platform/qcom/venus/hfi_platform_v4.c
> @@ -136,8 +136,8 @@ static const struct hfi_plat_caps caps[] = {
> .codec = HFI_VIDEO_CODEC_H264,
> .domain = VIDC_SESSION_TYPE_ENC,
> .cap_bufs_mode_dynamic = true,
> - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
> @@ -173,8 +173,8 @@ static const struct hfi_plat_caps caps[] = {
> .codec = HFI_VIDEO_CODEC_HEVC,
> .domain = VIDC_SESSION_TYPE_ENC,
> .cap_bufs_mode_dynamic = true,
> - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
> @@ -195,8 +195,8 @@ static const struct hfi_plat_caps caps[] = {
> .caps[19] = {HFI_CAPABILITY_RATE_CONTROL_MODES, 0x1000001, 0x1000005, 1},
> .caps[20] = {HFI_CAPABILITY_COLOR_SPACE_CONVERSION, 0, 2, 1},
> .caps[21] = {HFI_CAPABILITY_ROTATION, 1, 4, 90},
> - .caps[22] = {HFI_CAPABILITY_BLUR_WIDTH, 96, 4096, 16},
> - .caps[23] = {HFI_CAPABILITY_BLUR_HEIGHT, 96, 4096, 16},
> + .caps[22] = {HFI_CAPABILITY_BLUR_WIDTH, 96, 4096, 1},
> + .caps[23] = {HFI_CAPABILITY_BLUR_HEIGHT, 96, 4096, 1},
> .num_caps = 24,
> .pl[0] = {HFI_HEVC_PROFILE_MAIN, HFI_HEVC_LEVEL_6 | HFI_HEVC_TIER_HIGH0},
> .pl[1] = {HFI_HEVC_PROFILE_MAIN10, HFI_HEVC_LEVEL_6 | HFI_HEVC_TIER_HIGH0},
> @@ -210,8 +210,8 @@ static const struct hfi_plat_caps caps[] = {
> .codec = HFI_VIDEO_CODEC_VP8,
> .domain = VIDC_SESSION_TYPE_ENC,
> .cap_bufs_mode_dynamic = true,
> - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
> @@ -229,8 +229,8 @@ static const struct hfi_plat_caps caps[] = {
> .caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 127, 1},
> .caps[17] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 2, 1},
> .caps[18] = {HFI_CAPABILITY_RATE_CONTROL_MODES, 0x1000001, 0x1000005, 1},
> - .caps[19] = {HFI_CAPABILITY_BLUR_WIDTH, 96, 4096, 16},
> - .caps[20] = {HFI_CAPABILITY_BLUR_HEIGHT, 96, 4096, 16},
> + .caps[19] = {HFI_CAPABILITY_BLUR_WIDTH, 96, 4096, 1},
> + .caps[20] = {HFI_CAPABILITY_BLUR_HEIGHT, 96, 4096, 1},
> .caps[21] = {HFI_CAPABILITY_COLOR_SPACE_CONVERSION, 0, 2, 1},
> .caps[22] = {HFI_CAPABILITY_ROTATION, 1, 4, 90},
> .num_caps = 23,
>

Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>

Thanks,
Dikshita