fix[allocator]: fix on invalid DMA heap allocator

fallback to DRM/ION buffer when DMA heap allocator is invalid

Signed-off-by: leo <8252892+leokvw@users.noreply.github.com>
Change-Id: Ib2cd5669e6c9b41ceed7f4dd87f8fc33de88aa1c
This commit is contained in:
leo
2024-04-26 14:15:27 +08:00
committed by Herman Chen
parent 80957d2661
commit 4cc3fb25f7

View File

@@ -175,6 +175,8 @@ MPP_RET mpp_allocator_get(MppAllocator *allocator, MppAllocatorApi **api,
} break;
case MPP_BUFFER_TYPE_DMA_HEAP: {
p->os_api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap :
(mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DRM)) ? allocator_drm :
(mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_ION)) ? allocator_ion :
allocator_std;
} break;
default : {