weston/libweston
Antonio Borneo c90fccc256 backend-drm: fix race during system suspend
Depending on system loading, weston-launcher could drop the drm
master access before the compositor and all the clients receive
the notification. In this case, some commit could be sent to the
drm driver too late and get refused with error EACCES.
This error condition is not properly managed and causes weston to
hang.

Change the return type of start_repaint_loop() and repaint_flush()
from void to int, and return 0 on success or -1 if the repaint has
to be cancelled.
In the callers of start_repaint_loop() and repaint_flush() handle
the return value and cancel the repaint when needed.
In backend-drm detect the error EACCES and return -1.
Note: to keep the code cleaner, this change inverts the execution
order between weston_output_schedule_repaint_reset() and
repaint_cancel().

No need to wait for suspend or for any notification; in case the
weston reschedules a repaint, it will get EACCES again.
At resume, damage-all guarantees a complete repaint.

This fix is for atomic modeset only.
Legacy modeset suffers from similar problems, but it is not fixed
by this change. Since drm_pending_state_apply() never returns
error for legacy modeset, this change has no impact on legacy
modeset.

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/117
2019-07-12 17:16:52 +00:00
..
backend-drm backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
backend-fbdev backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
backend-headless backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
backend-rdp backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
backend-wayland backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
backend-x11 backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
renderer-gl gl-renderer: Don't leak transformed region 2019-07-12 17:00:32 +00:00
animation.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
bindings.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
clipboard.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
compositor.c backend-drm: fix race during system suspend 2019-07-12 17:16:52 +00:00
content-protection.c libweston: Notify client for change in content-protection status 2019-07-05 14:13:24 +05:30
data-device.c data-device: send INVALID_FINISH when operation != dnd 2019-04-19 22:06:37 +05:30
dbus.c dbus: Don't return value from void function 2019-06-11 11:31:04 +01:00
dbus.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
git-version.h.meson Add Meson build system 2018-12-09 14:50:54 +02:00
input.c libweston: Fix/clean-up doxygen warnings 2019-06-25 14:05:54 +00:00
launcher-direct.c log: remove "%m" from format strings by using strerror(errno) 2019-05-02 22:10:30 +02:00
launcher-impl.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
launcher-logind.c backend-drm: handle multiple drm nodes with logind 2019-06-13 18:40:56 +01:00
launcher-util.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
launcher-util.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
launcher-weston-launch.c log: remove "%m" from format strings by using strerror(errno) 2019-05-02 22:10:30 +02:00
libinput-device.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
libinput-device.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
libinput-seat.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
libinput-seat.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
linux-dmabuf.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
linux-dmabuf.h linux-dmabuf: send deprecated format events 2018-01-18 11:24:19 +00:00
linux-explicit-synchronization.c libweston: Fix/clean-up doxygen warnings 2019-06-25 14:05:54 +00:00
linux-explicit-synchronization.h libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
linux-sync-file-uapi.h libweston: Introduce an internal linux sync file API 2019-02-06 12:21:56 +00:00
linux-sync-file.c libweston: export weston_linux_sync_file_read_timestamp() 2019-04-18 12:50:55 +03:00
linux-sync-file.h libweston: export weston_linux_sync_file_read_timestamp() 2019-04-18 12:50:55 +03:00
log.c libweston: Fix/clean-up doxygen warnings 2019-06-25 14:05:54 +00:00
meson.build libweston: Add content-protection protocol implementation 2019-07-04 14:18:50 +05:30
noop-renderer.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
pixel-formats.c pixel-formats: Remove duplicate doc string 2019-06-26 12:27:14 +01:00
pixel-formats.h pixel-formats: Added pixel_format_get_info_shm() helper for printing SHM buffers 2018-11-20 18:00:09 +02:00
pixman-renderer.c libweston: Support zwp_surface_synchronization_v1.get_release 2019-02-06 12:21:56 +00:00
pixman-renderer.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
plugin-registry.c Rename plugin-registry.h to libweston/plugin-registry.h 2019-04-18 12:31:46 +03:00
screenshooter.c log: remove "%m" from format strings by using strerror(errno) 2019-05-02 22:10:30 +02:00
spring-tool.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
timeline.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
timeline.h timeline: Add GPU timestamp timepoint argument 2017-09-29 10:20:42 +03:00
touch-calibration.c Rename zalloc.h to libweston/zalloc.h 2019-04-18 12:31:46 +03:00
vertex-clipping.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
weston-debug.c libweston: Fix/clean-up doxygen warnings 2019-06-25 14:05:54 +00:00
weston-launch.c log: remove "%m" from format strings by using strerror(errno) 2019-05-02 22:10:30 +02:00
weston-launch.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
zoom.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00