From 5c9de1fa03e9bb67c8d82240fcb8f550036090b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 5 Sep 2019 18:25:17 -0300 Subject: media: rcar-vin: Use bytes per line instead of width for UV offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The image size is doubled for NV16 and is calculated as bytesperline * height * 2 to accommodate the split of UV data. When writing the offset to hardware, the width is used instead of bytesperline, fix this. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/rcar-vin/rcar-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/platform') diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index c7859b329dd4..af4f774149f0 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -703,8 +703,8 @@ static int rvin_setup(struct rvin_dev *vin) switch (vin->format.pixelformat) { case V4L2_PIX_FMT_NV16: rvin_write(vin, - ALIGN(vin->format.width * vin->format.height, 0x80), - VNUVAOF_REG); + ALIGN(vin->format.bytesperline * vin->format.height, + 0x80), VNUVAOF_REG); dmr = VNDMR_DTMD_YCSEP; output_is_yuv = true; break; -- cgit v1.2.3