[PATCH] media: imx-jpeg: Add support for descriptor allocation from SRAM
Marek Vasut
marek.vasut at mailbox.org
Wed Aug 20 13:16:09 PDT 2025
On 8/20/25 8:17 PM, Frank Li wrote:
> On Wed, Aug 20, 2025 at 06:29:53PM +0200, Marek Vasut wrote:
>> 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 however helps on i.MX95 with sporadic SLOTn_STATUS IMG_RD_ERR bit 11
>> being triggered during JPEG encoding. The following pipeline triggers the
>> problem when descriptors get allocated from DRAM, the pipeline often hangs
>> after a few seconds and the encoder driver indicates "timeout, cancel it" :
>
> Do you know why this happen if descriptor is in DRAM? why sram help this
> case?
No. Did NXP ever observe this ?
It seems to me the encode never received much testing, considering the
severe bugs that showed up in there.
>> gst-launch-1.0 videotestsrc ! video/x-raw,width=256,height=256,format=YUY2 ! \
>> queue ! v4l2jpegenc ! queue ! fakesink
>>
>> Signed-off-by: Marek Vasut <marek.vasut at mailbox.org>
>> ---
> ...
>> - GFP_ATOMIC);
>> + jpeg->slot_data.cfg_dec_vaddr = mxc_jpeg_alloc(jpeg, jpeg->slot_data.cfg_dec_size,
>> + &jpeg->slot_data.cfg_dec_daddr);
>> if (!jpeg->slot_data.cfg_dec_vaddr)
>> goto err;
>>
>> @@ -2902,6 +2911,10 @@ static int mxc_jpeg_probe(struct platform_device *pdev)
>> jpeg->dev = dev;
>> jpeg->mode = mode;
>>
>> + /* SRAM pool is optional */
>> + jpeg->sram_pool = of_gen_pool_get(pdev->dev.of_node, "sram", 0);
>
> Need update binding doc nxp,imx8-jpeg.yaml
Sure
More information about the linux-arm-kernel
mailing list