media: imx-jpeg: Account for data_offset when getting image address
authorMing Qian <ming.qian@oss.nxp.com>
Wed, 21 May 2025 01:54:07 +0000 (09:54 +0800)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 20 Jun 2025 10:39:54 +0000 (12:39 +0200)
commit51ad3b570ea7b1916ff4db993f1aa22bb48fdac6
treec6b03c899abfe1706b5b7b56ad92a901479c6988
parentba4452b0c0a3191617764d3453f45ea48ed544c9
media: imx-jpeg: Account for data_offset when getting image address

Applications may set data_offset when it refers to an output queue. So
driver need to account for it when getting the start address of input
image in the plane.

Meanwhile the mxc-jpeg codec requires the address (plane address +
data_offset) to be 16-aligned.

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h