Skip to contentSkip to conversation

interlace and doublescan modes support for tdfxfb in 2.6

PATCH In review Jakub Bogusz 2 participants 2 messages Aug 14, 2003 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 interlace and doublescan modes support for tdfxfb in 2.6

Like the second tdfxfb patch I've posted a while ago - it was posted to linux-fbdev-devel few days ago, but I haven't got any feedback...

It works on my Voodoo4 4500 and shouldn't cause any problems on other Voodoos - it's just a port of changes between 2.4.20 and 2.4.21.

----- Forwarded message from Jakub Bogusz <qboosh at pld-linux.org> -----

Date: Sun, 10 Aug 2003 01:24:55 +0200
From: Jakub Bogusz <qboosh at pld-linux.org>
To: linux-fbdev-devel at lists.sourceforge.net
Subject: [PATCH] interlace and doublescan modes support for tdfxfb in 2.6

Hello,

this patch adds interlace and doublescan modes support to tdfxfb in 2.6 (it's a port of changes already incorporated into 2.4.21).

[...]

Signature · 2 lines
Jakub Bogusz    http://cyber.cs.net.pl/~qboosh/
PLD Linux       http://www.pld-linux.org/

This patch adds interlace and double-scan mode support to tdfxfb in 2.6. It's a port of my changes (incorporated into 2.4.21) to Linux 2.6.

-- Jakub Bogusz <[email protected]>

include/video/tdfx.h renamed from include/video/tdfx.h.orig +1 -0
@@ -114,6 +114,7 @@
 #define VGAINIT1_MASK                   0x1fffff
 #define VIDCFG_VIDPROC_ENABLE           BIT(0)
 #define VIDCFG_CURS_X11                 BIT(1)
+#define VIDCFG_INTERLACE                BIT(3)
 #define VIDCFG_HALF_MODE                BIT(4)
 #define VIDCFG_DESK_ENABLE              BIT(7)
 #define VIDCFG_CLUT_BYPASS              BIT(10)
drivers/video/tdfxfb.c renamed from drivers/video/tdfxfb.c.orig +25 -8
@@ -508,8 +508,10 @@
 		return -EINVAL;
 	}
 
-	/* fixme: does Voodoo3 support interlace? Banshee doesn't */
-	if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+	/* Banshee doesn't support interlace, but Voodoo4/5 and probably Voodoo3 do. */
+	/* no direct information about device id now? use max_pixclock for this... */
+	if (((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) &&
+			(par->max_pixclock < VOODOO3_MAX_PIXCLOCK)) {
 		DPRINTK("interlace not supported\n");
 		return -EINVAL;
 	}
@@ -616,10 +618,17 @@
 	hbs = hd;
 	hbe = ht;
 
-	vbs = vd = info->var.yres - 1;
-	vs  = vd + info->var.lower_margin;
-	ve  = vs + info->var.vsync_len;
-	vbe = vt = ve + info->var.upper_margin - 1;
+	if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+		vbs = vd = (info->var.yres << 1) - 1;
+		vs  = vd + (info->var.lower_margin << 1);
+		ve  = vs + (info->var.vsync_len << 1);
+		vbe = vt = ve + (info->var.upper_margin << 1) - 1;
+	} else {
+		vbs = vd = info->var.yres - 1;
+		vs  = vd + info->var.lower_margin;
+		ve  = vs + info->var.vsync_len;
+		vbe = vt = ve + info->var.upper_margin - 1;
+	}
   
 	/* this is all pretty standard VGA register stuffing */
 	reg.misc[0x00] = 0x0f | 
@@ -742,8 +751,16 @@
 	reg.gfxpll = do_calc_pll(..., &fout);
 #endif
 
-	reg.screensize = info->var.xres | (info->var.yres << 12);
-	reg.vidcfg &= ~VIDCFG_HALF_MODE;
+	if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+		reg.screensize = info->var.xres | (info->var.yres << 13);
+		reg.vidcfg |= VIDCFG_HALF_MODE;
+		reg.crt[0x09] |= 0x80;
+	} else {
+		reg.screensize = info->var.xres | (info->var.yres << 12);
+		reg.vidcfg &= ~VIDCFG_HALF_MODE;
+	}
+	if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED)
+		reg.vidcfg |= VIDCFG_INTERLACE;
 	reg.miscinit0 = tdfx_inl(par, MISCINIT0);
 
 #if defined(__BIG_ENDIAN)
#1 lore raw

Applying patch. It will be in the next code drop.

Quoted 22 lines · Jakub Bogusz

Like the second tdfxfb patch I've posted a while ago - it was posted to linux-fbdev-devel few days ago, but I haven't got any feedback...

It works on my Voodoo4 4500 and shouldn't cause any problems on other Voodoos - it's just a port of changes between 2.4.20 and 2.4.21.

----- Forwarded message from Jakub Bogusz <qboosh at pld-linux.org> -----

Date: Sun, 10 Aug 2003 01:24:55 +0200
From: Jakub Bogusz <qboosh at pld-linux.org>
To: linux-fbdev-devel at lists.sourceforge.net
Subject: [PATCH] interlace and doublescan modes support for tdfxfb in 2.6

Hello,

this patch adds interlace and doublescan modes support to tdfxfb in 2.6 (it's a port of changes already incorporated into 2.4.21).

[...]