Patch: sstfb support for interlace / doublescan modes.

Urs Ganse (ursg@uni.de)
Tue, 26 Feb 2002 16:06:45 +0100


--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi everyone!

This patch adds support for interlace and doublescan modes to the sstfb
(voodoo 1 /2) framebuffer driver.

I have been trying to get in touch with this driver's maintainer
(Ghozlane Toumi) for quite some time now, but I won't get any replies,
neither from the eMail-address supplied in the kernel source, nor from
another one that I found on the web. Does anybody know how he is
reachable now?

Sincerely,
Urs Ganse

-- 
 Urs Ganse
                                                             ursg@uni.de
______________________________________________________FIDO: 2:2432/700.2

--EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=sstfb-patch

--- linux/drivers/video/sstfb.c Sat Dec 22 18:26:16 2001 +++ linux/drivers/video/sstfb.c Tue Feb 26 14:23:05 2002 @@ -5,12 +5,16 @@ * * Created 15 Jan 2000 by Ghozlane Toumi * + * NOTE: I have been unable to reach Ghozlane through the eMail-address + * given above for more than 3 months, same with another address of him + * which I found on the web. - Urs + * * Contributions (and many thanks) : * * 03/2001 James Simmons <jsimmons@linux-fbdev.org> * 04/2001 Paul Mundt <lethal@chaoticdreams.org> - * 05/2001 Urs Ganse <urs.ganse@t-online.de> - * (initial work on voodoo2 port) + * 05/2001 Urs Ganse <ursg@uni.de> + * (initial work on voodoo2 port, added interlace support) * * * $Id: sstfb.c,v 1.26.4.1 2001/08/29 01:30:37 ghoz Exp $ @@ -59,6 +63,8 @@ -TODO: change struct sst_info fb_info from static to array/dynamic TTT comments is for code i've put there for debuging the "weird peinguin syndrome", it should disapear soon +-FIXME: Some uninitialized variable causes sporadic crashes when setting a video + mode for the first time. * */ @@ -208,7 +214,7 @@ /********/ -/* Interface to ze oueurld */ +/* Interface to the world */ int sstfb_init(void); int sstfb_setup(char *options); @@ -599,9 +605,8 @@ var->xres, var->yres); return -EINVAL; } - if ((var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED) { - eprintk("Interlace non supported %#x\n", - (var->vmode & FB_VMODE_MASK)); + if((var->vmode & FB_VMODE_MASK) && !sst_info->is_voodoo2 ){ + eprintk ("Interlace modes not supported on Voodoo 1 hardware.\n"); return -EINVAL; } @@ -615,7 +620,17 @@ par->vSyncOn = var->vsync_len; par->vSyncOff = var->yres + var->lower_margin + var->upper_margin; par->vBackPorch = var->upper_margin; - + + par->flags = 0; + if (var->vmode & FB_VMODE_INTERLACED) { +// printk(KERN_DEBUG "sstfb: This is an interlace mode.\n"); + par->flags|=FB_VMODE_INTERLACED; + } + if(var->vmode & FB_VMODE_DOUBLE) { +// printk(KERN_DEBUG "sstfb: This is a doublescan mode.\n"); + par->flags|=FB_VMODE_DOUBLE; + } + switch (var->bits_per_pixel) { case 0 ... 16 : par->bpp = 16; @@ -685,7 +700,7 @@ var->lower_margin = par->vSyncOff - par->yDim - par->vBackPorch; var->hsync_len = par->hSyncOn; var->vsync_len = par->vSyncOn; - var->vmode = FB_VMODE_NONINTERLACED; + var->vmode = par->flags; /* * correct the color bit fields @@ -1375,6 +1390,17 @@ sst_write(HSYNC, (par->hSyncOff-1) << 16 | (par->hSyncOn-1)); sst_write(VSYNC, par->vSyncOff << 16 | par->vSyncOn); + /* Interlace or Doublescan */ + if(par->flags & FB_VMODE_INTERLACED) + sst_set_bits(FBIINIT5,1>>26); + else + sst_unset_bits(FBIINIT5,1>>26); + + if(par->flags & FB_VMODE_DOUBLE) + sst_set_bits(FBIINIT5,1>>20); + else + sst_unset_bits(FBIINIT5,1>>20); + fbiinit2=sst_read(FBIINIT2); fbiinit3=sst_read(FBIINIT3);

--- linux/drivers/video/sstfb.h Sat Dec 22 18:26:21 2001 +++ linux/drivers/video/sstfb.h Tue Feb 26 13:16:01 2002 @@ -317,6 +317,7 @@ unsigned int vSyncOn; unsigned int vSyncOff; unsigned int vBackPorch; + unsigned int flags; /* Doublescan, Interlace etc. */ unsigned int freq; /* freq in picoseconds */ unsigned int tiles_in_X; /* num of tiles in X res */ };

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