summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-10-29 09:55:08 +0100
committerDavid 'Digit' Turner <digit@google.com>2014-10-30 09:37:14 +0100
commit1c9492dd19ae71d4702e1057dca27bde84080557 (patch)
tree94114bef737073c856d9250b062bb4bdd532208e /opengl
parentdc69376bd3d1c65ad19abfc036a85266b2199136 (diff)
downloadandroid_device_generic_goldfish-1c9492dd19ae71d4702e1057dca27bde84080557.tar.gz
android_device_generic_goldfish-1c9492dd19ae71d4702e1057dca27bde84080557.tar.bz2
android_device_generic_goldfish-1c9492dd19ae71d4702e1057dca27bde84080557.zip
Fix GPU emulation crash.
This patch fixes the crash that occurs during boot when the boot animation starts. The main issue is that the wrong version of glGenTextures_enc() was being called. The root issue is that libGLESv1_CM_emulation.so, which implements the GLESv1 API in the system, is linked to both libGLESv2_enc.so and libGLESv1_enc.so which both provided a glGenTextures_enc() function, used to encode a glGenTextures() command call into the wire protocol. Until recently, and due to pure luck, the function call in libGLESv1_CM_emulation.so was resolved to the function in libGLESv1.so, which is the correct version to use from this library. However, due to recent changes in the dynamic linker's symbol resolution implementation, the version in libGLESv2.so was being used instead. The bug is really in our library and this patch provides a fix by removing the duplicate functions, with the help of C++ namespaces. NOTE: This patch modifies auto-generated code. A better fix would be to fix the generator, then refresh the sources with its new output. However, several other manual patches have been performed on these files in the past too to fix other issues, so doing so would lose the fixes. A future patch will update the generator, and refresh all sources accordingly. This is a "quick-fix" to get us to a proper booting state. NOTE: Even after applying this patch, the system boots to the 'home screen' but fails to display the boot animation. BUG=18146046 Change-Id: I48cab73ad583e303723340e80d19a82fa301b61d
Diffstat (limited to 'opengl')
-rw-r--r--opengl/system/GLESv1_enc/gl_enc.cpp5
-rw-r--r--opengl/system/GLESv1_enc/gl_enc.h3
-rw-r--r--opengl/system/GLESv2_enc/gl2_enc.cpp7
-rw-r--r--opengl/system/GLESv2_enc/gl2_enc.h3
4 files changed, 18 insertions, 0 deletions
diff --git a/opengl/system/GLESv1_enc/gl_enc.cpp b/opengl/system/GLESv1_enc/gl_enc.cpp
index 0a343df..019c409 100644
--- a/opengl/system/GLESv1_enc/gl_enc.cpp
+++ b/opengl/system/GLESv1_enc/gl_enc.cpp
@@ -7,6 +7,7 @@
#include "gl_enc.h"
+namespace glesv1_enc {
#include <stdio.h>
static void enc_unsupported()
@@ -4885,6 +4886,10 @@ void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask)
memcpy(ptr, &preserveMask, 4); ptr += 4;
}
+} // namespace glesv1_enc
+
+using namespace glesv1_enc;
+
gl_encoder_context_t::gl_encoder_context_t(IOStream *stream)
{
m_stream = stream;
diff --git a/opengl/system/GLESv1_enc/gl_enc.h b/opengl/system/GLESv1_enc/gl_enc.h
index d8a23e4..768102c 100644
--- a/opengl/system/GLESv1_enc/gl_enc.h
+++ b/opengl/system/GLESv1_enc/gl_enc.h
@@ -20,6 +20,7 @@ struct gl_encoder_context_t : public gl_client_context_t {
};
+#if 0
extern "C" {
void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref);
void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
@@ -313,4 +314,6 @@ extern "C" {
void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask);
};
+#endif // 0
+
#endif \ No newline at end of file
diff --git a/opengl/system/GLESv2_enc/gl2_enc.cpp b/opengl/system/GLESv2_enc/gl2_enc.cpp
index 5929697..9a5c1b4 100644
--- a/opengl/system/GLESv2_enc/gl2_enc.cpp
+++ b/opengl/system/GLESv2_enc/gl2_enc.cpp
@@ -9,6 +9,9 @@
#include <stdio.h>
+
+namespace glesv2_enc {
+
static void enc_unsupported()
{
ALOGE("Function is unsupported\n");
@@ -2914,6 +2917,10 @@ int glFinishRoundTrip_enc(void *self )
return retval;
}
+} // namespace glesv2_enc
+
+using namespace glesv2_enc;
+
gl2_encoder_context_t::gl2_encoder_context_t(IOStream *stream)
{
m_stream = stream;
diff --git a/opengl/system/GLESv2_enc/gl2_enc.h b/opengl/system/GLESv2_enc/gl2_enc.h
index b1b456a..4a5432b 100644
--- a/opengl/system/GLESv2_enc/gl2_enc.h
+++ b/opengl/system/GLESv2_enc/gl2_enc.h
@@ -21,6 +21,7 @@ struct gl2_encoder_context_t : public gl2_client_context_t {
};
+#if 0
extern "C" {
void glActiveTexture_enc(void *self , GLenum texture);
void glAttachShader_enc(void *self , GLuint program, GLuint shader);
@@ -231,4 +232,6 @@ extern "C" {
void glShaderString_enc(void *self , GLuint shader, const GLchar* string, GLsizei len);
int glFinishRoundTrip_enc(void *self );
};
+#endif // 0
+
#endif