weston/libweston
Alexandros Frantzis acff29b3b3 libweston: Support zwp_surface_synchronization_v1.set_acquire_fence
Implement the set_acquire_fence request of the
zwp_surface_synchronization_v1 interface.

The implementation uses the acquire fence in two ways:

1. If the associated buffer is used as GL render source, an
   EGLSyncKHR is created from the fence and used to synchronize
   access.
2. If the associated buffer is used as a plane framebuffer,
   the acquire fence is treated as an in-fence for the atomic
   commit operation. If in-fences are not supported and the buffer
   has an acquire fence, we don't consider it for plane placement.

If the used compositor/renderer doesn't support explicit
synchronization, we don't advertise the protocol at all. Currently only
the DRM and X11 backends when using the GL renderer advertise the
protocol for production use.

Issues for discussion
---------------------

a. Currently, a server-side wait of EGLSyncKHR is performed before
   using the EGLImage/texture during rendering. Unfortunately, it's not clear
   from the specs whether this is generally safe to do, or we need to
   sync before glEGLImageTargetTexture2DOES. The exception is
   TEXTURE_EXTERNAL_OES where the spec mentions it's enough to sync
   and then glBindTexture for any changes to take effect.

Changes in v5:
  - Meson support.
  - Make explicit sync server error reporting more generic, supporting
    all explicit sync related interfaces not just
    wp_linux_surface_synchronization.
  - Fix typo in warning for missing EGL_KHR_wait_sync extension.
  - Support minor version 2 of the explicit sync protocol (i.e., support
    fences for opaque EGL buffers).

Changes in v4:
  - Introduce and use fd_clear and and fd_move helpers.
  - Don't check for a valid buffer when updating surface acquire fence fd
    from state.
  - Assert that pending state acquire fence fd is always clear
    after a commit.
  - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to just the
    renderer.
  - Check for EGL_KHR_wait_sync before using eglWaitSyncKHR.
  - Dup the acquire fence before passing to EGL.

Changes in v3:
  - Keep acquire_fence_fd in surface instead of buffer.
  - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to both backend and
    renderer.
  - Move comment about non-ownership of in_fence_fd to struct
    drm_plane_state definition.
  - Assert that we don't try to use planes with in-fences when using the
    legacy KMS API.
  - Remove unnecessary info from wayland error messages.
  - Handle acquire fence for subsurface commits.
  - Guard against self-update in fd_update.
  - Disconnect the client if acquire fence EGLSyncKHR creation or wait
    fails.
  - Use updated protocol interface names.
  - User correct format specifier for resource ids.
  - Advertise protocol for X11 backend with GL renderer.

Changes in v2:
  - Remove sync file wait fallbacks.
  - Raise UNSUPPORTED_BUFFER error at commit if we have an acquire
    fence, but the committed buffer is not a valid linux_dmabuf.
  - Don't put buffers with in-fences on planes that don't support
    in-fences.
  - Don't advertise explicit sync protocol if backend does not
    support explicit sync.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00
..
animation.c build,libweston: Use struct timespec for animations 2017-11-27 11:41:17 +02:00
bindings.c libweston: Use struct timespec for touch down events 2017-11-27 11:42:07 +02:00
clipboard.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
compositor-drm.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
compositor-drm.h compositor-drm: Add Support virtual output 2018-10-30 17:09:01 +09:00
compositor-fbdev.c libweston: fbdev: Force the Framebuffer devices to be activated. 2019-01-31 09:46:42 +00:00
compositor-fbdev.h compositor-fbdev: support the --seat option, (and XDG_SEAT variable) 2018-07-02 15:29:38 +03:00
compositor-headless.c libweston: Introduce zwp_linux_explicit_synchronization_v1 2019-02-06 12:21:56 +00:00
compositor-headless.h weston: Store use_pixman as `bool` type 2019-01-31 08:57:54 +00:00
compositor-rdp.c rdp-compositor: fix compilation with FreeRDP 2.0-rc4 2018-12-04 23:42:27 +01:00
compositor-rdp.h weston: Port RDP backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-wayland.c libweston: notify_touch API to use weston_touch_device 2018-05-30 14:45:58 +03:00
compositor-wayland.h compositor-wayland: Convert fullscreen flag to bool 2016-10-14 10:42:17 +02:00
compositor-x11.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
compositor-x11.h weston: Port X11 backend to new output handling API 2016-10-05 14:59:09 +03:00
compositor.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
compositor.h libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
data-device.c libweston: Make weston_seat release safe 2018-02-15 13:14:14 +02:00
dbus.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
dbus.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
git-version.h.meson Add Meson build system 2018-12-09 14:50:54 +02:00
gl-renderer.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
gl-renderer.h gl-renderer: provide fence sync fd for synchronizing with GPU rendering 2018-10-30 17:09:01 +09:00
input.c input: Send unique keymap file descriptors to clients 2018-08-17 09:25:24 -05:00
launcher-direct.c libweston: remove restore functionality 2018-02-09 15:16:07 +00:00
launcher-impl.h libweston: remove restore functionality 2018-02-09 15:16:07 +00:00
launcher-logind.c launcher-logind: only get a VT on seat0, as only seat0 supports VTs 2018-07-02 15:29:38 +03:00
launcher-util.c launcher-logind: only get a VT on seat0, as only seat0 supports VTs 2018-07-02 15:29:38 +03:00
launcher-util.h libweston: remove restore functionality 2018-02-09 15:16:07 +00:00
launcher-weston-launch.c libweston: remove restore functionality 2018-02-09 15:16:07 +00:00
libbacklight.c Switch to use safe_strtoint instead of strtol 2016-08-06 18:19:22 -07:00
libbacklight.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libinput-device.c libweston: introduce notify_touch_normalized() and doc 2018-05-30 14:46:05 +03:00
libinput-device.h input: introduce weston_touch_device 2018-05-30 14:42:13 +03:00
libinput-seat.c libweston: require connected heads for input devices 2018-04-20 15:27:54 +03:00
libinput-seat.h libweston: require connected heads for input devices 2018-04-20 15:27:54 +03:00
libweston-protocols.pc.in protocol: add weston-debug.xml 2018-09-11 15:24:46 +01:00
libweston-uninstalled.pc.in buildsystem: add missing pkg-config stub for libweston uninstalled 2017-11-10 12:50:41 -06:00
libweston.pc.in libweston: fix major in libweston.pc 2016-08-02 14:19:11 +03:00
linux-dmabuf.c linux-dmabuf: send deprecated format events 2018-01-18 11:24:19 +00:00
linux-dmabuf.h linux-dmabuf: send deprecated format events 2018-01-18 11:24:19 +00:00
linux-explicit-synchronization.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +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: Introduce an internal linux sync file API 2019-02-06 12:21:56 +00:00
linux-sync-file.h libweston: Introduce an internal linux sync file API 2019-02-06 12:21:56 +00:00
log.c log: improve handling of use-before-init 2018-05-28 16:38:05 +03:00
meson.build libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
noop-renderer.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
pixel-formats.c pixel-formats: Document pixel format human-friendly conversion methods 2019-01-23 16:28:21 +02: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 gl-renderer, pixman: disconnect the client on unhandled buffer type. 2018-11-02 14:28:05 +00:00
pixman-renderer.h pixman: make shadow buffer optional 2018-05-24 17:20:04 +03:00
plugin-registry.c compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
plugin-registry.h compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
screenshooter.c libweston/screnshooter: Fix weston screenshot event done if there's no client running 2018-12-18 15:37:34 +02:00
spring-tool.c build,libweston: Use struct timespec for animations 2017-11-27 11:41:17 +02:00
timeline-object.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
timeline.c file-util: allow specifying path separately in file_create_dated() 2018-02-09 15:16:07 +00:00
timeline.h timeline: Add GPU timestamp timepoint argument 2017-09-29 10:20:42 +03:00
touch-calibration.c libweston: implement touch calibration protocol 2018-05-30 14:46:24 +03:00
vaapi-recorder.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vaapi-recorder.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
version.h.in Rename src/ to libweston/ 2016-06-23 17:44:54 +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/weston-debug: Add a easy way to determine if the debug protocol has been enabled 2018-12-18 15:37:34 +02:00
weston-debug.h libweston/weston-debug: Add a easy way to determine if the debug protocol has been enabled 2018-12-18 15:37:34 +02:00
weston-launch.c weston-launch: always run through all groups 2018-06-11 16:20:39 +03:00
weston-launch.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
windowed-output-api.h libweston: change windowed_output_api output_create to create_head 2018-04-17 15:19:57 +03:00
zoom.c libweston: Make weston_pointer destruction safe 2018-02-14 15:14:16 +02:00