Commit Graph

1856 Commits

Author SHA1 Message Date
Carsten Haitzler b1e5539005 swap mode - add evlog logging for querying surface age
more debugging to hunt down possible blocks in getting buffer age if
it happens
2016-11-07 11:47:46 +09:00
Carsten Haitzler ad9cc1676e egl engines (wl, x11, drm) - add buffer age events for debugging
this adds evlog events that give buffer age details for event log
debugging to help hunt down issues.
2016-11-07 11:45:08 +09:00
Carsten Haitzler d762f74962 wl_drm and eayland_egl buffer age fix for gl when age changes
so i was just about to add buffer age debugging evlogs to everywhere
doing buffer age and i found... drm gl and wayland gl engines DONT
HANDLE age change like gl_x11! they dont reset to a "full render" for
that frame. well well. this explains bugs i am seeing for sure. very
very bag! i thought this was handled properly. this does lend some
credence to my thoughts about somehow having a single universal buffer
swapping/update calculating and "applying" api inside efl somewhere...

anyway - this fixes this issue for these 2 engines which is a real
necessary fix to be correct.

@fix
2016-11-07 11:40:02 +09:00
Guilherme Iscaro 0fa8dc48cd Evas FB: Add support for region push hook.
This will be useful to support the Ecore_Evas VNC server
under FB backend.
2016-11-04 18:29:42 -02:00
Jean-Philippe Andre b8a76e20af evas: Fix masking with window rotation, take 2
The first patch did not work for maps. This explains why the
original code was so weird. But it actually made sense.

After struggling a bit I realized that we really just need
to shuffle around the pixel position on the window to map that
of the position in the canvas (unrotate it).

Note that compatibility with GLSL-ES (for OpenGL ES) implies
we can not use an array initializer like:
  vec2 pos[4] = vec2[4](a,b,c,d);
So the code could probably be optimized. But at least this works.

This patch also avoids calling glGetUniformLocation again and
again.
2016-11-04 15:28:56 +09:00
Jean-Philippe Andre 4071af438a Revert "evas: Simplify GL masking and fix window rotation"
This reverts commit 562528d28c.

This patch did not work with mapped images.
2016-11-04 15:26:41 +09:00
Carsten Haitzler 4ed2e01591 remove xcb support in ecore_x and evas engines as per mailing list
as per mailing list discussion about dropping xcb support now. it
hasn't been complete for a long time, thus not recommented for being
turned on. as we are moving to a wayland world xcbmakes even less
sense. as agreed, time to clean up a bit and remove a distraction as
well as not well tested code. this also updates po's too.

@feature
2016-11-03 22:22:54 +09:00
Jean-Philippe Andre 562528d28c evas: Simplify GL masking and fix window rotation
The original solution was really complex and relied on
transforming the current gl_Position into the screen
coordinate in pixels, and map that to the pixel position
in the mask.

This new solution simply pushes the required vertices for
the mask, based on its geometry. This fixes masks when used
in a rotated window.

Why was it so hard to get right? :(

@fix
2016-11-03 17:22:14 +09:00
Derek Foreman af4a71bcf0 wayland evas engines: share engine info structure
These engines are incredibly similar - by sharing the same engine info
structure we'll be able to simplify the wayland ecore_evas bits and
make them much more maintainable.
2016-11-02 13:37:01 -05:00
Derek Foreman 0b9f77ac96 wayland_egl: Remove unused wl_egl_window variables 2016-11-02 13:37:01 -05:00
Derek Foreman 54cf6dac4a wayland evas engines: rename wayland display to wl_display
Continuing to make the shm and egl engines closer to eachother.
2016-11-02 13:37:00 -05:00
Derek Foreman 3f75c45122 wayland_egl: Rename surface to wl_surface
Making this code more closely match the wayland_shm engine
2016-11-02 13:37:00 -05:00
Derek Foreman 9e43a15526 wayland_egl: Remove pre_post_swap_callback_set
This stuff seems copied from gl_x11 which actually has API to use it.

In this engine nothing can actually set it, so it's just all dead code.
2016-11-02 13:37:00 -05:00
Derek Foreman 96aba5021c wayland_egl: Remove Evas_Engine_Info_Wayland_Egl_Swap_Mode enum
Nothing uses this.
2016-11-02 13:37:00 -05:00
Derek Foreman 47718ae3ea wayland_egl: Remove screen from engine info
Doesn't appear to actually be used for anything.
2016-11-02 13:37:00 -05:00
Derek Foreman d960adee72 wayland_egl: Remove some leftovers from www
The render post callback and "wobbling" variable were only required for
the client side effect.
2016-11-02 13:37:00 -05:00
Chris Michael 21a8fbde7e evas-wayland-shm: Don't post updates to surface if no surface
In the event that an ecore_evas (using wayland_shm) gets hidden then
the corresponding wl_surface gets destroyed. If evas_norender is
called after that, the outbuf_redraws_clear function follows.
Outbuf_redraw_clear function ends up trying to post updates to the
wl_surface however if that wl_surface is gone, then we end up crashing.

This patch addresses that issue by checking for a valid wl_surface
inside the engine before trying to post updates to that wl_surface.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 2c09a35b6c evas-wayland-shm: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 001d8255b8 evas-wayland-shm: Remove unused varible
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:18:30 -04:00
Chris Michael 0fa7abae7b evas-wayland-shm: Get page flips out of the render thread
Now that we have redraws_clear exposed through software generic, we can
use that to do the final buffer swap from the main thread instead of doing
it in outbuf_flush which runs from the render thread.

This becomes more important later when other call sites in the main thread
will perform buffer flips.

Based on 95a00b8e49 by Derek Foreman

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:00:39 -04:00
Chris Michael f3d1b2d7da evas-wayland-shm: Improve next buffer selection algorithm
When triple buffering it's possible that we'll only need two buffers at
a time for long durations.  When we finally call upon a third buffer it
hasn't been used recently enough to do a partial redraw.
By picking the oldest available buffer when multiple buffers are free we
can increase the likelihood of doing partial redraws.

Based on 79409757c6 by Derek Foreman.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:53:49 -04:00
Chris Michael bb2a55ead6 evas-wayland-shm: Default to triple buffering
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:33:07 -04:00
Chris Michael d8600a4f25 evas-wayland-shm: Fix max buffer age
Highest possible buffer age should actually be 4, not the number of
available buffers.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:19:28 -04:00
Chris Michael 2ceb37e14d evas-wayland-shm: Fix formatting
NB: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:19:06 -04:00
Guilherme Iscaro 8040d20f90 This series fixes two problems in the VNC implementation.
One deadlock and one segfault.

Patch 1:

Software X11 Evas Engine: Fix deadlock

Summary:
The patch bc6e8d2692 introduced a callback responsible to notify the pixels
that were sent to the X server. Since all EFL rendering is done by another
thread, the callback should be called from the main thread context.
To achieve this behaviour evas_software_x11_region_push_hook_call()
was using ecore_thread_main_loop_begin(), which may cause deadlocks, since
evas mainloop waits for the render thread and the render thread waits
the mainloop.

In order to fix this problem, the function
ecore_main_loop_thread_safe_call_async() will be used to
schedule the callback to run in the main loop context.

Since a callback is schedule to run in async manner, the pixels that
were sent to the X server must not be deleted until the user is informed.
In order to avoid more mallocs(), this patch adds the support for refcounts to the
X_Output_Buffer and Xcb_Output_Buffer.

Patch 2:

Ecore_Evas VNC: Use the image size to create the buffer.

In same cases they may differ and may lead to a segfault, since
memcpy() causes a buffer overrun.

Reviewers: bdilly, raster

Reviewed By: raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4323
2016-10-21 13:56:00 +09:00
Derek Foreman 1809b3b959 gl_x11: Do KHR Partial Damage properly
KHR partial damage must be set once at the beginning of rendering with
buffer damage for the entire scene to be rendered.  Doing otherwise can
result in graphical anomalies on some GL implementations.
2016-10-20 14:30:00 -05:00
Derek Foreman 6a65253f68 wayland_egl: Remove weirdo buffer age kludge cargo culted from gl_x11
There's no reason why we'd need a full redraw if the buffer age for
this buffer isn't the same as the buffer age for the last buffer, so
let's cut out this thing.
2016-10-19 16:29:05 -05:00
Derek Foreman a44352a10f wayland_egl: Use surface damage instead of buffer damage
We should always pass surface damage to eglSwapBuffersWithDamage.
2016-10-19 16:29:05 -05:00
Derek Foreman c3a31ff213 gl_drm: Use surface damage instead of buffer damage
We should always pass surface damage to eglSwapBuffersWithDamage.
2016-10-19 16:29:05 -05:00
Derek Foreman 7a978fe58c evas_engines: Send both surface and buffer damage to outbuf_flush callback
Some engines should using sending surface damage, until now we'd only ever
provided them with buffer damage.

The difference is that surface damage is the damage to the surface the
compositor is displaying, and the buffer damage is the damage to the
buffer the client has rendered.  These are different when the client
is using multiple buffers of different ages to render into.

Anything that calls eglSwapBuffersWithDamage, wl_surface_damage() or
wl_surface_damage_buffer() should be using surface damage, and not
buffer damage.

This patch is intended to make no functional change - any flush cb that
used buffer damage before still should.  Actual fixes to follow.

Apologies if I broke any engines - it's a bit of a copy and wasteland
out here.
2016-10-19 16:29:05 -05:00
Derek Foreman 455afb707f Revert "wayland_shm: Add swap mode fallback when buffer age changes"
This reverts commit 62ca4486ea.

Honestly, I think the gl_x11 code doesn't make sense either. :)

There's no logical reason that we have to do that, though it may be
hiding some other bug?  If that's the case, the bug should be fixed
properly.
2016-10-19 16:29:05 -05:00
Jean-Philippe Andre b88093c847 evas: Last fix... now it builds 2016-10-19 14:05:31 +09:00
Jean-Philippe Andre e67d9c4e1c evas: More compilation fixup with EGLImage
This is what happens when you can't test a patch yourself ^^
2016-10-19 13:40:08 +09:00
Jean-Philippe Andre 5fd4875ad4 evas: Fix compilation with older EGL (maybe <1.5)
EGLImage was not introduced until very recently. EGLImageKHR was
the proper type. Thanks Roy for the report.
2016-10-19 13:35:12 +09:00
Jean-Philippe Andre 62ca4486ea wayland_shm: Add swap mode fallback when buffer age changes
This copies the behaviour in opengl_x11 engine, where the buffer
age needs to be continuously the same to be taken into account.
If the age varies, then we fallback to a full redraw.

Apparently this fixes issues on actual devices. I tested this
patch in weston (I didn't have issues before and buffer age is 1).
2016-10-18 17:40:01 +09:00
Derek Foreman 3d6aae4633 evas gl x11 engine - Wrap eglCreateImage
eglCreateImage and eglCreateImageKHR have different parameters - the
attribute list is EGLint for one and EGLAttrib for the other.  Since
EGLAttrib is long, on a 64-bit system it's a different size than EGLint.

This was causing a crash in Enlightenment's wl_x11 on 64-bit machines when
trying to use a gl client.

Add a thin wrapper to use whichever is available and pass the appropriate
sized data.
2016-10-14 16:07:08 -05:00
Subhransu Mohanty 8b7f060946 evas/module: add a new module in vg_saver for eet
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4350
2016-10-14 15:52:51 +09:00
Subhransu Mohanty 45b103eb0a evas/module: add a new module in vg_loader for eet
Reviewers: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4347
2016-10-13 17:09:39 +09:00
Subhransu Mohanty 0d9b168146 evas/module: Added a new module vg_loader for svg
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4346
2016-10-12 18:39:10 +09:00
Jean-Philippe Andre 0f7dfdedfd evas: Fix async filters following changes in EO
EO is now extremely restrictive wrt. threads so that efl_data_scope_get()
can't work outside the main loop. This patch fixes the usage to create
sw buffers as shared objects (accessible from both the main loop and evas
async thread) and use plain old pointers where possible.

The buffers now have no parent because efl_add(CLASS, obj_from_mainloop)
does not work with shared objects. This is bad, as the buffers conceptually
belong to the main loop, and only need to be accessible from the draw thread
for a few calls. The main loop determines their lifecycle.

Fixes T4628
2016-10-06 12:24:59 +09:00
Chris Michael 7b049ab7ac evas-software-x11: Remove unused variable and mark unused parameters
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-04 09:41:53 -04:00
Subhransu Mohanty d54b5fba6c ector: make the ector objects as shared object after eo changes.
As ector objects are acessed by draw thread we need to create it as
 shared object in order to access it from other thread.
 Note: there is some performance lag...

Summary: make ector object as shared eo object to acess from other thread.

Reviewers: cedric, jpeg, raster

Reviewed By: jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4319
2016-09-28 16:02:12 +09:00
Carsten Haitzler c88c74de1b evas sw x11 - disable the loop begin/end that deadlocks evas
this is quick to get evas working again. this disables part of
7e2d700d06 that creates deadlocks. this
thread waits on mainloop. mainloop waits on this render thread. BOOM.
deadlock.
2016-09-27 16:14:31 +09:00
Guilherme Iscaro 7e2d700d06 Evas Software X11: Add a callback that informs the current screen content pixels.
This is necessary in order to implement a VNC server. Using this
callback the VNC server will be able to draw the current screen to the
VNC clients.
2016-09-26 22:06:59 -03:00
Jean-Philippe Andre d7b9db44f0 evas_fb: Avoid invalid dereference
If buf->priv.fb.fb was NULL the function would have crashed. So
buf->priv.fb.fb can't be NULL. I'm keeping the if(buf->priv.fb.fb)
anyway, but not sure the else case is valid.

Thanks @jiin.moon for the report.
2016-09-23 17:32:38 +09:00
Stefan Schmidt 9079d2b575 evas: model_save: remove unused label after error handling change
In commit 8272d14927 the error handling was
moved upwards and the need for the goto label removed. Catching up here and
removing the label as well.
2016-09-21 10:45:12 +02:00
Hermet Park c998fd5ee7 evas software_engine: ++safety code. 2016-09-21 16:24:42 +09:00
Hermet Park ff7511ae12 evas engine: correct null check
check null first, before access it.
2016-09-21 13:16:36 +09:00
Hermet Park 545161d954 Revert "evas engine: return as soon as possible if the surface or context is not valid."
This reverts commit 2f158ebe65.

misunderstood ^ operator.
pinged by jpeg.

previous code was correct.
2016-09-21 13:06:18 +09:00
Hermet Park 2f158ebe65 evas engine: return as soon as possible if the surface or context is not valid.
And later, the surface and context are accessed.
So both of arguments should be valid necessarily.
2016-09-21 12:24:49 +09:00