Commit Graph

287 Commits

Author SHA1 Message Date
om101.woo cf569fb2bf From: <om101.woo@samsung.com>
Subject: image data get/set pairing issue

I found a bug about pairing
evas_object_image_data_get/set(eng_image_data_get/put).

It was added to count checked_out for paring
eglMapImageSEC/eglUnmapImageSEC.
 
In case of calling evas_object_image_data_set() twice after calling
evas_object_image_data_get(), dyn.checked_out has -1.

Then, if evas_object_image_data_get() and evas_object_image_data_set()
is call, it can't call eglUnmapImageSEC().
 
If dyn.checked_out has minus, it can make some problem.

So, I fixed this problem.
 
Please find enclosed patch file and let me know if I misunderstood.



SVN revision: 68504
2012-02-28 11:55:14 +00:00
Carsten Haitzler 45bd2a60cd warning--
SVN revision: 68467
2012-02-27 05:52:25 +00:00
Sung Park ac0d52f04d Fixed glBindFramebuffer(0) issue for Direct Rendering
optimization.  current_fbo wasn't being set to 0 
so the above case wasn't being handled properly. 



SVN revision: 68392
2012-02-24 08:13:48 +00:00
Sung Park 4f4a904816 Fixing my silly mistake before someone else catches it.
I was accessing a variable before it was NULL checked. 
Fixed now.



SVN revision: 67601
2012-01-30 11:21:38 +00:00
Sung Park 14a94f1a8f Fixed a logic error for Evas GL Direct rendering override
option.

It should have been OR instead of AND operator.

When the image object alpha is on "OR" the rotation angle 
is not "0", direct rendering isn't allowed.  However,  
allow direct rendering if EVAS_GL_DIRECT_OVERRIDE=1 is set. 




SVN revision: 67521
2012-01-25 05:08:23 +00:00
Sung Park 9afd5b3f3f Added Direct Rendering to Evas' window instead of an FBO in Evas_GL.
This optimization is significant for rendering to a large surface 
because it'l save an extra copy overhead as well as an extra rendering pass.

To enable it, you can give EVAS_GL_OPTIONS_DIRECT hint in the surface
config options_bits. The following conditions have to be met in order
for evas to render directly into the Evas' window. If they are not met, the 
engine will fallback to rendering to an FBO as it normally does. 

conditions: 
1.) All the GL calls have to be called using the pixel_get_callback function.
This is necessary for the evas object order to be maintained.
2.) Alpha must be disabled on the image ojbect that renders evas_gl.
3.) No rotation allowed.

One way to override above condition is to set EVAS_GL_DIRECT_OVERRIDE=1 but 
there is no guarantee in its behavior.

Currently, this optimization is added for gl_x11 engine only. 




SVN revision: 67388
2012-01-20 12:29:14 +00:00
Sung Park 20b3d52669 Added new Evas GL api called evas_gl_config_new/free()
to ensure backward compatibility.  Previously, the user
simply declared a Evas_GL_Config object but this can
cause problems if more config options are added.  So,
we have Evas allocate the config object for the user
so it can handle addition in the future.

Also, added some safety code around _extensions_init


SVN revision: 67141
2012-01-12 13:54:06 +00:00
Christopher Michael a75b3126b2 Evas (gl_x11): Move make current so we only have one if.
SVN revision: 67137
2012-01-12 12:25:21 +00:00
Christopher Michael dd7d556916 Evas (gl_x11): We cannot call eglMakeCurrent if we have already called
eglTerminate prior (eg: eglTerminate was in the wrong place here).



SVN revision: 67119
2012-01-12 06:06:07 +00:00
Christopher Michael 4e103ad78c Evas (gl_x11): Fix no return value in function that is supposed to
have Something returned.



SVN revision: 67063
2012-01-11 10:34:03 +00:00
Christopher Michael 2e70a02465 Evas (gl_x11 engine): Fix compiler warning about get_time function.
SVN revision: 67058
2012-01-11 09:48:47 +00:00
Carsten Haitzler 3f915e1e3f oops dont enable copy path!
SVN revision: 66727
2012-01-02 03:32:57 +00:00
Carsten Haitzler 8e4391d38b make some more notes for partial swap (copy gabk to front) but still
doesnt work.. just sits there and does nothing. wtf.



SVN revision: 66726
2012-01-02 03:30:23 +00:00
Carsten Haitzler 4273f5846c found nvidia eat-cpu-bug. glXWaitGL() spins using all cpu it can find,
though nvidia fixed the spinning on glXSwapBuffers() long ago, they
didn't fix this one.



SVN revision: 66710
2012-01-01 06:47:16 +00:00
Michael BOUCHAUD aec13b5d41 evas: forget to overide this in gl, fix evas_object_image_region_support_get
SVN revision: 66480
2011-12-23 12:00:52 +00:00
Carsten Haitzler dbc5afdee2 sorry sungwoo - going to have to back this dlopen/dlsym styuff out.
intel drivers don;'t like it for some odd reason - i'm trying to track
it down but i can't sanely try middlegrounds right now (eg dont
dlopen/dlsym but actually directly assign symbols etc.), so back out
and let's figure this out before it goes back in :(



SVN revision: 66308
2011-12-18 05:03:24 +00:00
Christopher Michael cbbe439629 Evas: Gl_X11: Fix typo? for __UNUSED__ param.
SVN revision: 66224
2011-12-14 18:52:42 +00:00
Michael BOUCHAUD 33eb1e5e79 evas: Add api to know if an evas_object_image could support region
SVN revision: 66170
2011-12-13 16:58:20 +00:00
Christopher Michael 9935288eaa Evas (gl engine): Remove incorrect __UNUSED__ on paramaters that are
actually used.



SVN revision: 65928
2011-12-06 00:44:25 +00:00
Carsten Haitzler 5967841988 I'm attaching a patch for the initial version of the GL Fastpath
addition to evas gl backend.

Working on different mobile devices, we've noticed that the cost of context
switch (MakeCurrent) in GL can be very expensive depending on the driver
implementation.  To minimize the poorly written driver's context switch
overhead, I've implemented a state tracking layer on top of the driver
implemented GL.

Essentially, this layer wraps all the GL/Glue(GLX/EGL) APIs and manages its own
state changes.  Internally, only one real GL context is created and logical
contexts are created every time a user requests context creation.  The logical
contexts keep track of its states and sets only the necessary states
(the ones that are different than the current ones)
when there is a MakeCurrent request.  The real MakeCurrent gets called when
there is a Surface/Window change request.

The GL library is dlopened and all the APIs are dlsym'ed and wrapped
accordingly.  All the GL functions are in evas_gl_core.{h,c}.

Here's a very simply flow of the code.
   - all the APIs are exported as function pointers (*glsym_glBegin),
     (*glsm_eglCreatContext), and etc.
   - all the native GL/Glue(GLX/EGL) APIs are dlsym'ed as _sym_glBegin,
     _sym_eglCreateContext, and etc.
   - all the fastpath APIs are implmemnted as fpgl_glBegin,
     fpgl_eglCreateContext, and etc.
   - if faspath is seletected, the exported APIs are set accordingly
     ie. glsym_glBegin = fpgl_glBegin;
   - default mode is the regular gl symbols are directly set.
     ie. glsym_glBegin = _sym_glBegin;
             
I have an Environment variable where you can set it to three different Modes

EVAS_GL_FASTPATH = 0    // Default mode. Regular GL symbols are directly loaded
EVAS_GL_FASTPATH = 1    // Fastpath mode. Takes the path described above.
EVAS_GL_FASTPATH = 2    // Wrapped mode.  All the regular GL functions are
                           wrapped once.  This can be used for various
purposes

Since all the GL symbols are now loaded in this library, I took out all
the gl symbol loading parts in the evas gl backend as you'll see in the patch.
The changes to the engine and the backend itself is pretty minor.

There are still some known issues to hammer out but I thought we're at a good
place for an initial version so that my source doesn't diverge too much.

Known Issues and To Do's
* Current GL Fastpath version doesn't support multiple threads. Instead of
  having one global real context, I would need to do it for each thread. I'll
  get on this soon.
  
  * Issues running Evas GL on certain conditions.  When running the elementary
  test (with gl engine), if you run ELMGLview test that runs in ON_DEMAND mode,
  everything works fine. BUT, when you run the ELMGLView test in ALWAYS
    mode, the subsequent elm tests shows blank screen. When you destroy the
  GLView window, everything else comes on fine.
  
  * Resource protection code.  This actually applies to Evas GL code in general
  as well. Since all the resources are shared among all the contexts that get
  created, I would like to eventually have a resource protecting mechanism that
  prevents access to resources outside of its context unless specifically
  specified.
  
  I'm attaching three files
     - evas_gl_core.h, evas_gl_core.c, fastpath.patch
     
  To get the code running...
     - copy evas_gl_core.{c,h} to src/modules/engine/gl_common/
     - apply the fastpath.patch
     - compile/install evas
     - to run with fastpath GL (ie. % EVAS_GL_FASTPATH=1 ./evasgl_sample1)



SVN revision: 65891
2011-12-05 08:54:14 +00:00
Carsten Haitzler 27705ad95b fix dyn image data return due to change i made a little bit ago
SVN revision: 65159
2011-11-14 09:27:29 +00:00
Carsten Haitzler 34988a54e4 ooh aznd other part of dyn img patch goes in.
SVN revision: 65053
2011-11-11 07:47:25 +00:00
Jiyoun Park c049c0e12b remove white space and tab
SVN revision: 65009
2011-11-10 08:59:09 +00:00
Vincent Torri 346eba9259 declare the variables at the beginning of the block
SVN revision: 64516
2011-10-30 05:02:05 +00:00
Mike Blumenkrantz 80b018b790 add missing variable from r64139
direct all spankies to raster and Sung W. Park


SVN revision: 64514
2011-10-30 02:04:50 +00:00
Sung W. Park a3a5a85d92 From: "Sung W. Park" <sungwoo@gmail.com>
Subject: [E-devel] [E-Devel][Patch] Evas GL Color Format Enum change
(and ElmGLview changes accordingly)

I'm submitting a patch that changes the color format for Evas GL.

When I first wrote Evas_GL, I just had EVAS_GL_RGB_8 and EVAS_GL_RGBA_8 and etc
but it was misleading for some people.  It was more of a filler since I couldn't decide on
a name.  I'm finally changing it to make it more clear.



SVN revision: 64491
2011-10-28 11:08:23 +00:00
Carsten Haitzler 4483c0ef6f warning--
SVN revision: 64387
2011-10-25 12:07:56 +00:00
Carsten Haitzler bc10321643 disable getting of xft.dpi - always been an option but it just leads
to inconsistent rendering.



SVN revision: 64386
2011-10-25 12:01:44 +00:00
Cedric BAIL ce3a658ef7 evas: coorectly dirty YUV data.
SVN revision: 64254
2011-10-21 14:06:42 +00:00
Carsten Haitzler f95a1783a7 debug for future. for now found the problem.
SVN revision: 64248
2011-10-21 09:59:13 +00:00
Carsten Haitzler 11409eb48e have evas engine also to update rect math so we can exclude useless
updates when obscured objects change



SVN revision: 64246
2011-10-21 08:58:00 +00:00
Carsten Haitzler 1541b0e97e add call to get maximum image size (eg max texture size)
SVN revision: 64244
2011-10-21 08:17:14 +00:00
Carsten Haitzler a396da70de we dont need the dirty at the end either.
SVN revision: 64173
2011-10-19 09:50:55 +00:00
Cedric BAIL 519750e778 evas: simplify code at the same time.
SVN revision: 64169
2011-10-19 09:04:18 +00:00
Carsten Haitzler 6f3529fe65 nono - we dont dirty images when we set data...
SVN revision: 64168
2011-10-19 08:59:29 +00:00
Jiyoun Park bfbd9abf9d From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] modify gl engine's animated function
related with cache entry

I modified the gl engine code related with animated images
This is very trivial.  Evas image object passes images to the engine. 
In the software engine, it is a cache entry , but in the GL engine, it is 
an Evas_GL Image. So I modified the gl engine code to get the cache entry
from the gl image.



SVN revision: 64143
2011-10-18 09:10:26 +00:00
Sung W. Park c1cc0a7ed2 From: "Sung W. Park" <sungwoo@gmail.com>
Subject: Re: [E-devel] [E-Devel][Review][Patch] Evas GL Extensions + a
bug fix


Here's an initial attempt at the GL extensions issue for Evas GL.

I have been in discussion with a few EFL developers regarding how we should
provide extensions.  Essentially, there are two ways to go about doing this.

1. provide evas_gl_proc_address_get() function as it is done in other
glue layers

2. provide all the extension functions in the EVAS_GL_API struct.

#1 approach is how it's done in other glue layers and the driver implementor can
provide new extensions easily.  It is however pretty annoying to get the
function prototypes right and use the function pointers and etc.

#2 approach provides all the extension functions in the struct so it's
definitely easier to use.  Adding new extensions can be a pain as people may
have to wait for new version releases.

For now, we thought it was OK to just throw them in the struct as in
#2 and try it out.  So, I've implemented this approach.  As for the extensions,
I've basically included all the extensions in gl2ext.h as EvasGL currently
provides all the GLES 2.0 functions.   In order to display the right
information, I had to override glGetString() with GL_EXTENSIONS as parameter to properly
display the supported extensions.

Also, I've added a few EGL extensions that have been
modified for EvasGL use.  For example, eglCreateImage/eglDestroyImage has been
defined as folllows.

   EvasGLImage  (*evasglCreateImage) (int target, void* buffer, int*
                                         attrib_list); void
                                            (*evasglDestroyImage)
(EvasGLImage image);

const char *evas_gl_string_query() function was added to return a string of
supported EvasGL extensions.  So essentially, a user can search this string to see
if the desired extension is supported.  if it is, he can use the functions.  He can
always check if the function pointers are NULL as well.

Take a look at the pach and let me know what you think.

______________

While I was adding the extension code, I've added a few fixes/ changes
to the EvasGL.

1. glDeletBuffers bug
- When I wad destroying evasgl context, I was deleting the context FBO with
glDeleteBuffers instead of glDeleteFramebuffers. This code in effect was
deleting BOs in other contexts and we had some funky behaviors as a
result.  The
bug has been fixed.

2. make_current
- I've made some changes to the make current code and also added a resource
context to the engine data.  the resource context is used for creating surface
texture/ fbos when surface/ context is created.  Before, i was using evas'
context but thought it'd be a good idea to use a separate context.



SVN revision: 64139
2011-10-18 08:13:23 +00:00
Youness Alaoui 93d79aa509 Evas: Check for dlsym and disable gl engines if not found
SVN revision: 64091
2011-10-15 09:31:04 +00:00
Carsten Haitzler 7c7f8803f5 try and make newgl work again... fail! why does glx hate me?
SVN revision: 63885
2011-10-06 15:05:32 +00:00
Carsten Haitzler 837165ed8a no no.. oops. i missed an error!
SVN revision: 63883
2011-10-06 13:46:06 +00:00
Carsten Haitzler bdbfbbd2d3 newgl work.. now.. why?
SVN revision: 63882
2011-10-06 13:45:14 +00:00
Cedric BAIL 308cf81312 evas: correctly handle direct mapping of data for non RGBA case.
SVN revision: 63726
2011-09-30 15:43:51 +00:00
Cedric BAIL 26ee52dd61 evas: add NV12 and MT12 colorspace.
MT12 is has documented in Linux videodev documentation
a 64 * 32 macro block tiled colorspace format used on
Samsung hardware.


SVN revision: 62967
2011-08-29 20:56:48 +00:00
Sung W. Park f3d21a04d0 From: "Sung W. Park" <sungwoo@gmail.com>
Subject: [E-devel]  [Review] [Patch] Evas_GL bug fixes/updates


I've fixed some minor issues that I've been pushing off for later.

The patch does the following:

1. Evas_GL and Evas had an issue where the viewport parameters were
being reset in the wrong context. Previously, this issue was temporarily
patched by flushing evas' pipeline and setting
evas_gl_common_context_use(NULL) in EvasGL's
make current. I know, it was pretty hacky. It turns out that in
evas_engine,
there was a code evas_gl_common_context_resize(NULL) without doing
eng_window_use() first.  So i've added that part and problem went was
resolved properly. :-)

2. Naturally, I've taken out the temporary patch from 1.

3. I've added code that took care of glBindFramebuffer(..., fbo) where
the
fbo had to be saved and restored in case the user wanted to use his
own fbo.
Also, I've had to take care of the case when fbo is 0 since 0 need to
point
to evas_gl surface.

4. I've updated make_current a little as well.



SVN revision: 62780
2011-08-25 06:30:52 +00:00
Jiyoun Park 4b59fd460e From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] evas gl engine's texture creation

Hello. 

1. _pool_tex_dynamic_new function, it didn’t set pt to NULL when secsym_eglCreateImage function failed.
In this case, it returns wrong pt pointer and it has possibility to make crash.
So I add free pt code and return NULL code into _pool_tex_dynamic_new function.

2. I modified eng_image_data_get of gl engine.

If Evas_GL_Image's texture creation failed and evas_gl_image's cache image was droped, 
Im->im can be NULL. So I add check code. 
Example: evas_gl_common_image_content_hint_set
     1) EVAS_IMAGE_CONTENT_HINT_DYNAMIC , it drop cache image
     2) if evas_gl_common_texture_dynamic_new failed
     3) then, im->im =NULL, im->tex=NULL
        In this situation, if application call's evas_object_image_data_get function, 
It make crash in evas_cache_image_load_data function.

3. I think function's related with evas_object's engine data have to be return NULL if it failed.
If function's returns null, evas object code can handle error more easily.  
But evas object's code was implemented differently each case. Does my suggestion right?
I add engine data null check code to evas_object_image based on upper consumtion.
If it is wrong , the patch code related with evas object image have to be removed.
If it is right , I will survey other evas object type also.  



SVN revision: 62775
2011-08-25 04:48:45 +00:00
Cedric BAIL 7ae4bd0f31 evas: add YUY2 shader to GL engine.
TODO: add NV12 and NV12T to evas.


SVN revision: 62721
2011-08-23 15:13:40 +00:00
우승수 f34ac1e24a From: 우승수 <om101.woo@samsung.com>
Subject: [E-devel] [Patch] Map/Unmap image for zero-copy texture

this modifies the zero copy texture feature to map and unmap on get and put
data to allow the put to "flush gpu caches".



SVN revision: 62493
2011-08-16 07:06:36 +00:00
Daniel Juyung Seo 3277e6b5e0 evas: Fixed indentations with arbitrary files.
SVN revision: 62370
2011-08-12 03:50:57 +00:00
Jiyoun Park dae46003e7 From: Jiyoun Park <jy0703.park@samsung.com>
Subject: RE: [E-devel] [Patch] Animation gif feature patch

Animated gif suport in evas and api's to handle animated images and
frame flipping. from jy.



SVN revision: 62331
2011-08-11 06:04:08 +00:00
ChunEon Park 5440167a6d evas/evas_engine - patched by Seung-Soo Woo <om101.woo@samsung.com>
Dear all,

eng_image_stride_get() of gl backend get fault stride value.
In case of using dynamic image, it get from dyn.w*4.
But, dyn.stride was already got from secsym_eglGetImageAttribSEC() in _pool_tex_dynamic_new().
dyn.stride can be changed according to DDK.
So, the stride needs to get from dyn.stride.

Please find enclosed file.

Thanks.



SVN revision: 61463
2011-07-18 05:32:06 +00:00