drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits
authorSimon Ser <contact@emersion.fr>
Wed, 22 Nov 2023 16:19:39 +0000 (13:19 -0300)
committerSimon Ser <contact@emersion.fr>
Thu, 23 Nov 2023 16:12:49 +0000 (17:12 +0100)
commit4b4af74ab9719d17538a97f43137e93296ec7437
treef397969347a177f9c54d01a785377a15ff327daf
parent0e26cc72c71cb98e951716a6596060cd04b0ba6b
drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits

If the driver supports it, allow user-space to supply the
DRM_MODE_PAGE_FLIP_ASYNC flag to request an async page-flip.
Set drm_crtc_state.async_flip accordingly.

Document that drivers will reject atomic commits if an async
flip isn't possible. This allows user-space to fall back to
something else. For instance, Xorg falls back to a blit.
Another option is to wait as close to the next vblank as
possible before performing the page-flip to reduce latency.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Co-developed-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231122161941.320564-3-andrealmeid@igalia.com
drivers/gpu/drm/drm_atomic_uapi.c
include/uapi/drm/drm_mode.h