RE: [PATCH] media: videobuf2-dma-sg: limit the sg segment size

From: Hui Fang
Date: Wed Aug 30 2023 - 15:17:45 EST


On Mon, Aug 28, 2023 at 8:57 AM Anle Pan <anle.pan@xxxxxxx> wrote:
>
> When allocating from pages, the size of the sg segment is unlimited and the
> default is UINT_MAX. This will cause the DMA stream mapping failed later
> with a "swiotlb buffer full" error. The default maximum mapping size is 128
> slots x 2K = 256K, determined by "IO_TLB_SEGSIZE".
> To fix the issue, limit the sg segment size according to
> "dma_max_mapping_size" to match the mapping limit.

I wonder if only NXP met the "swiotlb buffer full" issue. In theory,
when format is YUYV, those resolutions no greater than 320x240 (153600 bytes,
which less than the max mapping size 256K ) can't meet the issue.
But resolutions no less than 640x480 (307200 bytes), may have chances to
trigger the issue.

BRs,
FangHui