media: imx-jpeg: Implement g_selection and s_selection
The codec can support any image size WxH,
with arbitrary W (image width) and H (image height) dimensions.
But it requires buffer alignment,
so driver can report the aligned resolution through the g_fmt,
and report the actual resolution through the g_selection.
For encoder, it even support to encode a smaller jpeg
than the original picture through s_selection api.
For the decoder, we do not support cropping a portion smaller
than the original picture, due to hardware limitations (wrapper side).
Fixes: 9e7aa76cdb02 ("media: imx-jpeg: Align upwards buffer size")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>