summaryrefslogtreecommitdiff
path: root/drivers/media/platform/atmel/atmel-isc.h
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2021-12-13 14:49:28 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-01-23 21:18:44 +0100
commit9780baa06992f59636b6a9d36025269eef4e0c18 (patch)
tree4b51f1a8f6a65f6b16f81e307d3cb0e4b9c8506e /drivers/media/platform/atmel/atmel-isc.h
parent72802a86e11c34e819fbfb38f58c5aef668f833d (diff)
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>
Diffstat (limited to 'drivers/media/platform/atmel/atmel-isc.h')
-rw-r--r--drivers/media/platform/atmel/atmel-isc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h
index 32448ccfc636..07fa6dbf8460 100644
--- a/drivers/media/platform/atmel/atmel-isc.h
+++ b/drivers/media/platform/atmel/atmel-isc.h
@@ -102,6 +102,9 @@ struct isc_format {
configuration.
* @fourcc: Fourcc code for this format.
* @bpp: Bytes per pixel in the current format.
+ * @bpp_v4l2: Bytes per pixel in the current format, for v4l2.
+ This differs from 'bpp' in the sense that in planar
+ formats, it refers only to the first plane.
* @rlp_cfg_mode: Configuration of the RLP (rounding, limiting packaging)
* @dcfg_imode: Configuration of the input of the DMA module
* @dctrl_dview: Configuration of the output of the DMA module
@@ -112,6 +115,7 @@ struct fmt_config {
u32 fourcc;
u8 bpp;
+ u8 bpp_v4l2;
u32 rlp_cfg_mode;
u32 dcfg_imode;