patch-2.4.7 linux/drivers/video/cyber2000fb.c

Next file: linux/drivers/video/dcfb.c
Previous file: linux/drivers/video/clgenfb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/drivers/video/cyber2000fb.c linux/drivers/video/cyber2000fb.c
@@ -367,6 +367,7 @@
 	 * Other
 	 */
 	u_char	palette_ctrl;
+	u_int	vmode;
 };
 
 static const u_char crtc_idx[] = {
@@ -427,6 +428,16 @@
 	cyber2000_attrw(0x13, 0x00);
 	cyber2000_attrw(0x14, 0x00);
 
+	/* woody: set the interlaced bit... */
+	/* FIXME: what about doublescan? */
+	cyber2000_outb(0x11, 0x3ce);
+	i = cyber2000_inb(0x3cf);
+	if (hw->vmode == FB_VMODE_INTERLACED)
+		i |= 0x20;
+	else
+		i &= ~0x20;
+	cyber2000_outb(i, 0x3cf);
+
 	/* PLL registers */
 	cyber2000_grphw(DCLK_MULT, hw->clock_mult);
 	cyber2000_grphw(DCLK_DIV,  hw->clock_div);
@@ -711,6 +722,7 @@
 
 	hw->width = var->xres_virtual;
 	hw->palette_ctrl = 0x06;
+	hw->vmode = var->vmode;
 
 	switch (var->bits_per_pixel) {
 #ifdef FBCON_HAS_CFB8
@@ -1570,7 +1582,7 @@
 	/*
 	 * Our driver data
 	 */
-	dev->driver_data = cfb;
+	pci_set_drvdata(dev, cfb);
 	if (int_cfb_info == NULL)
 		int_cfb_info = cfb;
 
@@ -1586,7 +1598,7 @@
 
 static void __devexit cyberpro_remove(struct pci_dev *dev)
 {
-	struct cfb_info *cfb = (struct cfb_info *)dev->driver_data;
+	struct cfb_info *cfb = pci_get_drvdata(dev);
 
 	if (cfb) {
 		/*
@@ -1606,7 +1618,7 @@
 		 * Ensure that the driver data is no longer
 		 * valid.
 		 */
-		dev->driver_data = NULL;
+		pci_set_drvdata(dev, NULL);
 		if (cfb == int_cfb_info)
 			int_cfb_info = NULL;
 	}
@@ -1622,7 +1634,7 @@
  */
 static int cyberpro_resume(struct pci_dev *dev)
 {
-	struct cfb_info *cfb = (struct cfb_info *)dev->driver_data;
+	struct cfb_info *cfb = pci_get_drvdata(dev);
 
 	if (cfb) {
 		cyberpro_init_hw(cfb, 0);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)