From cdf04cb2b9dc7f06edd539122a6e2411a67c8645 Mon Sep 17 00:00:00 2001 From: IanSB Date: Mon, 23 Dec 2019 04:07:40 +0000 Subject: [PATCH] Fix Pi overscan calculation bug --- src/rgb_to_hdmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rgb_to_hdmi.c b/src/rgb_to_hdmi.c index 719dae72..2b839552 100644 --- a/src/rgb_to_hdmi.c +++ b/src/rgb_to_hdmi.c @@ -305,12 +305,11 @@ static int last_height = -1; v_overscan = 0; if (get_gscaling() == SCALING_INTEGER) { - int width = capinfo->width >> ((capinfo->sizex2 & 2) >> 1); - int height = capinfo->height >> (capinfo->sizex2 & 1); - if (!mode7 || get_m7scaling() == M7_EVEN) { - h_overscan = (h_size - (h_size / width * width)); + if (!((mode7 && get_m7scaling() == M7_UNEVEN) + ||(!mode7 && get_normalscaling() == NORMAL_UNEVEN))) { + h_overscan = (h_size - (h_size / capinfo->width * capinfo->width)); } - v_overscan = (v_size - (v_size / height * height)); + v_overscan = (v_size - (v_size / capinfo->height * capinfo->height)); } if (h_overscan > 32) {