From: Ville Syrjälä <[email protected]> The "async update" stuff has nothing to do with async vs. sync updates as far as the hardware is concerned (as in tearing vs. not). What it does is bypass the normal commit machinery and just let the driver directly perform the update (as it sees fit) and swap the plane state without involving the whole crtc commit machinery.
The actual hardware update it does could be an async flip (as in tearing) or a mailbox flip, depending on how the driver decides to do it. I also suspect some drivers abusing this for async flips might be performing mailbox updates under the hood, which is very broken because the commits complete in completely random order and userspace has no idea when the hardware has stopped scanning out from the old framebuffer. That means userspace thinks it can start rendering new stuff to what is still the current hardware scanout buffer. That will lead to incomplete live rendering appearing on the screen, which is never OK. Effectively one is performing front buffer rendering at that point. This kind of fake async flip implementation would immediately fail igt/kms_async_flips/crc, but that test requires the driver/hardware to have working CRC support. To make mailbox updates actually correct we would need out fences, and a mechanism to signal them in the correct order. Cc: [email protected] Cc: André Almeida <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: Christopher Snowhill <[email protected]> Cc: Dave Stevenson <[email protected]> Cc: Dharma Balasubiramani <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Cc: [email protected] Cc: Gustavo Padovan <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Icenowy Zheng <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Jianmin Lv <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Liviu Dudau <[email protected]> Cc: Maíra Canal <[email protected]> Cc: Manikandan Muralidharan <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Mingcong Bai <[email protected]> Cc: [email protected] Cc: Qianhai Wu <[email protected]> Cc: Raspberry Pi Kernel Maintenance <[email protected]> Cc: Simon Ser <[email protected]> Cc: [email protected] Cc: Xaver Hugl <[email protected]> Cc: Xi Ruoyao <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> --- drivers/gpu/drm/drm_atomic_helper.c | 9 ++++----- include/drm/drm_modeset_helper_vtables.h | 6 ++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index ccfe3840d505..f81eb29d9ac8 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2187,11 +2187,10 @@ EXPORT_SYMBOL(drm_atomic_helper_async_check); * @dev: DRM device * @state: the driver state object * - * This function commits a state asynchronously, i.e., not vblank - * synchronized. It should be used on a state only when - * drm_atomic_async_check() succeeds. Async commits are not supposed to swap - * the states like normal sync commits, but just do in-place changes on the - * current state. + * This function commits a state asynchronously. It should be used on a state + * only when drm_atomic_async_check() succeeds. Async commits are not supposed + * to swap the states like normal sync commits, but just do in-place changes + * on the current state. * * TODO: Implement full swap instead of doing in-place changes. */ diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 60b30cc26940..c2431c08a60a 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -1424,8 +1424,7 @@ struct drm_plane_helper_funcs { * @atomic_async_check: * * Drivers should set this function pointer to check if the plane's - * atomic state can be updated in a async fashion. Here async means - * "not vblank synchronized". + * atomic state can be updated in a async fashion. * * This hook is called by drm_atomic_async_check() to establish if a * given update can be committed asynchronously, that is, if it can @@ -1449,8 +1448,7 @@ struct drm_plane_helper_funcs { * * Drivers should set this function pointer to perform asynchronous * updates of planes, that is, jump ahead of the currently queued - * state and update the plane. Here async means "not vblank - * synchronized". + * state and update the plane. * * This hook is called by drm_atomic_helper_async_commit(). * -- 2.56.0
