aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-pipe-net.c
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2011-09-12 18:21:58 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-09-13 18:41:10 +0200
commit7b56a4a9a250573d5bdb8d04a2d8a64937432832 (patch)
tree2a0173464a0b4c19e3d6cff2aef93649acb86700 /android/hw-pipe-net.c
parent4939812780883255043a09eceaf607263f30fde4 (diff)
downloadexternal_qemu-7b56a4a9a250573d5bdb8d04a2d8a64937432832.zip
external_qemu-7b56a4a9a250573d5bdb8d04a2d8a64937432832.tar.gz
external_qemu-7b56a4a9a250573d5bdb8d04a2d8a64937432832.tar.bz2
gles: use fast GLES pipe by default (Unix only)
This improves performance of various benchmarks by 5% Change-Id: If2d2be0e9849429ecffe52b7d482cfbee4008473
Diffstat (limited to 'android/hw-pipe-net.c')
-rw-r--r--android/hw-pipe-net.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/android/hw-pipe-net.c b/android/hw-pipe-net.c
index 8b8017d..193d60b 100644
--- a/android/hw-pipe-net.c
+++ b/android/hw-pipe-net.c
@@ -474,10 +474,21 @@ openglesPipe_init( void* hwpipe, void* _looper, const char* args )
return NULL;
}
- /* For now, simply connect through tcp */
- snprintf(temp, sizeof temp, "%d", ANDROID_OPENGLES_BASE_PORT);
- pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, temp);
-
+#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);
+ } 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);
+ D("Creating TCP OpenGLES pipe for GPU emulation!");
+ }
if (pipe != NULL) {
// Disable TCP nagle algorithm to improve throughput of small packets
socket_set_nodelay(pipe->io->fd);