xserver/hw/xwayland
Erik Kurzinger d5192ba8eb xwayland: use write fence in xwl_glamor_dmabuf_import_sync_file
The functions xwl_glamor_dmabuf_import_sync_file and
xwl_glamor_dmabuf_export_sync_file are used to ensure proper
synchronization between clients using PresentPixmapSynced and
compositors that do not support the wp_linux_drm_syncobj_v1 protocol
when presenting by flipping. The acquire point's fence will be imported
as the DMA-BUF's implicit fence before handing it off to the compositor,
and then, after the DMA-BUF has been released, its new implicit fence
will be exported and become the release point's fence which the client
is expected to wait for before re-using the buffer.

Both functions currently set the flags arguments of their respective
ioctls to DMA_BUF_SYNC_READ. When importing a sync file, this means that
any subsequent implicitly synchronized reads from the buffer will not
wait for the fence, and when exporting a sync file it means that the
returned fence may be signaled before preceeding reads from the buffer
have completed.

While this is correct for xwl_glamor_dmabuf_export_sync_file since the
compositor will never write to the buffer, it is incorrect for
xwl_glamor_dmabuf_import_sync_file. To avoid corruption, we need any
reads from the buffer by the compositor to wait on the acquire point's
fence.

As a fix, instead of setting the DMA_BUF_SYNC_READ flag in
xwl_glamor_dmabuf_import_sync_file, we set the DMA_BUF_SYNC_WRITE flag.
This *does* provide the necessary guarantees.

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1509>
2024-04-30 13:18:30 +00:00
..
desktop xwayland: Use "-decorate" if available 2024-03-18 23:19:59 +00:00
man xwayland: Update the global screen scale 2024-03-20 09:05:36 +01:00
.gitignore xwayland: Add wp_viewport wayland extension support 2019-10-12 12:19:14 +02:00
drm.xml wayland: Sync drm.xml with Mesa 2017-07-05 10:13:04 -04:00
meson.build xwayland: Use exec name instead of hardcoding '/Xwayland' 2024-04-17 15:20:05 +00:00
xwayland-cursor.c xwayland: Account for the scale factor 2024-03-20 09:05:36 +01:00
xwayland-cursor.h xwayland: Add xwl_cursor_clear_frame_cb() 2021-10-25 12:05:42 +00:00
xwayland-cvt.c xwayland: Keep the CVT timings for non-standard modes 2023-05-15 10:33:21 +02:00
xwayland-cvt.h xwayland: Move Xwayland CVT declaration 2019-12-20 16:19:01 +01:00
xwayland-dmabuf.c xwayland: Use drmDevicesEqual in xwl_dmabuf_feedback_tranche_done 2024-04-12 07:25:55 +00:00
xwayland-dmabuf.h xwayland: Move dmabuf code to its own source file 2024-03-14 15:00:46 +01:00
xwayland-drm-lease.c xwayland: Do not remove output on withdraw if leased 2024-04-30 09:13:34 +02:00
xwayland-drm-lease.h Xwayland: implement drm-lease-v1 2021-12-07 10:02:29 +00:00
xwayland-glamor-gbm.c xwayland: use write fence in xwl_glamor_dmabuf_import_sync_file 2024-04-30 13:18:30 +00:00
xwayland-glamor-gbm.h xwayland/glamor: Make xwl_glamor_init_gbm() return its status 2024-03-18 15:41:17 +00:00
xwayland-glamor-xv.c xwayland: Cleanup and remove `xwayland.h` 2019-12-20 16:19:01 +01:00
xwayland-glamor.c Revert "xwayland/glamor: Avoid implicit redirection with depth 32 parent windows" 2024-04-11 07:33:19 +00:00
xwayland-glamor.h xwayland: Pass xwl_window to xwl_glamor_dri3_syncobj_passthrough 2024-04-10 08:55:08 +00:00
xwayland-input.c include: move private definitions out of exevents.h 2024-04-30 00:47:38 +00:00
xwayland-input.h xwayland: Use xwl_window for tracking focus/touch 2024-04-10 08:55:08 +00:00
xwayland-output.c xwayland: Check for duplicate output names 2024-04-23 11:14:31 +02:00
xwayland-output.h xwayland: Do not remove output on withdraw if leased 2024-04-30 09:13:34 +02:00
xwayland-pixmap.c xwayland: Add xwl_pixmap_get_wl_buffer helper 2024-01-22 14:14:05 +00:00
xwayland-pixmap.h xwayland: Replace window pixmap as needed for drawing operation 2024-03-06 17:12:54 +01:00
xwayland-present.c xwayland/present: Check window & source pixmap depth match last 2024-04-10 08:55:08 +00:00
xwayland-present.h xwayland/present: Add xwl_present_maybe_(un)redirect_window 2024-04-10 08:55:08 +00:00
xwayland-screen.c xwayland: Set wl_surface input region 2024-04-30 12:46:49 +00:00
xwayland-screen.h xwayland: Set wl_surface input region 2024-04-30 12:46:49 +00:00
xwayland-shm.c os: move os_move_fd() out of public API 2024-03-09 17:12:46 +00:00
xwayland-shm.h xwayland: Move SHM declarations to their own header 2019-12-20 16:19:01 +01:00
xwayland-types.h xwayland/glamor: Remove the xwl_egl_backend structure 2024-03-18 15:41:18 +00:00
xwayland-vidmode.c dix: unexport GetCurrentClient() 2024-04-15 23:47:47 +00:00
xwayland-vidmode.h xwayland: Move Xwayland vidmode declaration 2019-12-20 16:19:01 +01:00
xwayland-window-buffers.c xwayland: Add xwl_window::surface_window 2024-04-10 08:55:08 +00:00
xwayland-window-buffers.h xwayland: Drop xwl_window_buffers_get_pixmap() 2024-03-18 15:41:18 +00:00
xwayland-window.c xwayland: Set wl_surface input region 2024-04-30 12:46:49 +00:00
xwayland-window.h xwayland: Set wl_surface input region 2024-04-30 12:46:49 +00:00
xwayland-xtest.c dix: unexport GetCurrentClient() 2024-04-15 23:47:47 +00:00
xwayland-xtest.h xwayland: Fallback to plain XTEST if EI does not work 2023-06-26 13:19:19 +02:00
xwayland.c os: unexport Os*() functions 2024-04-16 14:20:30 +02:00