diff options
author | Kyle Repinski <repinski23@gmail.com> | 2016-03-02 14:02:14 -0600 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2017-01-17 00:00:19 +0100 |
commit | 91cd225e2f695d965b967390279666cf74f53a8b (patch) | |
tree | a323096b434c8eb13122f27a371be8901d8b5c24 | |
parent | d0cdb651c667befccb285d853a7bdded74822bb8 (diff) | |
download | hardware_ti_omap4-91cd225e2f695d965b967390279666cf74f53a8b.tar.gz hardware_ti_omap4-91cd225e2f695d965b967390279666cf74f53a8b.tar.bz2 hardware_ti_omap4-91cd225e2f695d965b967390279666cf74f53a8b.zip |
Add open-source implementation of the libEGL_POWERVR shim.
Change-Id: I411c1d957d5b011e922a5c1791712717997b3462
-rw-r--r-- | common.mk | 1 | ||||
-rw-r--r-- | libEGL_POWERVR/Android.mk | 20 | ||||
-rw-r--r-- | libEGL_POWERVR/egl.c | 171 | ||||
-rw-r--r-- | libEGL_POWERVR/egl.h | 62 |
4 files changed, 254 insertions, 0 deletions
@@ -40,6 +40,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ libion.so \ pvrsrvinit \ + libEGL_POWERVR_SGX54X \ libPVRScopeServices.so # compatiblity for older binaries diff --git a/libEGL_POWERVR/Android.mk b/libEGL_POWERVR/Android.mk new file mode 100644 index 0000000..ef9d738 --- /dev/null +++ b/libEGL_POWERVR/Android.mk @@ -0,0 +1,20 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +ifeq ($(TARGET_BOARD_OMAP_CPU),4470) +LOCAL_SGX_CORE := 544_112 +else +LOCAL_SGX_CORE := 540_120 +endif + +LOCAL_SRC_FILES := egl.c +LOCAL_CFLAGS := -Wall -Werror +LOCAL_LDFLAGS := -L $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) +LOCAL_LDLIBS := -lIMGegl_SGX$(LOCAL_SGX_CORE) +libEGL_POWERVR_SGX54X: $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libIMGegl_SGX$(LOCAL_SGX_CORE).so +LOCAL_MODULE := libEGL_POWERVR_SGX54X + +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/egl +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/libEGL_POWERVR/egl.c b/libEGL_POWERVR/egl.c new file mode 100644 index 0000000..b5ebeca --- /dev/null +++ b/libEGL_POWERVR/egl.c @@ -0,0 +1,171 @@ +#include "egl.h" + +EGLint eglGetError(void) +{ + return IMGeglGetError(); +} + +EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id) +{ + return IMGeglGetDisplay(display_id); +} + +EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) +{ + return IMGeglInitialize(dpy, major, minor); +} + +EGLBoolean eglTerminate(EGLDisplay dpy) +{ + return IMGeglTerminate(dpy); +} + +const char * eglQueryString(EGLDisplay dpy, EGLint name) +{ + return IMGeglQueryString(dpy, name); +} + +void (* eglGetProcAddress(const char *procname))(void) +{ + return IMGeglGetProcAddress(procname); +} + +EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) +{ + return IMGeglGetConfigs(dpy, configs, config_size, num_config); +} + +EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) +{ + return IMGeglChooseConfig(dpy, attrib_list, configs, config_size, num_config); +} + +EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) +{ + return IMGeglGetConfigAttrib(dpy, config, attribute, value); +} + +EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list) +{ + return IMGeglCreateWindowSurface(dpy, config, win, attrib_list); +} + +EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list) +{ + return IMGeglCreatePixmapSurface(dpy, config, pixmap, attrib_list); +} + +EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) +{ + return IMGeglCreatePbufferSurface(dpy, config, attrib_list); +} + +EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) +{ + return IMGeglDestroySurface(dpy, surface); +} + +EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) +{ + return IMGeglQuerySurface(dpy, surface, attribute, value); +} + +EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list) +{ + return IMGeglCreateContext(dpy, config, share_context, attrib_list); +} + +EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) +{ + return IMGeglDestroyContext(dpy, ctx); +} + +EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) +{ + return IMGeglMakeCurrent(dpy, draw, read, ctx); +} + +EGLContext eglGetCurrentContext(void) +{ + return IMGeglGetCurrentContext(); +} + +EGLSurface eglGetCurrentSurface(EGLint readdraw) +{ + return IMGeglGetCurrentSurface(readdraw); +} + +EGLDisplay eglGetCurrentDisplay(void) +{ + return IMGeglGetCurrentDisplay(); +} + +EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value) +{ + return IMGeglQueryContext(dpy, ctx, attribute, value); +} + +EGLBoolean eglWaitGL(void) +{ + return IMGeglWaitGL(); +} + +EGLBoolean eglWaitNative(EGLint engine) +{ + return IMGeglWaitNative(engine); +} + +EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) +{ + return IMGeglSwapBuffers(dpy, draw); +} + +EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) +{ + return IMGeglCopyBuffers(dpy, surface, target); +} + +EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) +{ + return IMGeglSwapInterval(dpy, interval); +} + +EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) +{ + return IMGeglSurfaceAttrib(dpy, surface, attribute, value); +} + +EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + return IMGeglBindTexImage(dpy, surface, buffer); +} + +EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) +{ + return IMGeglReleaseTexImage(dpy, surface, buffer); +} + +EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list) +{ + return IMGeglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list); +} + +EGLBoolean eglBindAPI(EGLenum api) +{ + return IMGeglBindAPI(api); +} + +EGLenum eglQueryAPI(void) +{ + return IMGeglQueryAPI(); +} + +EGLBoolean eglWaitClient(void) +{ + return IMGeglWaitClient(); +} + +EGLBoolean eglReleaseThread(void) +{ + return IMGeglReleaseThread(); +} diff --git a/libEGL_POWERVR/egl.h b/libEGL_POWERVR/egl.h new file mode 100644 index 0000000..d4e91c5 --- /dev/null +++ b/libEGL_POWERVR/egl.h @@ -0,0 +1,62 @@ +#ifndef __PVREGL_H__ +#define __PVREGL_H__ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef int32_t EGLint; +typedef unsigned int EGLBoolean; +typedef unsigned int EGLenum; +typedef void *EGLConfig; +typedef void *EGLContext; +typedef void *EGLDisplay; +typedef void *EGLSurface; +typedef void *EGLClientBuffer; +typedef int EGLNativeDisplayType; +typedef void *EGLNativeWindowType; +typedef void *EGLNativePixmapType; + +EGLint IMGeglGetError(void); +EGLDisplay IMGeglGetDisplay(EGLNativeDisplayType display_id); +EGLBoolean IMGeglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLBoolean IMGeglTerminate(EGLDisplay dpy); +const char * IMGeglQueryString(EGLDisplay dpy, EGLint name); +void (* IMGeglGetProcAddress(const char *procname))(void); +EGLBoolean IMGeglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLBoolean IMGeglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLBoolean IMGeglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +EGLSurface IMGeglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType window, const EGLint *attrib_list); +EGLSurface IMGeglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +EGLSurface IMGeglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLBoolean IMGeglDestroySurface(EGLDisplay dpy, EGLSurface surface); +EGLBoolean IMGeglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +EGLContext IMGeglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); +EGLBoolean IMGeglDestroyContext(EGLDisplay dpy, EGLContext ctx); +EGLBoolean IMGeglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLContext IMGeglGetCurrentContext(void); +EGLSurface IMGeglGetCurrentSurface(EGLint readdraw); +EGLDisplay IMGeglGetCurrentDisplay(void); +EGLBoolean IMGeglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +EGLBoolean IMGeglWaitGL(void); +EGLBoolean IMGeglWaitNative(EGLint engine); +EGLBoolean IMGeglSwapBuffers(EGLDisplay dpy, EGLSurface draw); +EGLBoolean IMGeglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +EGLBoolean IMGeglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +EGLBoolean IMGeglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLBoolean IMGeglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLBoolean IMGeglSwapInterval(EGLDisplay dpy, EGLint interval); +EGLSurface IMGeglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +EGLBoolean IMGeglBindAPI(EGLenum api); +EGLenum IMGeglQueryAPI(void); +EGLBoolean IMGeglWaitClient(void); +EGLBoolean IMGeglReleaseThread(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __PVREGL_H__ */ |