drm/rockchip: vop2: hdisplay must roundup 2/4 when calc pre_scan_dly

splice mode: hdisplay must roundup as 4 pixel,
no splice mode: hdisplay must roundup as 2 pixel.

otherwise will lead to POST_BUF_EMPTY and display black screen.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I0971a052751c411acef8ed2fcfd9f142caa37598
This commit is contained in:
Sandy Huang
2024-01-23 19:57:48 +08:00
committed by Tao Huang
parent 313e8b05f9
commit 90c661b591

View File

@@ -7743,7 +7743,8 @@ static void vop3_setup_pipe_dly(struct vop2_video_port *vp, const struct vop2_zp
sdr_win_dly = 0;
}
pre_scan_dly = bg_dly + (hdisplay >> 1) - 1;
/* hdisplay must roundup as 2 pixel */
pre_scan_dly = bg_dly + (roundup(hdisplay, 2) >> 1) - 1;
pre_scan_dly = (pre_scan_dly << 16) | hsync_len;
VOP_MODULE_SET(vop2, vp, bg_dly, bg_dly);
VOP_MODULE_SET(vop2, vp, pre_scan_htiming, pre_scan_dly);
@@ -9309,10 +9310,14 @@ static void vop2_setup_dly_for_vp(struct vop2_video_port *vp)
hdisplay = adjusted_mode->crtc_hdisplay;
}
/*
* splice mode: hdisplay must roundup as 4 pixel,
* no splice mode: hdisplay must roundup as 2 pixel.
*/
if (vcstate->splice_mode)
pre_scan_dly = bg_dly + (hdisplay >> 2) - 1;
pre_scan_dly = bg_dly + (roundup(hdisplay, 4) >> 2) - 1;
else
pre_scan_dly = bg_dly + (hdisplay >> 1) - 1;
pre_scan_dly = bg_dly + (roundup(hdisplay, 2) >> 1) - 1;
if (vop2->version == VOP_VERSION_RK3588 && hsync_len < 8)
hsync_len = 8;