]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commited881b457aa8fcd92622cd10a60732a2d98aa67c
tree4b51f1a8f6a65f6b16f81e307d3cb0e4b9c8506e
parent4ab2a9abdb78fdd403b031d897ee716ecad27f08
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