summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorVidhoon Viswanathan <vidhoon@ti.com>2012-09-06 08:37:45 -0700
committerVidhoon Viswanathan <vidhoon@ti.com>2012-09-14 04:20:29 -0700
commit16e53de9ca087c5f8ac1788868146d919ec53e27 (patch)
treebdc9ee3e4509036e1bfbd1776d11faf7523e57dd /domx
parent0f9b3e3d58570cd2975447598dafe5265a11aecb (diff)
downloadhardware_ti_omap4-16e53de9ca087c5f8ac1788868146d919ec53e27.zip
hardware_ti_omap4-16e53de9ca087c5f8ac1788868146d919ec53e27.tar.gz
hardware_ti_omap4-16e53de9ca087c5f8ac1788868146d919ec53e27.tar.bz2
[FIX] Add missing Unregistration in PROXY_ComponentDeInit method
Buffer registration and unregistration was added to facilitate buffer tracking from RPMSG. Registered buffer handle should be unregistered before they are freed. Buffers are freed either in FreeBuffer or ComponentDeInit. Presently Unregister calls are included in FreeBuffer method. This patch adds them to ComponentDeInit which was missed previously. Now registered buffer handles are unregistered at all places before the buffer is freed. Change-Id: I58919b8ad6f955bf2632d18b9480b6b24dac9472 Signed-off-by: Vidhoon Viswanathan <vidhoon@ti.com>
Diffstat (limited to 'domx')
-rw-r--r--domx/omx_proxy_common/src/omx_proxy_common.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/domx/omx_proxy_common/src/omx_proxy_common.c b/domx/omx_proxy_common/src/omx_proxy_common.c
index db3fa76..c3a3e21 100644
--- a/domx/omx_proxy_common/src/omx_proxy_common.c
+++ b/domx/omx_proxy_common/src/omx_proxy_common.c
@@ -2178,11 +2178,10 @@ OMX_ERRORTYPE PROXY_ComponentDeInit(OMX_HANDLETYPE hComponent)
RPC_OMX_ErrorNone;
PROXY_COMPONENT_PRIVATE *pCompPrv;
OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
- OMX_U32 count = 0, nStride = 0;
+ OMX_U32 count = 0, nStride = 0, nPortIndex = 0;
OMX_PTR pMetaDataBuffer = NULL;
DOMX_ENTER("hComponent = %p", hComponent);
-
PROXY_assert((hComp->pComponentPrivate != NULL),
OMX_ErrorBadParameter, NULL);
@@ -2194,6 +2193,11 @@ OMX_ERRORTYPE PROXY_ComponentDeInit(OMX_HANDLETYPE hComponent)
{
if (pCompPrv->tBufList[count].pBufHeader)
{
+ //find the input or output port index
+ if(pCompPrv->tBufList[count].pBufHeader->nInputPortIndex >= 0)
+ nPortIndex = pCompPrv->tBufList[count].pBufHeader->nInputPortIndex;
+ else if(pCompPrv->tBufList[count].pBufHeader->nOutputPortIndex >= 0)
+ nPortIndex = pCompPrv->tBufList[count].pBufHeader->nOutputPortIndex;
#ifdef ALLOCATE_TILER_BUFFER_IN_PROXY
if(pCompPrv->tBufList[count].pYBuffer)
{
@@ -2232,6 +2236,29 @@ OMX_ERRORTYPE PROXY_ComponentDeInit(OMX_HANDLETYPE hComponent)
pPlatformPrivate)->pMetaDataBuffer = NULL;
}
#endif
+#ifdef USE_ION
+ {
+ // Need to unregister buffers when using ion and rpmsg
+ if (pCompPrv->tBufList[count].pRegisteredAufBux0 != NULL)
+ {
+ eTmpRPCError = RPC_UnRegisterBuffer(pCompPrv->hRemoteComp,
+ pCompPrv->tBufList[count].pRegisteredAufBux0,pCompPrv->tBufList[count].pRegisteredAufBux1,
+ pCompPrv->proxyPortBuffers[nPortIndex].proxyBufferType);
+ if (eTmpRPCError != RPC_OMX_ErrorNone) {
+ eRPCError = eTmpRPCError;
+ }
+ }
+
+ if (pCompPrv->tBufList[count].pRegisteredAufBux2 != NULL)
+ {
+ eTmpRPCError |= RPC_UnRegisterBuffer(pCompPrv->hRemoteComp,
+ pCompPrv->tBufList[count].pRegisteredAufBux2, NULL, IONPointers);
+ if (eTmpRPCError != RPC_OMX_ErrorNone) {
+ eRPCError |= eTmpRPCError;
+ }
+ }
+ }
+#endif
}
if (pCompPrv->tBufList[count].pBufHeader->pPlatformPrivate)
{