From 11a263d3a66d58a075b43e89af43fbbb3383e86d Mon Sep 17 00:00:00 2001 From: ChenHengming Date: Fri, 21 Aug 2015 07:23:29 +0000 Subject: [PATCH] [osal/android]: fix ion heap id on 5.1 git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@147 6e48237b-75ef-9749-8fc9-41990f28c85a --- osal/android/os_allocator.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osal/android/os_allocator.c b/osal/android/os_allocator.c index 0112488f..59c99031 100644 --- a/osal/android/os_allocator.c +++ b/osal/android/os_allocator.c @@ -28,7 +28,7 @@ #include "mpp_log.h" typedef struct { - RK_U32 alignment; + RK_U32 alignment; } allocator_ctx_normal; MPP_RET os_allocator_normal_open(void **ctx, size_t alignment) @@ -169,8 +169,9 @@ static int ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, } typedef struct { - RK_U32 alignment; - RK_S32 ion_device; + RK_U32 alignment; + RK_S32 ion_device; + RK_U32 heap_id; } allocator_ctx_ion; MPP_RET os_allocator_ion_open(void **ctx, size_t alignment) @@ -201,6 +202,7 @@ MPP_RET os_allocator_ion_open(void **ctx, size_t alignment) } else { p->alignment = alignment; p->ion_device = fd; + p->heap_id = ION_HEAP_TYPE_SYSTEM_CONTIG; /* ION_HEAP_TYPE_CARVEOUT */ *ctx = p; } @@ -219,7 +221,7 @@ MPP_RET os_allocator_ion_alloc(void *ctx, MppBufferInfo *info) p = (allocator_ctx_ion *)ctx; ret = ion_alloc(p->ion_device, info->size, p->alignment, - ION_HEAP_TYPE_CARVEOUT, 0, + p->heap_id, 0, (ion_user_handle_t *)&info->hnd); if (ret) { mpp_err("os_allocator_ion_alloc ion_alloc failed ret %d\n", ret);