Skip to content

media: venus: fix NV12 buffer sizing and incorrect capability alignment#407

Open
renjiang-qti wants to merge 3 commits intoqualcomm-linux:qcom-6.18.yfrom
renjiang-qti:qcom-6.18.y
Open

media: venus: fix NV12 buffer sizing and incorrect capability alignment#407
renjiang-qti wants to merge 3 commits intoqualcomm-linux:qcom-6.18.yfrom
renjiang-qti:qcom-6.18.y

Conversation

@renjiang-qti
Copy link
Copy Markdown

The NV12 frame size calculation adds unnecessary 4K/8K padding, leading
to buffer overallocation. The redundant padding is removed while keeping
final 4K alignment. In addition, HFI platform capabilities advertise an
overly strict 16-pixel alignment for frame and blur dimensions, which
can reject valid userspace configurations. The alignment step is relaxed
to 1 without changing min/max limits.

CRs-Fixed: 4450386 4470055

Renjiang Han added 3 commits April 2, 2026 10:46
…culation

get_framesize_raw_nv12() currently adds SZ_4K to the UV plane size and an
additional SZ_8K to the total buffer size. This inflates the calculated
sizeimage and leads userspace to over-allocate buffers without a clear
requirement.

Remove the extra SZ_4K/SZ_8K padding and compute the NV12 size as the sum
of Y and UV planes, keeping the final ALIGN(size, SZ_4K) intact.

Link: https://lore.kernel.org/linux-arm-msm/20260331-fix_venus_bug_issue-v1-1-e4ae7a1d8db2@oss.qualcomm.com

Fixes: e1cb72d ("media: venus: helpers: move frame size calculations on common place")
Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
…s on v4

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.

Link: https://lore.kernel.org/linux-arm-msm/20260331-fix_venus_bug_issue-v1-2-e4ae7a1d8db2@oss.qualcomm.com

Fixes: 8b88cab ("media: venus: hfi_plat_v4: Populate codecs and capabilities for v4")
Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
Encoder HFI capabilities on v6 enforce a 16-pixel step for frame and blur
dimensions, which does not reflect actual hardware requirements and can
reject valid userspace configurations.

Relax the step size to 1 while leaving min/max limits unchanged.

Link: https://lore.kernel.org/linux-arm-msm/20260331-fix_venus_bug_issue-v1-3-e4ae7a1d8db2@oss.qualcomm.com

Fixes: 869d77e ("media: venus: hfi_plat_v6: Populate capabilities for v6")
Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
@renjiang-qti renjiang-qti requested a review from a team April 2, 2026 05:23
@qcomlnxci
Copy link
Copy Markdown

Test Matrix

Test Case lemans-evk monaco-evk qcs615-ride qcs6490-rb3gen2 qcs8300-ride qcs9100-ride-r3 sm8750-mtp
0_qcom-next-ci-premerge-tests ◻️ ◻️ ◻️ ◻️ ◻️ ◻️ ❌ Fail
BT_FW_KMD_Service ❌ Fail ❌ Fail ◻️ ◻️ ✅ Pass ✅ Pass ❌ Fail
BT_ON_OFF ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ⚠️ skip
BT_SCAN ✅ Pass ❌ Fail ◻️ ◻️ ✅ Pass ✅ Pass ◻️
CPUFreq_Validation ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
CPU_affinity ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
DSP_AudioPD ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ◻️
Ethernet ✅ Pass ✅ Pass ◻️ ◻️ ⚠️ skip ⚠️ skip ⚠️ skip
Freq_Scaling ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ❌ Fail
GIC ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
IPA ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
Interrupts ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
OpenCV ⚠️ skip ⚠️ skip ◻️ ◻️ ⚠️ skip ⚠️ skip ◻️
PCIe ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
Probe_Failure_Check ❌ Fail ❌ Fail ◻️ ◻️ ❌ Fail ❌ Fail ❌ Fail
RMNET ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
UFS_Validation ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
USBHost ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ❌ Fail
WiFi_Firmware_Driver ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ◻️
WiFi_OnOff ✅ Pass ⚠️ skip ◻️ ◻️ ✅ Pass ✅ Pass ◻️
cdsp_remoteproc ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ❌ Fail
hotplug ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
irq ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
kaslr ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
pinctrl ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
qcom_hwrng ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ◻️
remoteproc ✅ Pass ❌ Fail ◻️ ◻️ ❌ Fail ✅ Pass ❌ Fail
rngtest ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
shmbridge ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
smmu ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass
watchdog ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ◻️
wpss_remoteproc ✅ Pass ✅ Pass ◻️ ◻️ ✅ Pass ✅ Pass ✅ Pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants