]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/mediatek: Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb()
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Wed, 11 Dec 2024 03:47:16 +0000 (11:47 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 25 Dec 2024 15:18:55 +0000 (15:18 +0000)
commitda03801ad08f2488c01e684509cd89e1aa5d17ec
tree44dfc3ed6bde653fed72f1ca10acb37dedff3f6c
parent36684e9d88a2e2401ae26715a2e217cb4295cea7
drm/mediatek: Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb()

mtk_crtc_finish_page_flip() is used to notify userspace that a
page flip has been completed, allowing userspace to free the frame
buffer of the last frame and commit the next frame.

In MediaTek's hardware design for configuring display hardware by using
GCE, `DRM_EVENT_FLIP_COMPLETE` should be notified to userspace after
GCE has finished configuring all display hardware settings for each
atomic_commit().

Currently, mtk_crtc_finish_page_flip() cannot guarantee that GCE has
configured all the display hardware settings of the last frame.
Therefore, to increase the accuracy of the timing for notifying
`DRM_EVENT_FLIP_COMPLETE` to userspace, mtk_crtc_finish_page_flip()
should be moved to ddp_cmdq_cb().

Fixes: 7f82d9c43879 ("drm/mediatek: Clear pending flag when cmdq packet is done")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241211034716.29241-1-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_crtc.c