video: adjust VRR vblank to a minimum possible value instead of discarding.

This commit is contained in:
Sorgelig
2022-06-30 22:59:16 +08:00
parent d1e2d37421
commit 84ade779df

View File

@@ -1669,15 +1669,13 @@ static void set_video(vmode_custom_t *v, double Fpix)
// try to adjust VBlank to match max refresh
int vbl_fmax = ((v_cur.Fpix * 1000000.f) / (vrr_max_fr * horz)) - v_fix.param.vact - v_fix.param.vs - 1;
if (vbl_fmax >= 2)
if (vbl_fmax < 2) vbl_fmax = 2;
int vfp = vbl_fmax - v_fix.param.vbp;
v_fix.param.vfp = vfp;
if (vfp < 1)
{
int vfp = vbl_fmax - v_fix.param.vbp;
v_fix.param.vfp = vfp;
if (vfp < 1)
{
v_fix.param.vfp = 1;
v_fix.param.vbp = vbl_fmax - 1;
}
v_fix.param.vfp = 1;
v_fix.param.vbp = vbl_fmax - 1;
}
int vert = v_fix.param.vact + v_fix.param.vbp + v_fix.param.vfp + v_fix.param.vs;