drm/mediatek: Power on/off devices with function pointers
authorHsiao Chien Sung <shawn.sung@mediatek.com>
Thu, 14 Dec 2023 05:58:38 +0000 (13:58 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Thu, 14 Dec 2023 14:34:13 +0000 (14:34 +0000)
commitb97fa2f3e19b9bbac934a2cfa9218aa67f12240e
tree3ad1b412f780bbc4f211cb015e2d2008132ab1d7
parent7bacaee4f5d0fdf00b1734c1be67cc415b3822c0
drm/mediatek: Power on/off devices with function pointers

Different from OVL, OVL adaptor is a pseudo device so we didn't
define it in the device tree, consequently, pm_runtime_resume_and_get()
called by .atomic_enable() powers on no device. For this reason, we
implement a function to power on the RDMAs in OVL adaptor, and the
system will make sure the IOMMUs are powered on as well because of the
device link (iommus) in the RDMA nodes in DTS.

This patch separates power and clock management process, it would be
easier to maintain and add extensions.

Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231214055847.4936-15-shawn.sung@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_drv.h
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
drivers/gpu/drm/mediatek/mtk_mdp_rdma.c