Subject: getting X going
To: None <port-pmax@NetBSD.ORG>
From: None <rick@snowhite.cis.uoguelph.ca>
List: port-pmax
Date: 03/18/1995 00:07:32
The old X11R5 Xmfbpmax and Xcfbpmax X servers worked with the 4.4 port.
(at least they seemed ok when I used them:-)

Here is the patch required to get these servers to support a couple of
additional frame buffers (5000/xx onboard colour and turbochannel MX
monochrome). NB: The MX only has one bit/pixel but uses the Xcfbpmax server
because each frame buffer bit is the low order bit of a byte.

Good luck with it, rick
-- patch file --
This patch must be applied to the file mit/server/ddx/dec/cfbpmax/cfbpmax_io.c
in X11R5 so that the Xcfbpmax server works with the xcfb (Personal DECstation)
and mfb (MX monochrome turbochannel display) for the 4.4BSD pmax port.

Note that Xcfbpmax is used for the following displays:
	DECstation 3100 Colour Frame Buffer
	CX Turbochannel Colour Frame Buffer (PMAG-BA)
	Personal DECstation 5000/xx Colour Frame Buffer (on motherboard)
	MX Turbochannel Monochrome Frame Buffer (PMAG-AA)

and the Xmfbpmax server is used for
	DECstation 3100 Monochrome Frame Buffer

It would take a significant amount of work to get the Xdec server working,
since there are quite a few ioctl's that will have to be supported by the
kernel.

*** cfbpmax_io.c.sav	Wed Nov 11 15:40:23 1992
--- cfbpmax_io.c	Wed Mar 10 16:10:29 1993
***************
*** 104,111 ****
  #define MAX_LED 3	/* only 3 LED's can be set by user; Lock LED
  			   is controlled by server */
  
- #define FRAMEWIDTH      1024
- #define FRAMEHEIGHT     864
  #define DEPTH           8
  #define BITS_PER_CHAR   8
  
--- 104,109 ----
***************
*** 250,255 ****
--- 248,254 ----
      ColormapPtr pColormap;
      int		i;
      static int  mapOnce = FALSE;
+     int		scrpixwidth;
  
  /* for initializing color map entries */
      u_int blackred      = 0x0000;
***************
*** 345,351 ****
      cursorRange.y1 = -15;
      cursorRange.y2 = info->max_y - 1;
  
- /* XXX FRAMEWIDTH is bogus.  Don't we get this with initial IOCTL?? */
  
      if (dpi == -1) /* dpi has not been set */
      {
--- 344,349 ----
***************
*** 388,395 ****
      pScreen->UninstallColormap = cfbpmaxUninstallColormap;
      pScreen->ListInstalledColormaps = cfbpmaxListInstalledColormaps;
  
!     if (!cfbScreenInit(pScreen, info->bitmap, FRAMEWIDTH,
! 			FRAMEHEIGHT, dpix, dpiy, FRAMEWIDTH, class, FRAMEWIDTH) ||
  	!cfbCreateDefColormap (pScreen))
      {
  	close (fdPM);
--- 386,394 ----
      pScreen->UninstallColormap = cfbpmaxUninstallColormap;
      pScreen->ListInstalledColormaps = cfbpmaxListInstalledColormaps;
  
!     scrpixwidth = ((info->max_x + 1023) / 1024) * 1024;
!     if (!cfbScreenInit(pScreen, info->bitmap, (int)info->max_x,
! 			(int)info->max_y, dpix, dpiy, scrpixwidth) ||
  	!cfbCreateDefColormap (pScreen))
      {
  	close (fdPM);
***************
*** 415,421 ****
      unsigned int result;
  
      result = currentmask;
!     currentmask = *(info->planemask) = planemask;
      return result;
  }
  
--- 414,423 ----
      unsigned int result;
  
      result = currentmask;
!     if (info->planemask)
! 	currentmask = *(info->planemask) = planemask;
!     else
! 	currentmask = planemask;
      return result;
  }