summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a76be29)
raw | patch | inline | side by side (parent: a76be29)
author | Frank Livingston <frank-livingston@ti.com> | |
Thu, 26 Jan 2017 22:46:31 +0000 (16:46 -0600) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Thu, 26 Jan 2017 22:46:31 +0000 (16:46 -0600) |
pasdk/common/dbgDib.c | patch | blob | history |
diff --git a/pasdk/common/dbgDib.c b/pasdk/common/dbgDib.c
index a56fef2e0bcabef8db261365f916c0fdcba61b0c..03ec55a750ee790cc462595fe3fd37a2d1a229d4 100644 (file)
--- a/pasdk/common/dbgDib.c
+++ b/pasdk/common/dbgDib.c
#include <xdc/std.h>
#include <xdc/runtime/Log.h>
+#include <ti/sysbios/hal/Cache.h>
#include "common.h"
Int32 gCapIbBufIdx[2]={0,0};
Int32 gCapIbBufWrapCnt[2]={0,0};
Int8 gCapIbBufPingPongSel=1;
+Int32 gCapIbAccBytes=0;
Int32 gNumDiffFrame[2]={0,0};
#endif // CAP_IP
gCapIbBufIdx[gCapIbBufPingPongSel] = 0;
gCapIbBufWrapCnt[gCapIbBufPingPongSel] = 0;
gNumDiffFrame[gCapIbBufPingPongSel] = 0;
+ gCapIbAccBytes=0;
return 0;
}
PAF_InpBufConfig *pInpBufConfig
)
{
- UInt32 nBytes;
+ UInt32 nBytes, bufEnd, currentBufSize, chunkSize, wrapSize;
nBytes = pInpBufConfig->frameLength * pInpBufConfig->sizeofElement;
}
#endif
+ bufEnd = (Int) pInpBufConfig->base.pVoid + pInpBufConfig->sizeofBuffer;
+ currentBufSize = (bufEnd - (Int)pInpBufConfig->pntr.pSmInt);
+
+ if (currentBufSize >= nBytes)
+ chunkSize = nBytes;
+ else
+ chunkSize = currentBufSize;
+
+ wrapSize = nBytes - chunkSize;
+
if ((CAP_IB_BUF_SZ - gCapIbBufIdx[gCapIbBufPingPongSel]) < nBytes)
{
//return; // fixed buffer
gCapIbBufWrapCnt[gCapIbBufPingPongSel]++;
}
- memcpy(&gCapIbBuf[gCapIbBufPingPongSel][gCapIbBufIdx[gCapIbBufPingPongSel]], pInpBufConfig->pntr.pSmInt, nBytes);
- gCapIbBufIdx[gCapIbBufPingPongSel] += nBytes;
+ // invalidate input data
+ Cache_inv((Ptr)pInpBufConfig->pntr.pSmInt, chunkSize, Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ memcpy(&gCapIbBuf[gCapIbBufPingPongSel][gCapIbBufIdx[gCapIbBufPingPongSel]], pInpBufConfig->pntr.pSmInt, chunkSize);
+
+ gCapIbBufIdx[gCapIbBufPingPongSel] += chunkSize;
+ gCapIbAccBytes += chunkSize;
+
+ if(wrapSize > 0)
+ {
+ // invalidate input data
+ Cache_inv((Ptr)pInpBufConfig->base.pSmInt, wrapSize, Cache_Type_ALLD, 0);
+ Cache_wait();
+ memcpy(&gCapIbBuf[gCapIbBufPingPongSel][gCapIbBufIdx[gCapIbBufPingPongSel]], pInpBufConfig->base.pSmInt, wrapSize);
+ gCapIbBufIdx[gCapIbBufPingPongSel] += wrapSize;
+ gCapIbAccBytes += wrapSize;
+ }
}
#endif // CAP_IP