Subject: screen blanking
To: None <port-pmax@NetBSD.ORG>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-pmax
Date: 04/10/1997 10:55:07
Here are two patches related to screen blanking.

The first affects all netbsd-pmax systems, and corrects the sense of
the FBIOGVIDEO/FBIOSVIDEO ioctl's to agree with the frame buffer code
in other netbsd ports.

The second is specific to mfb, and fixes an obvious bug.  This doesn't
fix the screen blank problem, but it's a first step.

I created the second patch with an artificially large context because
my mfb.c is a bit hacked up and you may need to apply this by hand.

--- /usr/src/sys/arch/pmax/dev/fb_usrreq.c-orig	Thu Apr 10 08:13:43 1997
+++ /usr/src/sys/arch/pmax/dev/fb_usrreq.c	Thu Apr 10 08:14:51 1997
@@ -183,11 +183,11 @@
 		break;
 
 	case FBIOGVIDEO:
-		*(int *)data = fi->fi_blanked;
+		*(int *)data = fi->fi_blanked ? FBVIDEO_OFF : FBVIDEO_ON;
 		break;
 
 	case FBIOSVIDEO:
-		if (*(int *)data)
+		if (*(int *)data == FBVIDEO_OFF)
 			return (*(fi->fi_driver->fbd_blank)) (fi);
 		else
 			return (*(fi->fi_driver->fbd_unblank)) (fi);


--- /usr/src/sys/arch/pmax/dev/mfb.c-recent	Thu Apr 10 06:04:06 1997
+++ /usr/src/sys/arch/pmax/dev/mfb.c	Thu Apr 10 10:42:04 1997
@@ -678,31 +678,31 @@
 	cmap = (u_char *)(fi -> fi_cmap_bits);
 
 	bcopy (cursor_RGB, cursor_save, 6);
 
 	/* Zap the cursor and the colormap... */
 	BT455_SELECT_ENTRY(regs, 0);
 	for (i = 0; i < 6; i++) {
 		cursor_RGB[i] = 0;
 		regs->addr_cmap_data = 0;
 		wbflush();
 	}
 		
 	mfbRestoreCursorColor (fi);
 
 	bcopy (cursor_save, cursor_RGB, 6);
-	fi -> fi_blanked = 0;
+	fi -> fi_blanked = 1;
 
 	return 0;
 }
 
 /*
  * Generic register access
  */
 static void
 bt431_select_reg(regs, regno)
 	bt431_regmap_t *regs;
 {
 	regs->addr_lo = SET_VALUE(regno & 0xff);
 	regs->addr_hi = SET_VALUE((regno >> 8) & 0xff);
 	wbflush();
 }

Cheers,
entropy

--
entropy -- it's not just a good idea, it's the second law.