xserver-multidpi/hw
Olivier Fourdan b79eaf1184 xwayland: handle EAGAIN on Wayland fd
wl_display_flush() can fail with EAGAIN and Xwayland would make this a
fatal error.

When this happens, it means that Xwayland has flooded the Wayland file
descriptor, either because the Wayland compositor cannot cope or more
likely because of a deadlock situation where the Wayland compositor is
blocking, waiting for an X reply while Xwayland tries to write data to
the Wayland file descriptor.

The general consensus to avoid the deadlock is for the Wayland
compositor to never issue blocking X11 roundtrips, but in practice
blocking rountrips can occur in various places, including Xlib calls
themselves so this is not always achievable without major surgery in the
Wayland compositor/Window manager.

What this patch does is to avoid dispatching to the Wayland file
descriptor until it becomes available for writing again, while at the
same time continue processing X11 requests to release the deadlock.

This is not perfect, as there is still the possibility of another X
client hammering the connection and we'll still fail writing to the
Wayland connection eventually, but this improves things enough to avoid
a 100% repeatable crash with vlc and gtkperf.

Also, it is worth considering that window managers and Wayland
compositors such as mutter already have a higher priority than other
regular X clients thanks to XSyncSetPriority(), mitigating the risk.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1278159
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=763400
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-09-28 14:23:59 -04:00
..
dmx Switch poll() users to xserver_poll() 2016-07-21 15:04:36 -04:00
kdrive ephyr: Add a mode for skipping redisplay in glamor 2016-09-28 12:43:41 -04:00
vfb Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xfree86 xfree86/modes: Set RandR primary output from CreateScreenResources 2016-09-16 10:00:08 -07:00
xnest Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xquartz XQuartz: Silence an expected TSan warning 2016-09-22 14:55:03 -07:00
xwayland xwayland: handle EAGAIN on Wayland fd 2016-09-28 14:23:59 -04:00
xwin hw/xwin: Add 'dri' to DIST_SUBDIRS 2016-09-16 10:57:23 -07:00
Makefile.am Xwayland DDX 2014-04-03 15:19:22 -07:00