]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: imx-jpeg: Add support for descriptor allocation from SRAM
authorMarek Vasut <marek.vasut@mailbox.org>
Fri, 17 Oct 2025 15:58:38 +0000 (17:58 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 5 Jan 2026 14:56:31 +0000 (15:56 +0100)
commit241e75fe6b9db206e8df14d305ea7e42fd3a2846
tree5a84c21f2988f36bc2a01e0fa1fd994004f2ce86
parent88fe301896596da34847871dbdfe261ed1148676
media: imx-jpeg: Add support for descriptor allocation from SRAM

Add support for optional allocation of bitstream descriptors from SRAM
instead of DRAM. In case the encoder/decoder DT node contains 'sram'
property which points to 'mmio-sram', the driver will attempt to use
the SRAM instead of DRAM for descriptor allocation, which might improve
performance.

This also helps on i.MX95 rev.A with sporadic SLOTn_STATUS IMG_RD_ERR
bit 11 being triggered during JPEG encoding, which is caused by a bug
fixed on later SoC revisions. The bug occurs less often when using the
SRAM for descriptor storage, but is not entirely mitigated. The following
pipeline triggers the bug when descriptors get allocated from DRAM, the
pipeline often hangs after a few seconds and the encoder driver indicates
"timeout, cancel it":

gst-launch-1.0 videotestsrc ! \
               video/x-raw,width=256,height=256,format=YUY2 ! \
               queue ! v4l2jpegenc ! queue ! fakesink

Tested-by: Ming Qian <ming.qian@oss.nxp.com>
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h