summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2013-05-31 18:40:19 +0200
committerThe Android Automerger <android-build@android.com>2013-06-05 15:37:58 -0700
commit4ff83db4ab46c0d997d0ca966fc6c94531e6b784 (patch)
treed0c2797379a505fc33b006c36036df0454847cf7
parent80fb025e6c886f2a4fced38c93307051e7528885 (diff)
downloaddevice_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.tar.gz
device_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.tar.bz2
device_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.zip
Under some circumstances, close color buffer messages in the command stream do not reach the host as the size of the undelivered commands is small. This results in refcounts of ColorBuffer never dropping to zero and color buffers not being freed. The patch calls flush at the end of rcCloseColorBuffer_enc(). In addition, the stream is flushed before it is deleted in the destructor of QemuPipeStream, since it may also have important messages. bug: 9278661 Change-Id: I46f20af8e0c272ec8d831d62f57cb2f22c7b28a7
-rw-r--r--opengl/system/OpenglSystemCommon/QemuPipeStream.cpp1
-rw-r--r--opengl/system/renderControl_enc/renderControl_enc.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp b/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp
index 50c3d8bb..a55dca0b 100644
--- a/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp
+++ b/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp
@@ -40,6 +40,7 @@ QemuPipeStream::QemuPipeStream(int sock, size_t bufSize) :
QemuPipeStream::~QemuPipeStream()
{
if (m_sock >= 0) {
+ flush();
::close(m_sock);
}
if (m_buf != NULL) {
diff --git a/opengl/system/renderControl_enc/renderControl_enc.cpp b/opengl/system/renderControl_enc/renderControl_enc.cpp
index 94e256ad..41f59d0c 100644
--- a/opengl/system/renderControl_enc/renderControl_enc.cpp
+++ b/opengl/system/renderControl_enc/renderControl_enc.cpp
@@ -311,6 +311,8 @@ void rcCloseColorBuffer_enc(void *self , uint32_t colorbuffer)
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &colorbuffer, 4); ptr += 4;
+
+ stream->flush();
}
void rcSetWindowColorBuffer_enc(void *self , uint32_t windowSurface, uint32_t colorBuffer)