exynos_omx: multi_thread: Modified Cache enable scheme.
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Wed, 11 Jul 2012 10:00:42 +0000 (19:00 +0900)
committerDima Zavin <dima@android.com>
Tue, 24 Jul 2012 22:12:42 +0000 (15:12 -0700)
the case of Buffer copy, Cache enable.

Change-Id: Idd2f96f13b6fc8fa54bc50d3931e9a8c158e82dd
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c
exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c
exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index 2eef05ee1f25638256d31184eb9dc93ceb8d43a5..b6c53bb53184cc175e829add653760a91be51441 100644 (file)
@@ -833,10 +833,12 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     /* get dpb count */
     nOutbufs = pH264Dec->hMFCH264Handle.maxDPBNum;
 
-    /* should be done before prepare output buffer */
-    if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
+    if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+        /* should be done before prepare output buffer */
+        if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     }
 
     pOutbufOps->Set_Shareable(hMFCHandle);
index 5aa9175eb8c9bb29df8dd1c0666caaeb0440a53c..2a3d1af31f38c81c2f0c155b1465b77f00a87c0b 100644 (file)
@@ -917,12 +917,13 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     /* get dpb count */
     nOutbufs = pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum;
 
-    /* should be done before prepare output buffer */
-    if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
+    if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+        /* should be done before prepare output buffer */
+        if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     }
-
     pOutbufOps->Set_Shareable(hMFCHandle);
     if (pOutbufOps->Setup(hMFCHandle, nOutbufs) != VIDEO_ERROR_NONE) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to setup output buffer");
index de7232ec0cd8cc8189793a74364711073b3c39ac..8ec23e033c8733caf3f107eb5fa4e0d4b69e2f8e 100644 (file)
@@ -728,10 +728,12 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     /* get dpb count */
     nOutbufs = pVp8Dec->hMFCVp8Handle.maxDPBNum;
 
-    /* should be done before prepare output buffer */
-    if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
+    if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+        /* should be done before prepare output buffer */
+        if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     }
 
     pOutbufOps->Set_Shareable(hMFCHandle);
index 92b07342f60cbe84e4203f666c22986d0414db23..95bdafd33a681dff2955175f82a1029ee281b6f5 100644 (file)
@@ -795,10 +795,12 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT
         inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX;
     }
 
-    /* should be done before prepare input buffer */
-    if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
+    if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+        /* should be done before prepare input buffer */
+        if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     }
 
     /* set input buffer geometry */
index 09dd7b696c3043a7b40291cbb72d96fb033f6299..516dda5d64756c6ed65ac81cb5126ba32cd85407 100644 (file)
@@ -916,10 +916,12 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA
         inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX;
     }
 
-    /* should be done before prepare input buffer */
-    if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
+    if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+        /* should be done before prepare input buffer */
+        if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) {
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     }
 
     /* set input buffer geometry */