summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-11-29 17:55:46 -0800
committer Mathias Agopian <mathias@google.com> 2011-11-29 18:00:35 -0800
commitcadd325aff7354be23d3bccb4f53b603f1506c9f (patch)
tree1d9621d70c04d9b89a95144c575cb640fa41462c
parentf296ee697409b4b55bef17d534edbc24a4619f0f (diff)
add a way to access the version string of the h/w implementation of EGL
we use a hidden egl extension. the version string is printed in SF's dumpsys log. Change-Id: I123eb4bde6de462bb2404c67b74d6d6219a48d6a
-rw-r--r--opengl/libs/EGL/eglApi.cpp8
-rw-r--r--opengl/specs/README3
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp10
3 files changed, 19 insertions, 2 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index a63d5b054d00..2b0ed5dfd654 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -49,6 +49,8 @@ using namespace android;
// ----------------------------------------------------------------------------
+#define EGL_VERSION_HW_ANDROID 0x3143
+
struct extention_map_t {
const char* name;
__eglMustCastToProperFunctionPointerType address;
@@ -972,6 +974,12 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name)
return dp->getExtensionString();
case EGL_CLIENT_APIS:
return dp->getClientApiString();
+ case EGL_VERSION_HW_ANDROID: {
+ if (gEGLImpl[IMPL_HARDWARE].dso) {
+ return dp->disp[IMPL_HARDWARE].queryString.version;
+ }
+ return dp->disp[IMPL_SOFTWARE].queryString.version;
+ }
}
return setError(EGL_BAD_PARAMETER, (const char *)0);
}
diff --git a/opengl/specs/README b/opengl/specs/README
index 2fa258777f7f..16b278fd49be 100644
--- a/opengl/specs/README
+++ b/opengl/specs/README
@@ -9,4 +9,5 @@ for use by Android extensions.
0x3140 EGL_ANDROID_image_native_buffer
0x3141 (unused)
0x3142 EGL_ANDROID_recordable
-0x3143 - 0x314F (unused)
+0x3143 EGL_VERSION_HW_ANDROID (internal use)
+0x3144 - 0x314F (unused)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1b00e9380a62..f38e94814587 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -65,6 +65,8 @@
#define AID_GRAPHICS 1003
#endif
+#define EGL_VERSION_HW_ANDROID 0x3143
+
#define DISPLAY_COUNT 1
namespace android {
@@ -1527,7 +1529,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
* Dump the layers in the purgatory
*/
- const size_t purgatorySize = mLayerPurgatory.size();
+ const size_t purgatorySize = mLayerPurgatory.size();
snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
result.append(buffer);
for (size_t i=0 ; i<purgatorySize ; i++) {
@@ -1548,6 +1550,12 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
extensions.getRenderer(),
extensions.getVersion());
result.append(buffer);
+
+ snprintf(buffer, SIZE, "EGL : %s\n",
+ eglQueryString(graphicPlane(0).getEGLDisplay(),
+ EGL_VERSION_HW_ANDROID));
+ result.append(buffer);
+
snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
result.append(buffer);