We use immediate mode dmabuf creation at runtime, but this can result in
clients being killed with no option to fallback if the buffers can't be
consumed by the compositor.
This test should catch when a system can allocate a dmabuf buffer and the
compositor claims to accept dmabuf, but the buffer can't actually be used
for whatever reason. We'll then use wl_shm at runtime instead of dmabuf.
There are some binds at startup that result in additional information
being sent, so we may need to call wl_display_sync() multiple times, and
only send the client a SYNC_DONE event when the final one completes.
We need at least version 2 for create_immed, so don't even bind the
global if it's useless to us.
This will also stop us from trying to use dmabuf (and getting killed by
the compositor) on older compositors that don't support the version we
need - we'll just use wl_shm instead when this pointer is NULL.
Flushing should be done where it's needed now, but we still
need the rest of the idle handler as something like mesa may
have dispatched its queue, which reads all the pending wayland
events. In that case we have events to process but the fd will
not poll readable.
@fix T6250
We do flushes when we need them now, so we don't need this somewhat
non deterministic flush mechanism anymore.
Anything that breaks as a result of this should be fixable by adding an
ecore_wl2_display_flush() somewhere appropriate.
If wl_display_flush() returns a non negative number it was successful,
so we should disable the write handler then. We were theoretically always
doing an extra flush on an empty buffer.
This is mostly cosmetic as that's not a costly operation.
Summary:
The !global test is a post-condition that _ecore_wl2_global_find
provided valid data, so the code is clearer if this is kept separate
from the subsequent if chain for looking up the shell. Since this
post-condition returns from the function on error, it can stand alone.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewers: devilhorns, ManMower
Reviewed By: ManMower
Subscribers: jpeg, cedric
Differential Revision: https://phab.enlightenment.org/D4690
We need to bind a shell on reconnect, but dfb2af697 made sure
we only bind a single shell per wayland display for the life of
the display object - which lives longer than the connection.
That means when session recovery tries to reconnect it never bothers
to bind a shell, so the client can never post buffers.
ref https://phab.enlightenment.org/T5226
ref https://phab.enlightenment.org/T5005
@fix
Commit c6b59be1da ensured display cleanup after roundtrips, however we
cannot call the display_cleanup function After the display has been
disconnected ... oopsie. Essentially the call to the cleanup function
was in the wrong place here so fix.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Commit ee52a28d04 added a roundtrip to
ensure and pending wl events were handled before we disconnected the
display. While this ensures some things like session recovery destroy
work again, it lead to an issue where the _ecore_wl2_display_cleanup
function was called BEFORE we processed pending events. This (in turn)
causes crashes due to processing of pending events that relied on
things like Ecore_Wl2_Input existing. As the display cleanup function
clears inputs & outputs, we need to defer calling that until the
display_roundtrip has dispatched and handled pending events.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
As per Mike, the iterator macro already does the casting for us, so we
can cleanup the code here and not do casting, plus we can remove an
extra variable...bonus ;)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to change from while (iterator) to using the
EINA_ITERATOR_FOREACH macro...that I had forgotten about...thanks Mike
;)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This patch adds prioritizing to our wayland shell binding code so that
we only bind One shell that the compositor advertises. During the
global_add callback, the shells get added to the 'globals' hash, and
when sync is done, we will search for shells to bind based on priority
so that we can ensure we always bind to the latest supported shell.
ref T5226
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Since we only ever use One shell at a time, let's not bind all of them
as that is useless.
ref T5226
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
We had to do some weird special case stuff when binding wl_compositor
because we implemented damage buffer before depending on a wayland
release that provided it.
Now our wayland dep is newer than damage buffer, so the test can be
more conventional.
Should have no functional change.