]> git.baikalelectronics.ru Git - kernel.git/commit
media: imx-jpeg: Align upwards buffer size
authorMing Qian <ming.qian@nxp.com>
Mon, 30 May 2022 07:49:19 +0000 (08:49 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Jun 2022 09:30:36 +0000 (10:30 +0100)
commit06ce72f77155349555d5454e9b7de41d067dedf7
treefb4db87ed4defa4ca1f66d53dff31ef3d45299c7
parent1a37be01ad9c796aca2d476b8b5cf491064179eb
media: imx-jpeg: Align upwards buffer size

The hardware can support any image size WxH,
with arbitrary W (image width) and H (image height) dimensions.

Align upwards buffer size for both encoder and decoder.
and leave the picture resolution unchanged.

For decoder, the risk of memory out of bounds can be avoided.
For both encoder and decoder, the driver will lift the limitation of
resolution alignment.

For example, the decoder can support jpeg whose resolution is 227x149
the encoder can support nv12 1080P, won't change it to 1920x1072.

Fixes: d07d57ca19d16 ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c