Subject: Re: mfb patches?
To: maximum entropy <entropy@zippy.bernstein.com>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 04/09/1997 19:13:05
hi,

The best way to send in  changes is always to send in a PR.
That way they don't get overlooked, or lost, or forgotten.

That aside, the changes to the mfb driver you sent aren't yet
committed because I'm not sure they're completely correct.  The X
server will need to know that there are only 1280 visible pixels.  

I'm guessing, but it seems that changing both the fb descriptors to
2048 will break that.  I'd also like to fix the screen-saver
functionality, rather than just disabling it.
Does the patch below  work for you?


*** mfb.c	Thu Jan 23 04:21:09 1997
--- mfb.c.jrs	Thu Apr  3 12:13:00 1997
***************
*** 308,320 ****
  	fi->fi_base = (caddr_t)(mfbaddr + MFB_OFFSET_BT431);
  	fi->fi_vdac = (caddr_t)(mfbaddr + MFB_OFFSET_BT455);
  	fi->fi_size = (fi->fi_pixels + MFB_FB_SIZE) - fi->fi_base;
! 	fi->fi_linebytes = 1280;
  	fi->fi_driver = &mfb_driver;
  	fi->fi_blanked = 0;
  
  	/* Fill in Frame Buffer Type struct. */
  	fi->fi_type.fb_boardtype = PMAX_FBTYPE_MFB;
! 	fi->fi_type.fb_width = 1280;
  	fi->fi_type.fb_height = 1024;
  	fi->fi_type.fb_depth = 8;
  	fi->fi_type.fb_cmsize = 0;
--- 308,320 ----
  	fi->fi_base = (caddr_t)(mfbaddr + MFB_OFFSET_BT431);
  	fi->fi_vdac = (caddr_t)(mfbaddr + MFB_OFFSET_BT455);
  	fi->fi_size = (fi->fi_pixels + MFB_FB_SIZE) - fi->fi_base;
! 	fi->fi_linebytes = 2048;	/* tell rcons width of lines */
  	fi->fi_driver = &mfb_driver;
  	fi->fi_blanked = 0;
  
  	/* Fill in Frame Buffer Type struct. */
  	fi->fi_type.fb_boardtype = PMAX_FBTYPE_MFB;
! 	fi->fi_type.fb_width = 1280;	/* screen pixel dimensions? */
  	fi->fi_type.fb_height = 1024;
  	fi->fi_type.fb_depth = 8;
  	fi->fi_type.fb_cmsize = 0;
***************
*** 479,484 ****
--- 479,485 ----
  {
  	bt431_regmap_t *regs = (bt431_regmap_t *)(fi -> fi_base);
  
+ #ifdef MELLON
  	if (y < 0)
  	  y = 0;
  	else if (y > fi -> fi_type.fb_width - fi -> fi_cursor.width - 1)
***************
*** 488,493 ****
--- 489,501 ----
  	else if (x > fi -> fi_type.fb_height - fi -> fi_cursor.height - 1)
  	  x = fi -> fi_type.fb_height - fi -> fi_cursor.height - 1;
  
+ #else /* old-style pmax glass tty */
+  	if (y < fbu->scrInfo.min_cur_y || y > fbu->scrInfo.max_cur_y)
+ 		y = fbu->scrInfo.max_cur_y;
+ 	if (x < fbu->scrInfo.min_cur_x || x > fbu->scrInfo.max_cur_x)
+ 		x = fbu->scrInfo.max_cur_x;
+ #endif
+ 
  	fi -> fi_cursor.x = x;
  	fi -> fi_cursor.y = y;
  
***************
*** 520,525 ****
--- 528,535 ----
  {
  	u_char rgb [3];
  	register int i;
+ 
+ 	blackpix = 1; /* XXX XXX XXX defeat screensave bug? */
  
  	if (blackpix)
  		rgb [0] = rgb [1] = rgb [2] = 0xff;