drm/mediatek: Add connector dynamic selection capability
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Wed, 4 Oct 2023 02:40:09 +0000 (10:40 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Sun, 8 Oct 2023 00:57:21 +0000 (00:57 +0000)
commit01389b324c97ff8f04e9c33b9ee246084f9f6dd2
treed9c7447b5de5026d5642e806d29d72e2562cf37e
parenta260f5624dfc6ec3eb7b5349f51d34c687c07b5c
drm/mediatek: Add connector dynamic selection capability

Add dynamic select available connector flow in mtk_drm_crtc_create()
and mtk_drm_crtc_atomic_enable().

In mtk_drm_crtc_create(), if there is a connector routes array in drm
driver data, all components definded in the connector routes array will
be checked and their encoder_index will be set.

In mtk_drm_crtc_atomic_enable(), crtc will check its encoder_index to
identify which componet in the connector routes array should append.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Signed-off-by: Nancy Lin <nancy.lin@mediatek.com>
Signed-off-by: Nathan Lu <nathan.lu@mediatek.com>
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-6-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_crtc.h
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
drivers/gpu/drm/mediatek/mtk_drm_drv.c
drivers/gpu/drm/mediatek/mtk_drm_drv.h