drm/rockchop: vop2: set extend clk vp mask

When a extend clk is used before enter kernel, it need set the vp
mask to mark that it have been used by a video port

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ie6f0419621e8b250adca1783355318d4a9a2412d
This commit is contained in:
Zhang Yubing
2022-06-24 16:14:20 +08:00
committed by Tao Huang
parent 0add4d704d
commit d1fe482eec

View File

@@ -5163,6 +5163,9 @@ static int vop2_crtc_loader_protect(struct drm_crtc *crtc, bool on)
struct drm_crtc_state *crtc_state;
struct drm_display_mode *mode;
struct vop2_win *win, *splice_win;
struct vop2_extend_pll *ext_pll;
struct clk *parent_clk;
const char *clk_name;
if (on == vp->loader_protect)
return 0;
@@ -5200,6 +5203,17 @@ static int vop2_crtc_loader_protect(struct drm_crtc *crtc, bool on)
}
}
}
parent_clk = clk_get_parent(vp->dclk);
clk_name = __clk_get_name(parent_clk);
if (!strcmp(clk_name, "clk_hdmiphy_pixel0")) {
ext_pll = vop2_extend_clk_find_by_name(vop2, "hdmi0_phy_pll");
if (ext_pll)
ext_pll->vp_mask |= BIT(vp->id);
} else if (!strcmp(clk_name, "clk_hdmiphy_pixel1")) {
ext_pll = vop2_extend_clk_find_by_name(vop2, "hdmi1_phy_pll");
if (ext_pll)
ext_pll->vp_mask |= BIT(vp->id);
}
drm_crtc_vblank_on(crtc);
if (private->cubic_lut[vp->id].enable) {
dma_addr_t cubic_lut_mst;