Commits
Mirela Rabulea committed 3c10505cd7d
MLK-22835: mxc-jpeg: jpeg decoder stuck due to race condition The race condition is on ctx->dht_needed, this variable indicates if the decoder operates in one stage (decode) or two stages (inject default Huffman table + decode). While decoding the current buffer, and before the IP finishes it, a new buffer in enqueued, jpeg parse begins, initializes ctx->dht_needed with true, and does not get to finish parsing the jpeg headers. In the meantime, the IP finishes decoding the current buffer and checks for ctx->dht_needed, and believes it needs to run again the IP to finish the job, which is wrong and gets the IP stuck. This dht_needed property should be per buffer, not per context, so, add a custom structure for the source buffer, struct mxc_jpeg_src_buf, and don't forget to tell v4l2 core about its size, in mxc_jpeg_queue_init. Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> (cherry picked from commit 4601417e95d35e995e0d8347b8464090a511db0d)