sung pushed a commit to branch master.
commit 34ce73badd4cc5084d42c1061a9035d4c6569d82
Author: Sung W. Park <[email protected]>
Date: Fri Apr 12 17:34:13 2013 +0900
[Evas] Updated eglMap/UnmapImageSEC extension definition
Recently Samsung specific eglMap/UnmapImageSEC has been updated to
support new features. The extension definition was updated in evas
accordingly.
---
src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 4 ++--
src/modules/evas/engines/gl_common/evas_gl_common.h | 16 ++++++++++++++--
src/modules/evas/engines/gl_common/evas_gl_context.c | 4 ++--
src/modules/evas/engines/gl_common/evas_gl_texture.c | 16 +++++++++++-----
src/modules/evas/engines/gl_x11/evas_engine.c | 15 +++++++++------
src/modules/evas/engines/wayland_egl/evas_engine.c | 11 +++++++----
6 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index ff63913..a80f518 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -558,10 +558,10 @@ _EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_SEC_map_image)
_EVASGL_EXT_DRVNAME(EGL_SEC_map_image)
- _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglMapImageSEC, void *a,
void *b))
+ _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglMapImageSEC, void *a,
void *b, int c, int d))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglMapImageSEC"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
- _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(unsigned int, eglUnmapImageSEC, void
*a, void *b))
+ _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(unsigned int, eglUnmapImageSEC, void
*a, void *b, int c))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglUnmapImageSEC"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 70da52d..93c0b83 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -113,6 +113,18 @@
#ifndef GL_WRITE_ONLY
#define GL_WRITE_ONLY 0x88B9
#endif
+#ifndef EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC
+#define EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC 1
+#endif
+#ifndef EGL_MAP_GL_TEXTURE_DEVICE_G2D_SEC
+#define EGL_MAP_GL_TEXTURE_DEVICE_G2D_SEC 2
+#endif
+#ifndef EGL_MAP_GL_TEXTURE_OPTION_READ_SEC
+#define EGL_MAP_GL_TEXTURE_OPTION_READ_SEC (1<<0)
+#endif
+#ifndef EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC
+#define EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC (1<<1)
+#endif
#define SHAD_VERTEX 0
#define SHAD_COLOR 1
@@ -671,8 +683,8 @@ extern GLboolean (*glsym_glUnmapBuffer) (GLenum
a);
extern void *(*secsym_eglCreateImage) (void *a, void
*b, GLenum c, void *d, const int *e);
extern unsigned int (*secsym_eglDestroyImage) (void *a, void
*b);
extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
-extern void *(*secsym_eglMapImageSEC) (void *a, void
*b);
-extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void
*b);
+extern void *(*secsym_eglMapImageSEC) (void *a, void
*b, int c, int d);
+extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void
*b, int c);
extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void
*b, int c, int *d);
#endif
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index 6668dcd..30571b8 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -42,8 +42,8 @@ static const char *(*glsym_eglQueryString) (void
*a, int name) = NUL
void *(*secsym_eglCreateImage) (void *a, void *b,
GLenum c, void *d, const int *e) = NULL;
unsigned int (*secsym_eglDestroyImage) (void *a, void *b) =
NULL;
void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
-void *(*secsym_eglMapImageSEC) (void *a, void *b) =
NULL;
-unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b) =
NULL;
+void *(*secsym_eglMapImageSEC) (void *a, void *b, int
c, int d) = NULL;
+unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b, int
c) = NULL;
unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int
c, int *d) = NULL;
#else
typedef void (*_eng_fn) (void);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c
b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 52388d0..e34f4bc 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -656,7 +656,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
if (pt->dyn.img)
{
if (pt->dyn.checked_out > 0)
- secsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
+ secsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img,
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
secsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
pt->dyn.img = NULL;
pt->dyn.data = NULL;
@@ -1455,7 +1455,10 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture
*tex, DATA8 **rows, unsi
char *texture_addr;
char *tmp;
- texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp,
tex->pt->dyn.img);
+ texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp,
+ tex->pt->dyn.img,
+ EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC,
+
EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC);
/* Iterate each Y macroblock like we do in evas_convert_yuv.c */
for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
@@ -1510,9 +1513,12 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture
*tex, DATA8 **rows, unsi
}
}
- secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
+ secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img,
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
- texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp,
tex->ptuv->dyn.img);
+ texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp,
+ tex->ptuv->dyn.img,
+ EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC,
+
EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC);
/* Iterate each UV macroblock like we do in evas_convert_yuv.c */
base_h = (mb_h >> 1) + (mb_h & 0x1);
@@ -1577,7 +1583,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture
*tex, DATA8 **rows, unsi
}
}
- secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
+ secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img,
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
return ;
}
#endif
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c
b/src/modules/evas/engines/gl_x11/evas_engine.c
index 4bf8dcd..b967897 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -81,10 +81,10 @@ _eng_fn (*glsym_eglGetProcAddress) (const char
*a) = NULL;
void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b,
EGLenum c, EGLClientBuffer d, const int *e) = NULL;
void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
-void *(*glsym_eglMapImageSEC) (void *a, void *b) = NULL;
-unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b) = NULL;
-const char *(*glsym_eglQueryString) (EGLDisplay a, int name) = NULL;
-void (*glsym_eglSwapBuffersRegion) (EGLDisplay a, void *b, EGLint
c, const EGLint *d) = NULL;
+void *(*glsym_eglMapImageSEC) (void *a, void *b, int c, int
d) = NULL;
+unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b, int c) =
NULL;
+const char *(*glsym_eglQueryString) (EGLDisplay a, int name) = NULL;
+void (*glsym_eglSwapBuffersRegion) (EGLDisplay a, void *b, EGLint
c, const EGLint *d) = NULL;
#else
@@ -2524,7 +2524,10 @@ eng_image_data_get(void *data, void *image, int
to_write, DATA32 **image_data, i
if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
- *image_data = im->tex->pt->dyn.data =
glsym_eglMapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
+ *image_data = im->tex->pt->dyn.data =
glsym_eglMapImageSEC(re->win->egl_disp,
+
im->tex->pt->dyn.img,
+
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC,
+
EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC);
if (!im->tex->pt->dyn.data)
{
@@ -2624,7 +2627,7 @@ eng_image_data_put(void *data, void *image, DATA32
*image_data)
im->tex->pt->dyn.checked_out--;
#ifdef GL_GLES
if (im->tex->pt->dyn.checked_out == 0)
- glsym_eglUnmapImageSEC(re->win->egl_disp,
im->tex->pt->dyn.img);
+ glsym_eglUnmapImageSEC(re->win->egl_disp,
im->tex->pt->dyn.img, EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
#endif
}
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 85d4a16..776bdfb 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -147,8 +147,8 @@ void *(*glsym_eglCreateImage) (EGLDisplay
a, EGLContext b, EGLe
void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
void (*glsym_glEGLImageTargetRenderbufferStorageOES) (int a, void *b) =
NULL;
-void *(*glsym_eglMapImageSEC) (void *a, void *b) = NULL;
-unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b) = NULL;
+void *(*glsym_eglMapImageSEC) (void *a, void *b, int c, int
d) = NULL;
+unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b, int c) =
NULL;
const char *(*glsym_eglQueryString) (EGLDisplay a, int name) = NULL;
unsigned int (*glsym_eglLockSurface) (EGLDisplay a, EGLSurface b,
const int *attrib_list) = NULL;
@@ -1718,7 +1718,10 @@ eng_image_data_get(void *data, void *image, int
to_write, DATA32 **image_data, i
if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
- *image_data = im->tex->pt->dyn.data =
glsym_eglMapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
+ *image_data = im->tex->pt->dyn.data =
glsym_eglMapImageSEC(re->win->egl_disp,
+
im->tex->pt->dyn.img,
+
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC,
+
EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC);
if (!im->tex->pt->dyn.data)
{
@@ -1807,7 +1810,7 @@ eng_image_data_put(void *data, void *image, DATA32
*image_data)
{
im->tex->pt->dyn.checked_out--;
if (im->tex->pt->dyn.checked_out == 0)
- glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
+ glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img,
EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC);
return image;
}
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter