summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2014-03-13 12:33:39 -0700
committerSteve Kondik <steve@cyngn.com>2014-11-09 13:32:26 -0800
commit32dbabbfd0ac077751dffd92e146f61a84cb00e8 (patch)
treeea00335b0146b4fc206ff8671c805eb90414ed06
parentdc992f5acc537a9b64067492f0a00a6f20be94e8 (diff)
downloadandroid_frameworks_native-32dbabbfd0ac077751dffd92e146f61a84cb00e8.tar.gz
android_frameworks_native-32dbabbfd0ac077751dffd92e146f61a84cb00e8.tar.bz2
android_frameworks_native-32dbabbfd0ac077751dffd92e146f61a84cb00e8.zip
egl: Addition of eglGpuPerfHintQCOM.
This patch implements a wrapper that hooks into the QCOM functionality. Change-Id: Ifcb77e90ba137a4dede7d25663b032df6acc799d
-rw-r--r--opengl/libs/EGL/eglApi.cpp42
-rw-r--r--opengl/libs/EGL/egl_entries.in4
2 files changed, 45 insertions, 1 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 6e77e457b..26f4887a9 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -162,7 +162,8 @@ static const extention_map_t sExtensionMap[] = {
(!strcmp((procname), "eglSetBlobCacheFuncsANDROID") || \
!strcmp((procname), "eglHibernateProcessIMG") || \
!strcmp((procname), "eglAwakenProcessIMG") || \
- !strcmp((procname), "eglDupNativeFenceFDANDROID"))
+ !strcmp((procname), "eglDupNativeFenceFDANDROID") || \
+ !strcmp((procname), "eglGpuPerfHintQCOM"))
@@ -1554,6 +1555,45 @@ EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface,
}
// ----------------------------------------------------------------------------
+// QCOM extensions
+// ----------------------------------------------------------------------------
+#ifdef __cplusplus
+extern "C" {
+#endif
+EGLAPI EGLBoolean eglGpuPerfHintQCOM(EGLDisplay dpy, EGLContext ctx, EGLint *attrib_list);
+#ifdef __cplusplus
+}
+#endif
+
+EGLBoolean eglGpuPerfHintQCOM(EGLDisplay dpy, EGLContext ctx, EGLint *attrib_list)
+{
+ clearError();
+
+ const egl_display_ptr dp = validate_display(dpy);
+ if (!dp) return EGL_FALSE;
+
+ ContextRef _c(dp.get(), ctx);
+ if ((ctx != EGL_NO_CONTEXT) && !_c.get()) {
+ // ctx is not valid
+ return setError(EGL_BAD_CONTEXT, EGL_FALSE);
+ }
+
+ egl_context_t * c = NULL;
+ c = get_context(ctx);
+
+ EGLint result = EGL_FALSE;
+ egl_connection_t* const cnx = &gEGLImpl;
+ if (cnx->dso && cnx->egl.eglGpuPerfHintQCOM) {
+ result = cnx->egl.eglGpuPerfHintQCOM(
+ dp->disp.dpy,
+ c->context,
+ attrib_list);
+ }
+ return result;
+
+}
+
+// ----------------------------------------------------------------------------
// NVIDIA extensions
// ----------------------------------------------------------------------------
EGLuint64NV eglGetSystemTimeFrequencyNV()
diff --git a/opengl/libs/EGL/egl_entries.in b/opengl/libs/EGL/egl_entries.in
index 70d0e52fd..aa92ea083 100644
--- a/opengl/libs/EGL/egl_entries.in
+++ b/opengl/libs/EGL/egl_entries.in
@@ -81,6 +81,10 @@ EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint
EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLint, eglDupNativeFenceFDANDROID, EGLDisplay, EGLSyncKHR)
+/* QCOM extensions */
+
+EGL_ENTRY(EGLBoolean, eglGpuPerfHintQCOM, EGLDisplay, EGLContext, EGLint *)
+
/* NVIDIA extensions */
EGL_ENTRY(EGLuint64NV, eglGetSystemTimeFrequencyNV, void)