drm/rockchip: vop2: adjust VOP aclk mode according to line duration

Some panel resolution is less than 2560 but pixel clock/fps is
relatively large, In this scene, VOP aclk need enter advance mode to
make sure VOP performance is enough. 4kp60 line duration is roughly
equal to 7500 ns, so we add a condition(linedur_ns < 7500) to enter
VOP aclk advance mode.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I50e15e8b05cfcf3c92704b8d96287099ce851686
This commit is contained in:
Sandy Huang
2025-01-08 10:56:40 +08:00
committed by Tao Huang
parent bb0e9e5f8b
commit 7b21f59425

View File

@@ -199,9 +199,13 @@ static int rockchip_drm_aclk_adjust(struct drm_device *dev,
funcs = priv->crtc_funcs[drm_crtc_index(crtc)];
if (funcs && funcs->set_aclk) {
struct drm_display_mode *mode = &crtc->state->adjusted_mode;
int linedur_ns = div_u64((u64) mode->crtc_htotal * 1000000, mode->crtc_clock);
if (vop_bw_info->plane_num_4k || crtc_num > 1 ||
crtc->state->adjusted_mode.crtc_hdisplay > 2560 ||
crtc->state->adjusted_mode.crtc_vdisplay > 2560) {
crtc->state->adjusted_mode.crtc_vdisplay > 2560 ||
linedur_ns < 7500) {/* 4kp60 linedur_ns roughly equal to 7500 ns */
funcs->set_aclk(crtc, ROCKCHIP_VOP_ACLK_ADVANCED_MODE, vop_bw_info);
priv->aclk_adjust_frame_num = 2;
} else {