aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-pipe-net.c
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-07-11 16:48:28 -0700
committerJesse Hall <jessehall@google.com>2012-07-11 16:48:28 -0700
commit055adab0b70c70890634649a27c12b2c25afcaca (patch)
tree4338811f487cd81e377017016e3a1779bcd3a7e6 /android/hw-pipe-net.c
parenta593847491224cfab9eb94b1e36c85333dc081da (diff)
downloadexternal_qemu-055adab0b70c70890634649a27c12b2c25afcaca.zip
external_qemu-055adab0b70c70890634649a27c12b2c25afcaca.tar.gz
external_qemu-055adab0b70c70890634649a27c12b2c25afcaca.tar.bz2
Use a per-process server address for the GLES server
Previously we used a hardcoded address (tcp port, unix pipe path, etc.) for the OpenGLRender system. Multiple emulators would all try to listen on the same address, with the system non-deterministically (?) choosing which one accepted each new connection. This resulted in frames going to the wrong emulator window, one emulator shutting down another's OpenGL system, etc. Now the OpenGLRender server requests an unused tcp port or derives a path from the pid, and reports the address back to the emulator client to use for future connections from the guest. Change-Id: I139d32615200b36b87f2d2ede4abb4060ec02776
Diffstat (limited to 'android/hw-pipe-net.c')
-rw-r--r--android/hw-pipe-net.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/android/hw-pipe-net.c b/android/hw-pipe-net.c
index 3e8dc70..1c71f18 100644
--- a/android/hw-pipe-net.c
+++ b/android/hw-pipe-net.c
@@ -492,19 +492,18 @@ openglesPipe_init( void* hwpipe, void* _looper, const char* args )
return NULL;
}
+ char server_addr[PATH_MAX];
+ android_gles_server_path(server_addr, sizeof(server_addr));
#ifndef _WIN32
if (android_gles_fast_pipes) {
- char unix_path[PATH_MAX];
- android_gles_unix_path(unix_path, sizeof(unix_path), ANDROID_OPENGLES_BASE_PORT);
- pipe = (NetPipe *)netPipe_initUnix(hwpipe, _looper, unix_path);
- D("Creating Unix OpenGLES pipe for GPU emulation: %s", unix_path);
+ pipe = (NetPipe *)netPipe_initUnix(hwpipe, _looper, server_addr);
+ D("Creating Unix OpenGLES pipe for GPU emulation: %s", server_addr);
} else {
#else /* _WIN32 */
{
#endif
/* Connect through TCP as a fallback */
- snprintf(temp, sizeof temp, "%d", ANDROID_OPENGLES_BASE_PORT);
- pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, temp);
+ pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, server_addr);
D("Creating TCP OpenGLES pipe for GPU emulation!");
}
if (pipe != NULL) {