diff options
author | Jason Sams <rjsams@android.com> | 2011-01-18 18:12:26 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2011-01-18 18:12:26 -0800 |
commit | d1ac98149737299513da1357e36f68cbb6d74425 (patch) | |
tree | d59875cb9ab74b735cd2d417d42020d1a5b5158e /libs/rs | |
parent | 991040c8261237997915f8a4c899a6ea5012fb42 (diff) | |
download | frameworks_base-d1ac98149737299513da1357e36f68cbb6d74425.zip frameworks_base-d1ac98149737299513da1357e36f68cbb6d74425.tar.gz frameworks_base-d1ac98149737299513da1357e36f68cbb6d74425.tar.bz2 |
Fix race condition between GC thread and
the teardown of RS. The RS context was going away while
the objects were being deleted within the finializer.
Add more debugging for playCoreCommands.
Change-Id: I391f0b4db948f43f54017b47b062ab47d6a1ef64
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/rsLocklessFifo.cpp | 16 | ||||
-rw-r--r-- | libs/rs/rsLocklessFifo.h | 2 | ||||
-rw-r--r-- | libs/rs/rsThreadIO.cpp | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 804c767..eb2af1c 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -210,3 +210,19 @@ void LocklessCommandFifo::makeSpace(uint32_t bytes) { void LocklessCommandFifo::dumpState(const char *s) const { LOGV("%s %p put %p, get %p, buf %p, end %p", s, this, mPut, mGet, mBuffer, mEnd); } + +void LocklessCommandFifo::printDebugData() const { + dumpState("printing fifo debug"); + const uint32_t *pptr = (const uint32_t *)mGet; + pptr -= 8 * 4; + if (mGet < mBuffer) { + pptr = (const uint32_t *)mBuffer; + } + + + for (int ct=0; ct < 16; ct++) { + LOGV("fifo %p = 0x%08x 0x%08x 0x%08x 0x%08x", pptr, pptr[0], pptr[1], pptr[2], pptr[3]); + pptr += 4; + } + +} diff --git a/libs/rs/rsLocklessFifo.h b/libs/rs/rsLocklessFifo.h index c963963..eabdc3e 100644 --- a/libs/rs/rsLocklessFifo.h +++ b/libs/rs/rsLocklessFifo.h @@ -35,6 +35,8 @@ public: bool init(uint32_t size); void shutdown(); + void printDebugData() const; + LocklessCommandFifo(); ~LocklessCommandFifo(); diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index 001ac55..6cf07de 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -56,6 +56,7 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand) { if (cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) { rsAssert(cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *))); LOGE("playCoreCommands error con %p, cmd %i", con, cmdID); + mToCore.printDebugData(); } gPlaybackFuncs[cmdID](con, data); mToCore.next(); |