media: imx-jpeg: Identify and handle precision correctly
authorMing Qian <ming.qian@nxp.com>
Wed, 23 Mar 2022 09:05:55 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:21 +0000 (14:23 +0200)
commit8fcbb2e91e268ebbceb26ec7482b7b9613fa886a
treea1019724b2cb6741891c5cfb0a11642d2e8a6e0f
parent24eef33c384eae73e4e5d3e354134137bbe60669
media: imx-jpeg: Identify and handle precision correctly

[ Upstream commit bec0a3a67389ede106d0661a007edf832878d8b2 ]

The decoder will save the precision that was detected from jpeg header
and use it later, when choosing the pixel format and also calculate
bytesperline according to precision.

The 12bit jpeg is not supported yet,
but driver shouldn't led to serious problem if user enqueue a 12 bit jpeg.
And the 12bit jpeg is supported by hardware, driver may support it later.

[hverkuil: document the new precision field]

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/imx-jpeg/mxc-jpeg.c
drivers/media/platform/imx-jpeg/mxc-jpeg.h