Skip to content

Commit

Permalink
v4l: xilinx: multi-scaler:fix corruption for YUV422 8 and 10 bpc
Browse files Browse the repository at this point in the history
Fix the buffer size for NV16 and XV20 video formats correctly as
twice the size of stride * height.

Signed-off-by: Kunal Rane <kunal.rane@amd.com>
Reviewed-by: Vishal Sagar <vishal.sagar@amd.com>
  • Loading branch information
Kunal Rane authored and michalsimek committed Feb 9, 2023
1 parent 81ebe25 commit 5b5c6d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/platform/xilinx/xilinx-multi-scaler.c
Expand Up @@ -1431,6 +1431,15 @@ xm2msc_cal_imagesize(struct xm2msc_chan_ctx *chan_ctx,
q_data->sizeimage[0] +=
q_data->stride * (height / 2);
break;
case V4L2_PIX_FMT_NV16:
case V4L2_PIX_FMT_XV20:
/*
* Adding chroma plane size as NV16
* have a contiguous buffer for luma and chrome
*/
q_data->sizeimage[0] +=
q_data->stride * height;
break;
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_XV15M:
q_data->sizeimage[1] =
Expand Down

0 comments on commit 5b5c6d4

Please sign in to comment.