drm/mediatek: Support dynamic selection of MT8188 VDOSYS0
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Wed, 4 Oct 2023 02:40:11 +0000 (10:40 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Sun, 8 Oct 2023 01:18:06 +0000 (01:18 +0000)
Move DDP_COMPONENT_DP_INTF0 from mt8188_mtk_ddp_main
array to a connector routes array called
mt8188_mtk_ddp_main_routes and add DDP_COMPONENT_DSI0
to mt8188_mtk_ddp_main_routes to support dynamic
selection capability for mt8188.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nathan Lu <nathan.lu@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-8-jason-jh.lin@mediatek.com/
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-10-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_drv.c

index 4d520d0cb12723e980d19e9c77332e4e03b00026..2dfaa613276a6d7ef836b2bcbfc2ecac730466f1 100644 (file)
@@ -186,7 +186,11 @@ static const unsigned int mt8188_mtk_ddp_main[] = {
        DDP_COMPONENT_GAMMA,
        DDP_COMPONENT_POSTMASK0,
        DDP_COMPONENT_DITHER0,
-       DDP_COMPONENT_DP_INTF0,
+};
+
+static const struct mtk_drm_route mt8188_mtk_ddp_main_routes[] = {
+       {0, DDP_COMPONENT_DP_INTF0},
+       {0, DDP_COMPONENT_DSI0},
 };
 
 static const unsigned int mt8192_mtk_ddp_main[] = {
@@ -288,6 +292,8 @@ static const struct mtk_mmsys_driver_data mt8186_mmsys_driver_data = {
 static const struct mtk_mmsys_driver_data mt8188_vdosys0_driver_data = {
        .main_path = mt8188_mtk_ddp_main,
        .main_len = ARRAY_SIZE(mt8188_mtk_ddp_main),
+       .conn_routes = mt8188_mtk_ddp_main_routes,
+       .num_conn_routes = ARRAY_SIZE(mt8188_mtk_ddp_main_routes),
        .mmsys_dev_num = 1,
 };