From 01cbf345a913d5127b426f4733a3226bb6230a6d Mon Sep 17 00:00:00 2001 From: mingzhangqun Date: Mon, 1 Jun 2026 02:36:11 +0000 Subject: [PATCH 1/2] drm/rockchip: rk3576: switch DSI dclk_src from vpll to cpll --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index fe4c7fe9ba698..10a6df4002ecc 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -10226,6 +10226,25 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_sta ret = vop2_clk_set_parent_extend(vp, vcstate, true); if (ret < 0) goto out; + + /* + * For RK3576 MIPI/DSI output, switch dclk_src parent from vpll + * to cpll. This prevents DP's vpll reprogramming from breaking + * DSI pixel clock when both displays are active. + * cpll at 1000MHz supports 720x1280@60 exactly (1000/12=83.33MHz). + */ + if (vop2->version == VOP_VERSION_RK3576 && + (vcstate->output_if & (VOP_OUTPUT_IF_MIPI0 | VOP_OUTPUT_IF_MIPI1))) { + struct clk_hw *dclk_hw = __clk_get_hw(vp->dclk); + if (dclk_hw) { + struct clk_hw *src_hw = clk_hw_get_parent(dclk_hw); + if (src_hw) { + struct clk *cpll = __clk_lookup("cpll"); + if (cpll) + clk_set_parent(src_hw->clk, cpll); + } + } + } if (dclk) dclk_rate = dclk->rate; else From ae0ddef3e9d38cd40cb98cf1affe8352d71efc7c Mon Sep 17 00:00:00 2001 From: mingzhangqun Date: Mon, 1 Jun 2026 02:36:15 +0000 Subject: [PATCH 2/2] drm/rockchip: dw-mipi-dsi2: set panel orientation before device --- drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c index c56bec9c08221..add2543022f66 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c @@ -1497,6 +1497,10 @@ static int dw_mipi_dsi2_connector_init(struct dw_mipi_dsi2 *dsi2) drm_connector_helper_add(connector, &dw_mipi_dsi2_connector_helper_funcs); + + if (dsi2->panel) + drm_connector_set_orientation_from_panel(connector, dsi2->panel); + ret = drm_connector_attach_encoder(connector, encoder); if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to attach encoder: %d\n", ret);