Newsgroups: comp.windows.x
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!theory.tn.cornell.edu!christos
From: christos@theory.tn.cornell.edu (Christos S. Zoulas)
Subject: Re: cg8 Server Prob
Message-ID: <1991Mar27.063707.15238@batcomputer.tn.cornell.edu>
Sender: news@batcomputer.tn.cornell.edu
Nntp-Posting-Host: theory.tn.cornell.edu
Organization: Electrical Engineering, Cornell University, Ithaca NY
References: <1991Mar26.111628@ece.arizona.edu> <1991Mar26.223513.5306@research.canon.oz.au>
Distribution: world,local
Date: Wed, 27 Mar 1991 06:37:07 GMT

In article <1991Mar26.223513.5306@research.canon.oz.au> andy@research.canon.oz.au (Andy Newman) writes:
>
>I had exactly this trouble. In the later release of the RasterOps card
>the memory mapping (mmap) of the framebuffer has changed. There is now
>an approximately 1Mb space between the monochrome fb and the colour fb.
[stuff deleted]
>
And in addition, if you want to enable the double frame buffer sun hack
you can apply the following patch....

[I added the sunCG9.c patch too]

*** sunInit.c.dist	Tue Mar 19 14:48:42 1991
--- sunInit.c	Thu Mar 21 14:50:26 1991
***************
*** 639,645 ****
      } else if (name) {
  	fd = open(name, O_RDWR, 0);
          if (fd < 0) {
! 	    return (-1);
  	} 
  	if (ioctl(fd, FBIOGATTR, &fbattr) < 0)
  	{
--- 639,652 ----
      } else if (name) {
  	fd = open(name, O_RDWR, 0);
          if (fd < 0) {
! 	    /*
! 	     * The rasterops cgeight0 has a bwtwo0 but does not
! 	     * advertize it.
! 	     */
! 	    if (strcmp(name, "/dev/bwtwo0") == 0) 
! 		fd = open("/dev/cgeight0", O_RDWR, 0);
! 	    if (fd < 0)
! 		return (-1);
  	} 
  	if (ioctl(fd, FBIOGATTR, &fbattr) < 0)
  	{
*** sunCG9C.c.old	Tue Mar 19 14:48:40 1991
--- sunCG9C.c	Tue Mar 19 15:30:16 1991
***************
*** 58,70 ****
   */
  #define	CG9_HEIGHT	900
  #define	CG9_WIDTH	1152
- 
- typedef struct cg9c {
- 	u_char mpixel[128*1024];		/* bit-per-pixel memory */
- 	u_char epixel[128*1024];		/* enable plane */
- 	u_long cpixel[CG9_HEIGHT][CG9_WIDTH];	/* word-per-pixel memory */
- } CG9C, CG9CRec, *CG9CPtr;
- 
  #define CG9C_IMAGE(fb)	    ((caddr_t)(&(fb)->cpixel))
  #define CG9C_IMAGEOFF	    ((off_t)0x0)
  #define CG9C_IMAGELEN	    (((4*CG9_HEIGHT*CG9_WIDTH + 8191)/8192)*8192)
--- 58,63 ----
***************
*** 72,78 ****
--- 65,88 ----
  #define	CG9C_MONOLEN	    (128*1024)
  #define	CG9C_ENABLE(fb)	    ((caddr_t)(&(fb)->epixel))
  #define	CG9C_ENBLEN	    CG9C_MONOLEN
+ #ifdef PIP_NFBS
+ /* RasterOps card */
+ # define CG8C_PADLEN	    (CG9C_MONOLEN * 7 + 240 * 512)
+ #else
+ /* True cg8 */
+ # define CG8C_PADLEN	    0
+ #endif 
  
+ typedef struct cg9c {
+ 	u_char mpixel[128*1024];		/* bit-per-pixel memory */
+ 	u_char epixel[128*1024];		/* enable plane */
+ #ifdef PIP_NFBS
+ 	u_char ppixel[CG8C_PADLEN];		/* padding plane */
+ #endif
+ 	u_long cpixel[CG9_HEIGHT][CG9_WIDTH];	/* word-per-pixel memory */
+ } CG9C, CG9CRec, *CG9CPtr;
+ 
+ 
  static CG9CPtr CG9Cfb = NULL;
  
  static int  sunCG9CScreenIndex;
***************
*** 427,433 ****
  
  #ifdef	_MAP_NEW
      if ((int)(CG9Cfb = (CG9CPtr) mmap((caddr_t) 0,
! 	     CG9C_MONOLEN + CG9C_ENBLEN + CG9C_IMAGELEN,
  	     PROT_READ | PROT_WRITE,
  	     MAP_SHARED | _MAP_NEW, fd, 0)) == -1) {
  	Error("Mapping cg8c");
--- 437,443 ----
  
  #ifdef	_MAP_NEW
      if ((int)(CG9Cfb = (CG9CPtr) mmap((caddr_t) 0,
! 	     CG9C_MONOLEN + CG9C_ENBLEN + CG8C_PADLEN + CG9C_IMAGELEN,
  	     PROT_READ | PROT_WRITE,
  	     MAP_SHARED | _MAP_NEW, fd, 0)) == -1) {
  	Error("Mapping cg8c");
-- 
+------------------------------------------------------------------------+
| Christos Zoulas         | 389 Theory Center, Electrical Engineering,   |
| christos@ee.cornell.edu | Cornell University, Ithaca NY 14853.         |
| christos@crnlee.bitnet  | Phone: (607) 255 0302 |  Fax: (607) 254 4565 |
