Skip to content

Commit 61458a2

Browse files
Maheshwar AjjamikeNG
authored andcommitted
mm-video:venc: Add required ION Heap ID for video encoder buffers
- Allocate video encoder buffers from ION_CAMERA_HEAP_ID memory for 8x55 target. Change-Id: If9d4d4d484d53bffe41940a04adf589d7d1a9ebe
1 parent 88b2da2 commit 61458a2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

mm-video/vidc/venc/inc/omx_video_base.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ class VideoHeap : public MemoryHeapBase
8383

8484
#ifdef USE_ION
8585
static const char* MEM_DEVICE = "/dev/ion";
86+
#ifdef MAX_RES_720P
87+
#define MEM_HEAP_ID ION_CAMERA_HEAP_ID
88+
#else
8689
#define MEM_HEAP_ID ION_CP_MM_HEAP_ID
90+
#endif
8791
#elif MAX_RES_720P
8892
static const char* MEM_DEVICE = "/dev/pmem_adsp";
8993
#elif MAX_RES_1080P_EBI

mm-video/vidc/venc/src/omx_video_base.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,8 +4474,12 @@ int omx_video::alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_d
44744474
if (secure_session)
44754475
alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) | ION_SECURE);
44764476
else
4477+
#ifdef MAX_RES_720P
4478+
alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
4479+
#else
44774480
alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) |
44784481
ION_HEAP(ION_IOMMU_HEAP_ID));
4482+
#endif
44794483

44804484
pthread_mutex_lock(&m_venc_ionlock);
44814485
rc = ioctl(ion_device_fd,ION_IOC_ALLOC,alloc_data);

mm-video/vidc/venc/src/video_encoder_device.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,9 +1448,13 @@ OMX_U32 venc_dev::pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count)
14481448

14491449
recon_buff[count].alloc_data.flags = 0;
14501450
recon_buff[count].alloc_data.len = size;
1451+
#ifdef MAX_RES_720P
1452+
recon_buff[count].alloc_data.heap_mask = ION_HEAP(MEM_HEAP_ID);
1453+
#else
14511454
recon_buff[count].alloc_data.heap_mask = (ION_HEAP(MEM_HEAP_ID) |
14521455
(venc_encoder->is_secure_session() ? ION_SECURE
14531456
: ION_HEAP(ION_IOMMU_HEAP_ID)));
1457+
#endif
14541458
recon_buff[count].alloc_data.align = clip2(alignment);
14551459
if (recon_buff[count].alloc_data.align != 8192)
14561460
recon_buff[count].alloc_data.align = 8192;

0 commit comments

Comments
 (0)