patch-2.4.0-test5 linux/drivers/video/cyber2000fb.c

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

diff -u --recursive --new-file v2.4.0-test4/linux/drivers/video/cyber2000fb.c linux/drivers/video/cyber2000fb.c
@@ -246,16 +246,14 @@
 }
 
 static struct display_switch fbcon_cyber_accel = {
-	cyber2000_accel_setup,
-	cyber2000_accel_bmove,
-	cyber2000_accel_clear,
-	cyber2000_accel_putc,
-	cyber2000_accel_putcs,
-	cyber2000_accel_revc,
-	NULL,
-	NULL,
-	cyber2000_accel_clear_margins,
-	FONTWIDTH(8)|FONTWIDTH(16)
+	setup:		cyber2000_accel_setup,
+	bmove:		cyber2000_accel_bmove,
+	clear:		cyber2000_accel_clear,
+	putc:		cyber2000_accel_putc,
+	putcs:		cyber2000_accel_putcs,
+	revc:		cyber2000_accel_revc,
+	clear_margins:	cyber2000_accel_clear_margins,
+	fontwidthmask:	FONTWIDTH(8)|FONTWIDTH(16)
 };
 
 /*
@@ -969,14 +967,6 @@
 }
 
 
-static int
-cyber2000fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		  u_long arg, int con, struct fb_info *info)
-{
-	return -EINVAL;
-}
-
-
 /*
  *    Update the `var' structure (called by fbcon.c)
  *
@@ -1042,20 +1032,50 @@
 	struct cfb_info *cfb = (struct cfb_info *)info;
 	int i;
 
-	if (blank) {
-		for (i = 0; i < NR_PALETTE; i++) {
+	/*
+	 *  Blank the screen if blank_mode != 0, else unblank. If
+	 *  blank == NULL then the caller blanks by setting the CLUT
+	 *  (Color Look Up Table) to all black. Return 0 if blanking
+	 *  succeeded, != 0 if un-/blanking failed due to e.g. a
+	 *  video mode which doesn't support it. Implements VESA
+	 *  suspend and powerdown modes on hardware that supports
+	 *  disabling hsync/vsync:
+	 *    blank_mode == 2: suspend vsync
+	 *    blank_mode == 3: suspend hsync
+	 *    blank_mode == 4: powerdown
+	 *
+	 *  wms...Enable VESA DMPS compatible powerdown mode
+	 *  run "setterm -powersave powerdown" to take advantage
+	 */
+     
+	switch (blank) {
+	case 4:	/* powerdown - both sync lines down */
+    		cyber2000_grphw(0x16, 0x05);
+		break;	
+	case 3:	/* hsync off */
+    		cyber2000_grphw(0x16, 0x01);
+		break;	
+	case 2:	/* vsync off */
+    		cyber2000_grphw(0x16, 0x04);
+		break;	
+	case 1:	/* just software blanking of screen */
+		cyber2000_grphw(0x16, 0x00);
+		for (i = 0; i < 256; i++) {
 			cyber2000_outb(i, 0x3c8);
 			cyber2000_outb(0, 0x3c9);
 			cyber2000_outb(0, 0x3c9);
 			cyber2000_outb(0, 0x3c9);
 		}
-	} else {
-		for (i = 0; i < NR_PALETTE; i++) {
+		break;
+	default: /* case 0, or anything else: unblank */
+		cyber2000_grphw(0x16, 0x00);
+		for (i = 0; i < 256; i++) {
 			cyber2000_outb(i, 0x3c8);
 			cyber2000_outb(cfb->palette[i].red, 0x3c9);
 			cyber2000_outb(cfb->palette[i].green, 0x3c9);
 			cyber2000_outb(cfb->palette[i].blue, 0x3c9);
 		}
+		break;
 	}
 }
 
@@ -1094,7 +1114,6 @@
 	fb_set_var:	cyber2000fb_set_var,
 	fb_set_cmap:	cyber2000fb_set_cmap,
 	fb_pan_display:	cyber2000fb_pan_display,
-	fb_ioctl:	cyber2000fb_ioctl,
 	fb_get_fix:	gen_get_fix,
 	fb_get_var:	gen_get_var,
 	fb_get_cmap:	gen_get_cmap,
@@ -1196,6 +1215,7 @@
 
 static char igs_regs[] __devinitdata = {
 					0x12, 0x00,	0x13, 0x00,
+					0x16, 0x00,
 			0x31, 0x00,	0x32, 0x00,
 	0x50, 0x00,	0x51, 0x00,	0x52, 0x00,	0x53, 0x00,
 	0x54, 0x00,	0x55, 0x00,	0x56, 0x00,	0x57, 0x01,

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