Skip to content

Commit 23d4162

Browse files
author
Zhang Yubing
committed
drm/rockchip: vop2: calculate dclk first when dsc enable
When the request pixelclk is under 600MHz, vop2 will calculate dclk first. When the dsc is enabled. vop2 will calculate dsc clk first then dclk. the dclk rate get from the first time calclulate dsc clk and second set dck may be different, which will get wrong dsc clk when use the latest dclk rate to recalculate it. So the dclk should be calculated before dsc clk when dsc enable and pixelclk is under 600MHz. Signed-off-by: Zhang Yubing <[email protected]> Change-Id: If6794a266dd624be2cd14ab1be0ee0c0db20b49a
1 parent ce0d012 commit 23d4162

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5914,19 +5914,6 @@ static int vop2_calc_if_clk(struct drm_crtc *crtc, const struct vop2_connector_i
59145914
snprintf(clk_name, sizeof(clk_name), "dclk_out%d", vp->id);
59155915
dclk_out = vop2_clk_get(vop2, clk_name);
59165916

5917-
if (vcstate->dsc_enable) {
5918-
if ((vcstate->dsc_txp_clk_rate >= dclk_core_rate) &&
5919-
(vcstate->dsc_txp_clk_rate >= if_pixclk->rate)) {
5920-
dsc_txp_clk_is_biggest = true;
5921-
if (vcstate->output_flags & ROCKCHIP_OUTPUT_DUAL_CHANNEL_LEFT_RIGHT_MODE) {
5922-
vop2_set_dsc_clk(crtc, 0);
5923-
vop2_set_dsc_clk(crtc, 1);
5924-
} else {
5925-
vop2_set_dsc_clk(crtc, dsc_id);
5926-
}
5927-
}
5928-
}
5929-
59305917
/*
59315918
* HDMI use 1:1 dclk for rgb/yuv444, 1:2 for yuv420 when
59325919
* pixclk <= 600
@@ -5946,6 +5933,19 @@ static int vop2_calc_if_clk(struct drm_crtc *crtc, const struct vop2_connector_i
59465933
}
59475934
}
59485935

5936+
if (vcstate->dsc_enable) {
5937+
if ((vcstate->dsc_txp_clk_rate >= dclk_core_rate) &&
5938+
(vcstate->dsc_txp_clk_rate >= if_pixclk->rate)) {
5939+
dsc_txp_clk_is_biggest = true;
5940+
if (vcstate->output_flags & ROCKCHIP_OUTPUT_DUAL_CHANNEL_LEFT_RIGHT_MODE) {
5941+
vop2_set_dsc_clk(crtc, 0);
5942+
vop2_set_dsc_clk(crtc, 1);
5943+
} else {
5944+
vop2_set_dsc_clk(crtc, dsc_id);
5945+
}
5946+
}
5947+
}
5948+
59495949
if (dclk_core_rate > if_pixclk->rate) {
59505950
clk_set_rate(dclk_core->hw.clk, dclk_core_rate);
59515951
if (output_if_is_mipi(conn_id))

0 commit comments

Comments
 (0)