Subject: port-pmax/3515: screen blanking is broken on mfb frame buffer
To: None <gnats-bugs@gnats.netbsd.org>
From: maximum entropy <entropy@ubik.bernstein.com>
List: netbsd-bugs
Date: 04/18/1997 22:09:35
>Number:         3515
>Category:       port-pmax
>Synopsis:       screen blanking is broken on mfb frame buffer
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 18 19:35:02 1997
>Last-Modified:
>Originator:     maximum entropy
>Organization:
	
>Release:        <NetBSD-current source date> Apr 10 1997
>Environment:
	
3min with mfb

System: NetBSD ubik.bernstein.com 1.2D NetBSD 1.2D (UBIK) #8: Thu Apr 10 10:27:44 EDT 1997 entropy@ubik.bernstein.com:/usr/src/sys/arch/pmax/compile/UBIK pmax


>Description:
	
The mfb frame buffer doesn't handle screen blanking properly.  When the
screen is blanked, it doesn't properly un-blank.
>How-To-Repeat:
	
blank the screen, then try to unblank it
>Fix:
	

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.
>Audit-Trail:
>Unformatted: