weston/tests
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
..
reference tests: add subsurface-shot test 2017-02-07 14:25:27 +02:00
.gitignore Revert "gitignore: Ignore generated header test files" 2015-05-26 23:22:19 -07:00
bad-buffer-test.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
config-parser-test.c Re-apply "config-parser: Catch negative numbers assigned to unsigned config values" 2016-07-26 16:21:20 -07:00
devices-test.c tests: Add test for seat destruction and creation 2018-02-15 13:14:57 +02:00
event-test.c tests: Move wl_pointer tests to their own file 2017-12-12 12:17:08 +02:00
input-timestamps-helper.c tests: fix include in input-timestamps-helper.c 2018-12-09 14:49:07 +02:00
input-timestamps-helper.h tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
internal-screenshot-test.c tests: Add checks for pointer motion and button event timestamps 2017-12-18 11:27:43 +02:00
internal-screenshot.ini tests: Add internal test for the weston test screenshot capability 2015-05-21 15:06:11 -07:00
ivi-layout-internal-test.c tests: Reshuffle IVI layout tests 2018-06-20 16:10:12 +03:00
ivi-layout-test-client.c tests: Reshuffle IVI layout tests 2018-06-20 16:10:12 +03:00
ivi-layout-test-plugin.c tests: Reshuffle IVI layout tests 2018-06-20 16:10:12 +03:00
ivi-shell-app-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
ivi-test.h ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
keyboard-test.c libweston: Implement keyboard timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
linux-explicit-synchronization-test.c libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
matrix-test.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
meson.build libweston: Introduce zwp_linux_explicit_synchronization_v1 2019-02-06 12:21:56 +00:00
plugin-registry-test.c tests: use weston_compositor_exit 2019-02-06 10:58:22 +00:00
pointer-test.c libweston: Implement pointer timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
presentation-test.c shared: Add timespec_from_proto helper function 2017-12-18 11:27:43 +02:00
roles-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
setbacklight.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
string-test.c tests: add missing include 2017-01-23 14:12:06 +02:00
subsurface-shot-test.c tests: Add checks for pointer motion and button event timestamps 2017-12-18 11:27:43 +02:00
subsurface-test.c Fix 'implicit fallthrough' warning with new GCC 2017-03-13 17:56:07 +00:00
surface-global-test.c tests: use weston_compositor_exit 2019-02-06 10:58:22 +00:00
surface-screenshot-test.c tests: Rename surface-screenshot 2018-12-09 12:13:36 +02:00
surface-test.c tests: use weston_compositor_exit 2019-02-06 10:58:22 +00:00
text-test.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
timespec-test.c shared: Add timespec_eq helper function 2018-02-20 10:20:29 +02:00
touch-test.c libweston: Implement touch timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
vertex-clip-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
viewporter-test.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
weston-test-client-helper.c tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
weston-test-client-helper.h tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
weston-test-desktop-shell.c helpers: Move static_assert definition to shared 2018-07-09 15:39:20 +01:00
weston-test-runner.c tests: doc iterating in the runner 2017-02-07 14:25:27 +02:00
weston-test-runner.h tests: Mark tests as used so they don’t get removed at link time 2017-12-01 16:53:53 +00:00
weston-test.c tests: use weston_compositor_exit 2019-02-06 10:58:22 +00:00
weston-tests-env tests: Reshuffle IVI layout tests 2018-06-20 16:10:12 +03:00
xwayland-test.c tests: Skip Xwayland test if binary isn't available 2016-11-30 10:28:04 +00:00