[PATCH 0/2] drm/atomic-helper: Support atomic flush with an optional kthread worker

From: Liu Ying

Date: Fri Oct 31 2025 - 06:21:17 EST


Hi,

As drm_atomic_helper_commit_planes() calls atomic_flush for CRTCs
sequentially and a driver's atomic_flush callback could be blocking,
the performance for flushing multiple CRTCs in a single atomic commit
could be low, like page flip for multiple CRTCs. A real case is imx8-dc,
which supports two CRTCs and does atomic_flush in a blocking way, i.e.,
waits for a done event for loading shadow registers.

To resolve that, introduce an optional kthread worker to conduct
flush in drm_atomic_helper_commit_planes(), so that flush can run in
parallel for multiple CRTCs.

Drivers should call drmm_crtc_flush_worker_init() to initialize the
kthread worker if they want to use it.

Patch 1 adds the optional kthread worker support.
Patch 2 makes imx8-dc use the kthread worker.

Let me know your thoughts. Thanks.

Signed-off-by: Liu Ying <victor.liu@xxxxxxx>
---
Liu Ying (2):
drm/atomic-helper: Support atomic flush with an optional kthread worker
drm/imx: dc-crtc: Use flush worker

drivers/gpu/drm/drm_atomic_helper.c | 27 ++++++++++++++++-
drivers/gpu/drm/drm_crtc.c | 59 +++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/imx/dc/dc-crtc.c | 9 +++++-
include/drm/drm_crtc.h | 45 ++++++++++++++++++++++++++++
4 files changed, 138 insertions(+), 2 deletions(-)
---
base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
change-id: 20251031-drm-crtc-flush-worker-0aac27acf40f

Best regards,
--
Liu Ying <victor.liu@xxxxxxx>