rockchip-linux / mpp

Media Process Platform (MPP) module
602 stars 171 forks source link

Large MJEPG partition encoding failed on RK3588 when DMA heap not available #584

Open leokvw opened 7 months ago

leokvw commented 7 months ago

Context:

When hal_jpege_vepu2 deal with large frame ( > 1280X720 ), it will try to use buffer group with MPP_BUFFER_TYPE_DMA_HEAP at first. At memory allocator initialization on mpp_allocator_get, DMA heap allocator will then fallback to allocator_std for MPP_BUFFER_TYPE_NORMAL when DMA heap is inaccessible. But allocator_std_alloc don't allocate memory at all. Eventually MJPEG encoder is always failed on device.

Same userspace code worked on platforms don't have VEPU2_JPEG.

leokvw commented 7 months ago

585 @JeffyCN I have tested on our platform and it will then normally encode frame with resolution up to 4K to MJPEG.

leokvw commented 7 months ago

Related commits: https://github.com/rockchip-linux/mpp/commit/d0a89e5c75b22670ffcc39b68bef7c597bfda71b https://github.com/rockchip-linux/mpp/commit/062c17526523f22ca0ecd7c5756813e53c6b37e3

JeffyCN commented 7 months ago

@HermanChen please check it.

maybe we can try the drm allocator

HermanChen commented 7 months ago

allocator_std_alloc is just for test. The dma_heap allocator fallback patch has been merged.