Hi,

Another small patch. :-)

Best Regards,
Zhang Boyang
From ae763e89f00575e56a7242e27c9b0789c0de411e Mon Sep 17 00:00:00 2001
From: Zhang Boyang <zhangboyang...@gmail.com>
Date: Sun, 29 May 2022 02:45:32 +0800
Subject: [PATCH] Don't call FBIOPAN_DISPLAY when using the vga16fb driver

When using vga16fb, there is no need to call FBIOPAN_DISPLAY, and it may
cause screen flicker on certain hardwares.
---
 bogl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bogl.c b/bogl.c
index 9b628b1..5cbe96e 100644
--- a/bogl.c
+++ b/bogl.c
@@ -462,6 +462,15 @@ bogl_fb_set_palette (int c, int nc, const unsigned char palette[][3])
 void
 bogl_update (void)
 {
+#if BOGL_VGA16_FB
+  if (type == FB_TYPE_VGA_PLANES)
+    {
+      /* There is no need to call FBIOPAN_DISPLAY when using vga16fb driver.
+         What's worse, it may cause screen flicker on certain hardwares.
+	 So make bogl_update() a no-op here. */
+      return;
+    }
+#endif
   ioctl (fb, FBIOPAN_DISPLAY, &fb_var);
 }
 
-- 
2.30.2

Reply via email to