summaryrefslogtreecommitdiffstats
path: root/opengl/system
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2013-05-31 18:40:19 +0200
committerkeunyoung <keunyoung@google.com>2013-06-04 12:33:21 -0700
commit1b87456faa939b8a76a54336818131fb72b85ca6 (patch)
treed0c2797379a505fc33b006c36036df0454847cf7 /opengl/system
parent30717de92454be87aa55ac91d2b94a7872a0fcfb (diff)
downloadandroid_device_generic_goldfish-1b87456faa939b8a76a54336818131fb72b85ca6.tar.gz
android_device_generic_goldfish-1b87456faa939b8a76a54336818131fb72b85ca6.tar.bz2
android_device_generic_goldfish-1b87456faa939b8a76a54336818131fb72b85ca6.zip
Flush QemuPipeStream when needed
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
Diffstat (limited to 'opengl/system')
-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 50c3d8b..a55dca0 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 94e256a..41f59d0 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)