summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-01-19 18:02:20 -0800
committerMathias Agopian <mathias@google.com>2011-01-20 12:10:11 -0800
commit2bd1d95efecffad447afd682ffe605bbf8c79d62 (patch)
treebadce3769c146bd7fae5c5a72cb642a7c6bdfd46 /libs/surfaceflinger_client
parent0b181742aa8c63953802ffca8dee9498de8e146d (diff)
downloadframeworks_native-2bd1d95efecffad447afd682ffe605bbf8c79d62.zip
frameworks_native-2bd1d95efecffad447afd682ffe605bbf8c79d62.tar.gz
frameworks_native-2bd1d95efecffad447afd682ffe605bbf8c79d62.tar.bz2
clean-up unneeded code
now that we removed the notion of a "inUse" buffer in surfaceflinger a lot of code can be simplified / removed. noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete" is also gone. Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
Diffstat (limited to 'libs/surfaceflinger_client')
-rw-r--r--libs/surfaceflinger_client/SharedBufferStack.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/libs/surfaceflinger_client/SharedBufferStack.cpp b/libs/surfaceflinger_client/SharedBufferStack.cpp
index af11f97..7505d53 100644
--- a/libs/surfaceflinger_client/SharedBufferStack.cpp
+++ b/libs/surfaceflinger_client/SharedBufferStack.cpp
@@ -58,7 +58,6 @@ SharedBufferStack::SharedBufferStack()
void SharedBufferStack::init(int32_t i)
{
- inUse = -2;
status = NO_ERROR;
identity = i;
}
@@ -199,9 +198,9 @@ String8 SharedBufferBase::dump(char const* prefix) const
SharedBufferStack& stack( *mSharedStack );
snprintf(buffer, SIZE,
"%s[ head=%2d, available=%2d, queued=%2d ] "
- "reallocMask=%08x, inUse=%2d, identity=%d, status=%d",
+ "reallocMask=%08x, identity=%d, status=%d",
prefix, stack.head, stack.available, stack.queued,
- stack.reallocMask, stack.inUse, stack.identity, stack.status);
+ stack.reallocMask, stack.identity, stack.status);
result.append(buffer);
result.append("\n");
return result;
@@ -302,22 +301,6 @@ ssize_t SharedBufferClient::CancelUpdate::operator()() {
return NO_ERROR;
}
-SharedBufferServer::UnlockUpdate::UnlockUpdate(
- SharedBufferBase* sbb, int lockedBuffer)
- : UpdateBase(sbb), lockedBuffer(lockedBuffer) {
-}
-ssize_t SharedBufferServer::UnlockUpdate::operator()() {
- if (stack.inUse != lockedBuffer) {
- LOGE("unlocking %d, but currently locked buffer is %d "
- "(identity=%d, token=%d)",
- lockedBuffer, stack.inUse,
- stack.identity, stack.token);
- return BAD_VALUE;
- }
- android_atomic_write(-1, &stack.inUse);
- return NO_ERROR;
-}
-
SharedBufferServer::RetireUpdate::RetireUpdate(
SharedBufferBase* sbb, int numBuffers)
: UpdateBase(sbb), numBuffers(numBuffers) {
@@ -327,9 +310,6 @@ ssize_t SharedBufferServer::RetireUpdate::operator()() {
if (uint32_t(head) >= SharedBufferStack::NUM_BUFFER_MAX)
return BAD_VALUE;
- // Preventively lock the current buffer before updating queued.
- android_atomic_write(stack.headBuf, &stack.inUse);
-
// Decrement the number of queued buffers
int32_t queued;
do {
@@ -345,7 +325,6 @@ ssize_t SharedBufferServer::RetireUpdate::operator()() {
head = (head + 1) % numBuffers;
const int8_t headBuf = stack.index[head];
stack.headBuf = headBuf;
- android_atomic_write(headBuf, &stack.inUse);
// head is only modified here, so we don't need to use cmpxchg
android_atomic_write(head, &stack.head);
@@ -546,13 +525,6 @@ ssize_t SharedBufferServer::retireAndLock()
return buf;
}
-status_t SharedBufferServer::unlock(int buf)
-{
- UnlockUpdate update(this, buf);
- status_t err = updateCondition( update );
- return err;
-}
-
void SharedBufferServer::setStatus(status_t status)
{
if (status < NO_ERROR) {
@@ -694,12 +666,6 @@ status_t SharedBufferServer::shrink(int newNumBuffers)
stack.head = 0;
stack.headBuf = 0;
- // If one of the buffers is in use it must be the head buffer, which we are
- // renaming to buffer 0.
- if (stack.inUse > 0) {
- stack.inUse = 0;
- }
-
// Free the buffers from the end of the list that are no longer needed.
for (int i = newNumBuffers; i < mNumBuffers; i++) {
mBufferList.remove(i);