MLK-22286: mxc-jpeg: Fix v4l2-compliance test for unlimited opens
authorMirela Rabulea <mirela.rabulea@nxp.com>
Thu, 18 Jul 2019 15:48:38 +0000 (18:48 +0300)
committerMirela Rabulea <mirela.rabulea@nxp.com>
Thu, 8 Aug 2019 06:54:05 +0000 (09:54 +0300)
commit87b0bb6b3b97a5cbefdeaa2b79541971346b7b18
tree94e56a032e61f11d0cb978a5e35ff2351b1eabc5
parent5f74131e1047c3704011389274a10e0a387d55e6
MLK-22286: mxc-jpeg: Fix v4l2-compliance test for unlimited opens

Postpone allocating slot data from open() until device_run(), this will
allow unlimited opens. This forces us to postpone some operations from
jpeg_parse and s_fmt, which depend on slot descriptor, until descriptors
configuration in mxc_jpeg_config_dec_desc/mxc_jpeg_config_enc_desc.

Remove hard-coding on slot 0, use COM_STATUS register to determine
the current executing slot in the interrupt handler.

Allocate slots as they become needed, mark unused when frame is done,
release data only on remove, to prevent frequent allocation.

Change order for the following functions:
mxc_jpeg_setup_cfg_stream (and mxc_jpeg_fixup_sos, mxc_jpeg_fixup_sof),
mxc_get_free_slot, mxc_jpeg_alloc_slot_data, mxc_jpeg_free_slot_data

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
drivers/media/platform/imx8/mxc-jpeg-hw.h
drivers/media/platform/imx8/mxc-jpeg.c