@@ -115,7 +115,11 @@ char ouputextradatafilename [] = "/data/extradata";
115115
116116#ifdef USE_ION
117117 #define MEM_DEVICE " /dev/ion"
118+ #ifdef MAX_RES_720P
119+ #define MEM_HEAP_ID ION_CAMERA_HEAP_ID
120+ #else
118121 #define MEM_HEAP_ID ION_CP_MM_HEAP_ID
122+ #endif
119123#elif MAX_RES_720P
120124#define MEM_DEVICE " /dev/pmem_adsp"
121125#elif MAX_RES_1080P_EBI
@@ -2925,18 +2929,9 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
29252929 else if (1 == portFmt->nPortIndex )
29262930 {
29272931 portFmt->eCompressionFormat = OMX_VIDEO_CodingUnused;
2928- #ifdef MAX_RES_720P
2929- if (0 == portFmt->nIndex )
2930- portFmt->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
2931- else if (1 == portFmt->nIndex )
2932- portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
2933- QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
2934- #endif
2935- #ifdef MAX_RES_1080P
29362932 if (0 == portFmt->nIndex )
29372933 portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
29382934 QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
2939- #endif
29402935 else if (1 == portFmt->nIndex ) {
29412936 portFmt->eColorFormat = OMX_COLOR_FormatYUV420Planar;
29422937 }
@@ -3081,6 +3076,10 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
30813076 GetAndroidNativeBufferUsageParams* nativeBuffersUsage = (GetAndroidNativeBufferUsageParams *) paramData;
30823077 if (nativeBuffersUsage->nPortIndex == OMX_CORE_OUTPUT_PORT_INDEX) {
30833078#ifdef USE_ION
3079+ #if defined (MAX_RES_720P)
3080+ nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_CAMERA_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
3081+ DEBUG_PRINT_HIGH (" ION:720P: nUsage 0x%x" ,nativeBuffersUsage->nUsage );
3082+ #else
30843083 if (secure_mode) {
30853084 DEBUG_PRINT_HIGH (" get_parameter: UNCACHED/PROTECTED/CP buffers from MM heap" );
30863085 nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_MM_HEAP | GRALLOC_USAGE_PROTECTED |
@@ -3090,6 +3089,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
30903089 DEBUG_PRINT_HIGH (" get_parameter: CACHED buffers from IOMMU heap" );
30913090 nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_IOMMU_HEAP);
30923091 }
3092+ #endif // (MAX_RES_720P)
30933093#else
30943094#if defined (MAX_RES_720P) || defined (MAX_RES_1080P_EBI)
30953095 nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_ADSP_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
@@ -8101,7 +8101,11 @@ int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
81018101 alloc_data->flags |= ION_SECURE;
81028102 }
81038103 } else {
8104+ #ifdef MAX_RES_720P
8105+ alloc_data->heap_mask = ION_HEAP (MEM_HEAP_ID);
8106+ #else
81048107 alloc_data->heap_mask = (ION_HEAP (ION_IOMMU_HEAP_ID));
8108+ #endif
81058109 }
81068110 pthread_mutex_lock (&m_vdec_ionlock);
81078111 rc = ioctl (fd,ION_IOC_ALLOC,alloc_data);
0 commit comments