Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: venus: Correct P010 buffer alignment

According to msm_media_info.h the correct alignment
for the stride of P010 buffers is 128.

Signed-off-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Fritz Koenig and committed by
Hans Verkuil
a47a3ae5 7493db46

+8 -3
+2 -2
drivers/media/platform/qcom/venus/helpers.c
··· 988 988 { 989 989 u32 y_plane, uv_plane, y_stride, uv_stride, y_sclines, uv_sclines; 990 990 991 - y_stride = ALIGN(width * 2, 256); 992 - uv_stride = ALIGN(width * 2, 256); 991 + y_stride = ALIGN(width * 2, 128); 992 + uv_stride = ALIGN(width * 2, 128); 993 993 y_sclines = ALIGN(height, 32); 994 994 uv_sclines = ALIGN((height + 1) >> 1, 16); 995 995 y_plane = y_stride * y_sclines;
+6 -1
drivers/media/platform/qcom/venus/vdec.c
··· 204 204 pixmp->height); 205 205 206 206 if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { 207 + unsigned int stride = pixmp->width; 208 + 209 + if (pixmp->pixelformat == V4L2_PIX_FMT_P010) 210 + stride *= 2; 211 + 207 212 pfmt[0].sizeimage = szimage; 208 - pfmt[0].bytesperline = ALIGN(pixmp->width, 128); 213 + pfmt[0].bytesperline = ALIGN(stride, 128); 209 214 } else { 210 215 pfmt[0].sizeimage = clamp_t(u32, pfmt[0].sizeimage, 0, SZ_8M); 211 216 pfmt[0].sizeimage = max(pfmt[0].sizeimage, szimage);