From: SeungBeom Kim <sbcrux.kim@samsung.com> Date: Wed, 11 Jul 2012 10:00:42 +0000 (+0900) Subject: exynos_omx: multi_thread: Modified Cache enable scheme. X-Git-Tag: cm-10.1-M1~295 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa8948146ff5b51996e6e65f12d951601a65c34c;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git exynos_omx: multi_thread: Modified Cache enable scheme. the case of Buffer copy, Cache enable. Change-Id: Idd2f96f13b6fc8fa54bc50d3931e9a8c158e82dd Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com> --- diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c index 2eef05e..b6c53bb 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -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); diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 5aa9175..2a3d1af 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -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"); diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index de7232e..8ec23e0 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -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); diff --git a/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c b/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c index 92b0734..95bdafd 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -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 */ diff --git a/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 09dd7b6..516dda5 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -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 */