Implement RS VSync on new vsync infrastructure.
Change-Id: I662159a086a56e28732dd64a3a3cb30f8d4b72b1
Replace lockless fifo from server to client with sockets.
Change-Id: I99a4ab4f18496c0fbac96ee7b8099797af4712ea
diff --git a/libs/rs/rsThreadIO.h b/libs/rs/rsThreadIO.h
index ebce0ab..d56a1c9 100644
--- a/libs/rs/rsThreadIO.h
+++ b/libs/rs/rsThreadIO.h
@@ -18,7 +18,6 @@
#define ANDROID_RS_THREAD_IO_H
#include "rsUtils.h"
-#include "rsLocklessFifo.h"
#include "rsFifoSocket.h"
// ---------------------------------------------------------------------------
@@ -32,23 +31,17 @@
ThreadIO();
~ThreadIO();
- void init(bool useSocket = false);
+ void init();
void shutdown();
// Plays back commands from the client.
// Returns true if any commands were processed.
- bool playCoreCommands(Context *con, bool waitForCommand, uint64_t timeToWait);
+ bool playCoreCommands(Context *con, bool waitForCommand, int waitFd);
- void setTimoutCallback(void (*)(void *), void *, uint64_t timeout);
- //LocklessCommandFifo mToCore;
+ void setTimeoutCallback(void (*)(void *), void *, uint64_t timeout);
-
-
- void coreFlush();
void * coreHeader(uint32_t, size_t dataLen);
- void coreData(const void *data, size_t dataLen);
void coreCommit();
- void coreCommitSync();
void coreSetReturn(const void *data, size_t dataLen);
void coreGetReturn(void *data, size_t dataLen);
@@ -71,20 +64,16 @@
} ClientCmdHeader;
ClientCmdHeader mLastClientHeader;
- size_t mCoreCommandSize;
- uint32_t mCoreCommandID;
- uint8_t * mCoreDataPtr;
- uint8_t * mCoreDataBasePtr;
+ bool mRunning;
- bool mUsingSocket;
- LocklessCommandFifo mToClient;
- LocklessCommandFifo mToCore;
-
- FifoSocket mToClientSocket;
- FifoSocket mToCoreSocket;
+ FifoSocket mToClient;
+ FifoSocket mToCore;
intptr_t mToCoreRet;
+ size_t mSendLen;
+ uint8_t mSendBuffer[2 * 1024];
+
};