media: atmel: atmel-isc-base: fix bytesperline value for planar formats
authorEugen Hristev <eugen.hristev@microchip.com>
Mon, 13 Dec 2021 13:49:28 +0000 (14:49 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 23 Jan 2022 20:18:44 +0000 (21:18 +0100)
commit9780baa06992f59636b6a9d36025269eef4e0c18
tree4b51f1a8f6a65f6b16f81e307d3cb0e4b9c8506e
parent72802a86e11c34e819fbfb38f58c5aef668f833d
media: atmel: atmel-isc-base: fix bytesperline value for planar formats

The bytesperline field of the pixfmt should be only for the first plane
in case of planar formats like YUV420 or YUV422.
The bytesperline is used by the driver to compute the framesize.
We have to report a different bpp (bytes per pixel) to v4l2 in bytesperline
than the actual bpp.
For example for YUV420, the real bpp is 12, but the first plane has only
8 bpp. Thus we report a bytesperline 8*width instead of 12*width.
However, for real framezise we have to compute 12*width*height.
Hence added a new variable to hold this information and to correctly
compute the frame size.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/atmel/atmel-isc-base.c
drivers/media/platform/atmel/atmel-isc.h