1 This patch adds interlace and double-scan mode support to tdfxfb in 2.6.
2 It's a port of my changes (incorporated into 2.4.21) to Linux 2.6.
4 -- Jakub Bogusz <qboosh@pld-linux.org>
6 --- linux-2.6.0-test3/include/video/tdfx.h.orig 2003-07-14 05:32:41.000000000 +0200
7 +++ linux-2.6.0-test3/include/video/tdfx.h 2003-08-09 21:28:04.000000000 +0200
9 #define VGAINIT1_MASK 0x1fffff
10 #define VIDCFG_VIDPROC_ENABLE BIT(0)
11 #define VIDCFG_CURS_X11 BIT(1)
12 +#define VIDCFG_INTERLACE BIT(3)
13 #define VIDCFG_HALF_MODE BIT(4)
14 #define VIDCFG_DESK_ENABLE BIT(7)
15 #define VIDCFG_CLUT_BYPASS BIT(10)
16 --- linux-2.6.0-test3/drivers/video/tdfxfb.c.orig 2003-08-09 21:26:11.000000000 +0200
17 +++ linux-2.6.0-test3/drivers/video/tdfxfb.c 2003-08-09 22:52:20.000000000 +0200
22 - /* fixme: does Voodoo3 support interlace? Banshee doesn't */
23 - if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
24 + /* Banshee doesn't support interlace, but Voodoo4/5 and probably Voodoo3 do. */
25 + /* no direct information about device id now? use max_pixclock for this... */
26 + if (((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) &&
27 + (par->max_pixclock < VOODOO3_MAX_PIXCLOCK)) {
28 DPRINTK("interlace not supported\n");
35 - vbs = vd = info->var.yres - 1;
36 - vs = vd + info->var.lower_margin;
37 - ve = vs + info->var.vsync_len;
38 - vbe = vt = ve + info->var.upper_margin - 1;
39 + if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
40 + vbs = vd = (info->var.yres << 1) - 1;
41 + vs = vd + (info->var.lower_margin << 1);
42 + ve = vs + (info->var.vsync_len << 1);
43 + vbe = vt = ve + (info->var.upper_margin << 1) - 1;
45 + vbs = vd = info->var.yres - 1;
46 + vs = vd + info->var.lower_margin;
47 + ve = vs + info->var.vsync_len;
48 + vbe = vt = ve + info->var.upper_margin - 1;
51 /* this is all pretty standard VGA register stuffing */
52 reg.misc[0x00] = 0x0f |
54 reg.gfxpll = do_calc_pll(..., &fout);
57 - reg.screensize = info->var.xres | (info->var.yres << 12);
58 - reg.vidcfg &= ~VIDCFG_HALF_MODE;
59 + if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
60 + reg.screensize = info->var.xres | (info->var.yres << 13);
61 + reg.vidcfg |= VIDCFG_HALF_MODE;
62 + reg.crt[0x09] |= 0x80;
64 + reg.screensize = info->var.xres | (info->var.yres << 12);
65 + reg.vidcfg &= ~VIDCFG_HALF_MODE;
67 + if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED)
68 + reg.vidcfg |= VIDCFG_INTERLACE;
69 reg.miscinit0 = tdfx_inl(par, MISCINIT0);
71 #if defined(__BIG_ENDIAN)