tdfxfb patch to avoid flicker

Alexander V. Lukyanov (lav@long.yar.ru)
Sun, 19 Dec 1999 03:13:55 +0300


When using tdfxfb on a voodoo3 and switching between virtual consoles my
monitor flickers, even if the video mode is the same on both consoles.
I think it can be something with the way tdfxfb_set_var sets registers.

I did this little and simple patch to check if the two consoles have the
same video mode, and skip set_var if they do. It solves the annoying
problem for me.

--- tdfxfb.c.1 Tue Nov 16 00:14:29 1999
+++ tdfxfb.c Tue Nov 16 00:37:48 1999
@@ -2194,6 +2194,8 @@
struct fb_info *fb) {
struct fb_info_tdfx *info = (struct fb_info_tdfx*)fb;
struct tdfxfb_par par;
+ struct tdfxfb_par old_par;
+ int old_con = currcon;

/* Do we have to save the colormap? */
if (currcon>=0)
@@ -2203,7 +2205,13 @@
currcon = con;
fb_display[currcon].var.activate = FB_ACTIVATE_NOW;
tdfxfb_decode_var(&fb_display[con].var, &par, info);
- tdfxfb_set_par(&par, info);
+ if (old_con>=0) {
+ tdfxfb_decode_var(&fb_display[old_con].var, &old_par, info);
+ if (memcmp(&par,&old_par,sizeof(par))) /* avoid flicker */
+ tdfxfb_set_par(&par, info);
+ } else {
+ tdfxfb_set_par(&par, info);
+ }
if (fb_display[con].dispsw && fb_display[con].conp)
fb_con.con_cursor(fb_display[con].conp, CM_ERASE);

Alexander.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/