mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-26 07:40:05 +01:00
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> |
||
|---|---|---|
| .. | ||
| desktop | ||
| man | ||
| .gitignore | ||
| drm.xml | ||
| meson.build | ||
| xwayland-cursor.c | ||
| xwayland-cursor.h | ||
| xwayland-cvt.c | ||
| xwayland-cvt.h | ||
| xwayland-dmabuf.c | ||
| xwayland-dmabuf.h | ||
| xwayland-drm-lease.c | ||
| xwayland-drm-lease.h | ||
| xwayland-glamor-gbm.c | ||
| xwayland-glamor-gbm.h | ||
| xwayland-glamor-xv.c | ||
| xwayland-glamor.c | ||
| xwayland-glamor.h | ||
| xwayland-input.c | ||
| xwayland-input.h | ||
| xwayland-output.c | ||
| xwayland-output.h | ||
| xwayland-pixmap.c | ||
| xwayland-pixmap.h | ||
| xwayland-present.c | ||
| xwayland-present.h | ||
| xwayland-screen.c | ||
| xwayland-screen.h | ||
| xwayland-shm.c | ||
| xwayland-shm.h | ||
| xwayland-types.h | ||
| xwayland-vidmode.c | ||
| xwayland-vidmode.h | ||
| xwayland-window-buffers.c | ||
| xwayland-window-buffers.h | ||
| xwayland-window.c | ||
| xwayland-window.h | ||
| xwayland-xtest.c | ||
| xwayland-xtest.h | ||
| xwayland.c | ||