Skip to content

Commit c4f0846

Browse files
Renjiang Hangregkh
authored andcommitted
media: qcom: venus: drop extra padding in NV12 raw size calculation
[ Upstream commit e1c9ada ] 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. Fixes: e1cb72d ("media: venus: helpers: move frame size calculations on common place") Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com> Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fc72fd6 commit c4f0846

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/media/platform/qcom/venus/helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,8 @@ static u32 get_framesize_raw_nv12(u32 width, u32 height)
954954
uv_sclines = ALIGN(((height + 1) >> 1), 16);
955955

956956
y_plane = y_stride * y_sclines;
957-
uv_plane = uv_stride * uv_sclines + SZ_4K;
958-
size = y_plane + uv_plane + SZ_8K;
957+
uv_plane = uv_stride * uv_sclines;
958+
size = y_plane + uv_plane;
959959

960960
return ALIGN(size, SZ_4K);
961961
}

0 commit comments

Comments
 (0)