Commits
Zhengyu Shen committed e1959f24366
mxc-jpeg: Add v4l2 driver for i.MX8 CAST IP JPEG Encoder/Decoder This IP is present in i.MX 8QuadMax and i.MX 8DualX/8DualXPlus/8QuadXPlus application processors. The mxc-jpeg driver creates two v4l2 file handles in /dev, one for the decoder, and one for the encoder, which can be used by v4l2 programs. The multi-planar buffers API is used. Baseline and extended sequential jpeg decoding is supported. Progressive jpeg decoding is not supported by the IP. Supports encode and decode of various formats: YUV444, YUV422, YUV420, RGB, ARGB, Gray YUV420 is the only multi-planar format supported. Minimum resolution is 64 x 64, maximum 8192 x 8192. The alignment requirements for the resolution depend on the format, multiple of 16 resolutions should work for all formats. Special workarounds are made in the driver to support NV12 1080p. When decoding, the driver detects image resolution and pixel format from the jpeg stream, parsing the jpeg markers. The mxc-jpeg driver was tested to work with gstreamer & NXP gst plugins for jpeg encoder/decoder. The IP has 4 slots available for context switching, but only slot 0 was fully tested to work. Context switching is not used by the driver. Each driver instance (context) allocates a slot for itself, but this is postponed util device_run, to allow unlimited opens. The driver submits jobs to the IP by setting up a descriptor for the used slot, and then validating it. The encoder has an additional descriptor for the configuration phase. The driver expects FRM_DONE interrupt from IP to mark the job as finished. The decoder IP has some limitations regarding the component ID's, but the driver works around this by replacing them in the jpeg stream. A module parameter is available for debug purpose: jpeg_tracing The v4l2-compliance basic tests are passing on decoder/encoder nodes. The driver builds fine as builtin or module. Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com> Signed-off-by: Zhengyu Shen <zhengyu.shen_1@nxp.com> Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>, Frank Li <Frank.Li@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com> Reviewed-by: Sandor Yu <sandor.yu@nxp.com> (cherry picked from commit 4450ab9207122e885c4b3ad877db3f8163e9ce7f)