xf86Msg(X_INFO, "fb: %x\n",pPnozz->psdp->fd);
PnozzScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv){    ScrnInfoPtr pScrn;    PnozzPtr pPnozz;    VisualPtr visual;    int ret,len=0,i;    unsigned int *regs, pctl, pfb, *fb;    /*      * First get the ScrnInfoRec     */    pScrn = xf86Screens[pScreen->myNum];    pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);    pPnozz->fb =	xf86MapSbusMem (pPnozz->psdp, 0, 0x200000);	/* map 2MB */    fb=(unsigned int *)pPnozz->fb;        pPnozz->fbc =	xf86MapSbusMem (pPnozz->psdp, 0x200000,0x8000);	/* map registers */    scratch32=pnozz_read_4(pPnozz,RASTER_OP);    xf86Msg(X_INFO, "fb %x regs %x op %x\n", (int)pPnozz->fb, (int)pPnozz->fbc,         (int)scratch32);    if (! pPnozz->fbc)	return FALSE;    xf86Msg(X_INFO, "fb: %x\n",pPnozz->psdp->fd);    /* Darken the screen for aesthetic reasons and set the viewport */    /* XXX doesn't make any friggin' sense here */    /* PnozzSaveScreen(pScreen, SCREEN_SAVER_ON);*/        /*     * The next step is to setup the screen's visuals, and initialise the     * framebuffer code.  In cases where the framebuffer's default     * choices for things like visual layouts and bits per RGB are OK,     * this may be as simple as calling the framebuffer's ScreenInit()     * function.  If not, the visuals will need to be setup before calling     * a fb ScreenInit() function and fixed up after.     */    /*     * Reset visual list.     */    miClearVisualTypes();    pScrn->rgbBits = 8;    	        xf86Msg(X_ERROR, "depth: %d, bpp: %d\n", pScrn->depth, pScrn->bitsPerPixel);        /*      * ok, let's switch to whatever depth That Guy Out There wants.     * We won't switch video mode, only colour depth -      */    pPnozz->width = pScrn->virtualX;    pPnozz->height = pScrn->virtualY;    PnozzSave(pPnozz);    if(!PnozzSetDepth(pPnozz, pScrn->bitsPerPixel))     	return FALSE;        /* Setup the visuals we support. */    if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),			  pScrn->rgbBits, pScrn->defaultVisual))	return FALSE;	    xf86Msg(X_ERROR, "visual types ok\n");    miSetPixmapDepths ();//return FALSE;    /*     * Call the framebuffer layer's ScreenInit function, and fill in other     * pScreen fields.     */    ret = fbScreenInit(pScreen, pPnozz->fb, pScrn->virtualX,		       pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,		       pScrn->virtualX, pScrn->bitsPerPixel);    /* should be set by PnozzSetDepth() */    pPnozz->scanlinesize = pScrn->virtualX<<pPnozz->depthshift;    pPnozz->maxheight = (0x200000 / pPnozz->scanlinesize) & 0xffff;    if (!ret)	return FALSE;/*    if (pScrn->bitsPerPixel>8) {      visual = pScreen->visuals + pScreen->numVisuals;      while (--visual >= pScreen->visuals) {        if ((visual->class | DynamicClass) == DirectColor) {	  visual->offsetRed = pScrn->offset.red;	  visual->offsetGreen = pScrn->offset.green;	  visual->offsetBlue = pScrn->offset.blue;	  visual->redMask = pScrn->mask.red;	  visual->greenMask = pScrn->mask.green;	  visual->blueMask = pScrn->mask.blue;        }      }    }*/#ifdef RENDER    fbPictureInit (pScreen, 0, 0);#endif    miInitializeBackingStore(pScreen);    xf86SetBackingStore(pScreen);    xf86SetSilkenMouse(pScreen);    xf86SetBlackWhitePixels(pScreen);    if (!pPnozz->NoAccel) {    	BoxRec bx;	pPnozz->pXAA=XAACreateInfoRec();	PnozzAccelInit(pScrn);	bx.x1=bx.y1=0;	bx.x2=pPnozz->width;	bx.y2=pPnozz->maxheight;	xf86InitFBManager(pScreen,&bx);	if(!XAAInit(pScreen, pPnozz->pXAA))	    return FALSE;	xf86Msg(X_INFO, "%s: Using acceleration\n", pPnozz->psdp->device);    }    /* Initialise cursor functions */    miDCInitialize (pScreen, xf86GetPointerScreenFuncs());    /* Initialize HW cursor layer.        Must follow software cursor initialization*/    if (pPnozz->HWCursor) { 	extern Bool PnozzHWCursorInit(ScreenPtr pScreen);	if(!PnozzHWCursorInit(pScreen)) {	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 		       "Hardware cursor initialization failed\n");	    return(FALSE);	}	xf86SbusHideOsHwCursor(pPnozz->psdp);    }    /* Initialise default colourmap */    if (!miCreateDefColormap(pScreen))	return FALSE;    if(!xf86SbusHandleColormaps(pScreen, pPnozz->psdp))	return FALSE;    pPnozz->CloseScreen = pScreen->CloseScreen;    pScreen->CloseScreen = PnozzCloseScreen;    pScreen->SaveScreen = PnozzSaveScreen;    /* Report any unused options (only for the first generation) */    if (serverGeneration == 1) {	xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);    }    /* unblank the screen */    PnozzSaveScreen(pScreen, SCREEN_SAVER_OFF);    /* Done */    return TRUE;}