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
Open
media: venus: fix NV12 buffer sizing and incorrect capability alignment#407renjiang-qti wants to merge 3 commits intoqualcomm-linux:qcom-6.18.yfrom
renjiang-qti wants to merge 3 commits intoqualcomm-linux:qcom-6.18.yfrom
Conversation
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>
vgarodia
approved these changes
Apr 2, 2026
Test Matrix
|
Komal-Bajaj
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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