[PATCH 2/2] drm/imx: dc-crtc: Use flush worker

Liu Ying victor.liu at nxp.com
Fri Oct 31 03:21:25 PDT 2025


As dc_crtc_atomic_flush() is blocking due to waiting for shadow load
done event, page flip performance could be low when atomic flush for
two CRTCs are conducted sequentially by drm_atomic_helper_commit_planes()
with a single atomic commit.  So, call drmm_crtc_flush_worker_init()
from dc_crtc_init() to initialize a flush worker for each CRTC so that
atomic flush can run in parallel by drm_atomic_helper_commit_planes()
for multiple CRTCs to achieve better page flip performance.

Signed-off-by: Liu Ying <victor.liu at nxp.com>
---
 drivers/gpu/drm/imx/dc/dc-crtc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/dc/dc-crtc.c b/drivers/gpu/drm/imx/dc/dc-crtc.c
index 31d3a982deaf7a0390937285c9d5d00100323181..fb1049a09296a3ecaad8d1430d818fd6e2f25a54 100644
--- a/drivers/gpu/drm/imx/dc/dc-crtc.c
+++ b/drivers/gpu/drm/imx/dc/dc-crtc.c
@@ -540,8 +540,15 @@ int dc_crtc_init(struct dc_drm_device *dc_drm, int crtc_index)
 
 	ret = drm_crtc_init_with_planes(drm, &dc_crtc->base, &dc_primary->base,
 					NULL, &dc_crtc_funcs, NULL);
-	if (ret)
+	if (ret) {
 		dev_err(de->dev, "failed to add CRTC: %d\n", ret);
+		return ret;
+	}
+
+	ret = drmm_crtc_flush_worker_init(drm, &dc_crtc->base);
+	if (ret)
+		dev_err(de->dev,
+			"failed to initialize flush worker for CRTC: %d\n", ret);
 
 	return ret;
 }

-- 
2.34.1




More information about the linux-arm-kernel mailing list