Commit a47a3ae5 authored by Fritz Koenig's avatar Fritz Koenig Committed by Hans Verkuil

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: default avatarFritz Koenig <frkoenig@chromium.org>
Reviewed-by: default avatarVikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: default avatarStanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 7493db46
......@@ -988,8 +988,8 @@ static u32 get_framesize_raw_p010(u32 width, u32 height)
{
u32 y_plane, uv_plane, y_stride, uv_stride, y_sclines, uv_sclines;
y_stride = ALIGN(width * 2, 256);
uv_stride = ALIGN(width * 2, 256);
y_stride = ALIGN(width * 2, 128);
uv_stride = ALIGN(width * 2, 128);
y_sclines = ALIGN(height, 32);
uv_sclines = ALIGN((height + 1) >> 1, 16);
y_plane = y_stride * y_sclines;
......
......@@ -204,8 +204,13 @@ vdec_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
pixmp->height);
if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
unsigned int stride = pixmp->width;
if (pixmp->pixelformat == V4L2_PIX_FMT_P010)
stride *= 2;
pfmt[0].sizeimage = szimage;
pfmt[0].bytesperline = ALIGN(pixmp->width, 128);
pfmt[0].bytesperline = ALIGN(stride, 128);
} else {
pfmt[0].sizeimage = clamp_t(u32, pfmt[0].sizeimage, 0, SZ_8M);
pfmt[0].sizeimage = max(pfmt[0].sizeimage, szimage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment