fb.fb_height, dpix, dpiy, fb.fb_width)) {
fb.fb_height, dpix, dpiy, 2048)) {
pmaxScreenInit(index, pScreen, argc, argv)	int     index;	ScreenPtr pScreen;	int     argc;	char  **argv;{        pmaxScreenPrivate *sp;	PixmapPtr pPixmap;	ColormapPtr pColormap;	VisualPtr pVisual;	int     i;	struct fbtype fb;	pScreen->devPrivates[pmaxScreenPrivateIndex].ptr = sp = 	    (pmaxScreenPrivate *)Xalloc(sizeof(pmaxScreenPrivate));	if ((fdPM = open("/dev/fb0", O_RDWR | O_NDELAY, 0)) < 0) {		ErrorF("couldn't open /dev/fb0\n");		return FALSE;	}	if (ioctl(fdPM, QIOCGINFO, &scrInfo) < 0) {		ErrorF("QIOCGINFO ioctl failed: %s\n", strerror(errno));		exit(1);	}			/* Damn DEC ioctls() aren't enough. Using the Sun ones too... */	if (ioctl(fdPM, FBIOGTYPE, &fb) < 0) {		ErrorF("FBIOGTYPE ioctl failed: %s\n", strerror(errno));		exit(1);	}	ioctl(fdPM, QIOCINIT);	ioctl(fdPM, QIOKERNLOOP);	ioctl(fdPM, QIOVIDEOON);	queue = &scrInfo->qe;	mouse = &scrInfo->mouse;	qLimit = queue->eSize - 1;	lastEventTime = CURRENT_TIME;	/* discard all the current input events */	queue->eHead = queue->eTail;	/*         * set keyclick, mouse acceleration and threshold         */	{		int     clicklevel;		char   *clickvolume;		char   *mouseAcceleration;		int     ma = 4;		char   *mouseThreshold;		int     mt = 4;		PtrCtrl ctrl;		if (commandLinePairMatch(argc, argv, "c", &clickvolume)) {			sscanf(clickvolume, "%d", &clicklevel);			pmaxClick(clicklevel);		}		else if (commandLineMatch(argc, argv, "-c"))			pmaxClick(0);				/*	         * calling pmaxChangePointerControl here may be unclean       XXX	         */		if (commandLinePairMatch(argc, argv, "-a", &mouseAcceleration))			sscanf(mouseAcceleration, "%d", &ma);		if (commandLinePairMatch(argc, argv, "-t", &mouseThreshold))			sscanf(mouseThreshold, "%d", &mt);				ctrl.num = ma;		ctrl.den = 1;		ctrl.threshold = mt;		pmaxChangePointerControl((DevicePtr) NULL, &ctrl);	}	if (dpi == -1) {	/* dpi has not been set */		if (dpix == -1) {	/* ie dpix has not been set */			if (dpiy == -1) {				dpix = 100;				dpiy = 100;			} else				dpix = dpiy;		} else {			if (dpiy == -1)				dpiy = dpix;		}	} else {		dpix = dpi;		dpiy = dpi;	}	pScreen->SaveScreen = pmaxSaveScreen;	pScreen->RealizeCursor = pmaxRealizeCursor;	pScreen->UnrealizeCursor = pmaxUnrealizeCursor;	pScreen->DisplayCursor = pmaxDisplayCursor;	pScreen->SetCursorPosition = pmaxSetCursorPosition;	pScreen->CursorLimits = pmaxCursorLimits;	pScreen->PointerNonInterestBox = pmaxPointerNonInterestBox;	pScreen->ConstrainCursor = pmaxConstrainCursor;	pScreen->RecolorCursor = pmaxRecolorCursor;	pScreen->QueryBestSize = pmaxQueryBestSize;	pScreen->StoreColors = pmaxStoreColors;	pScreen->InstallColormap = pmaxInstallColormap;	pScreen->UninstallColormap = pmaxUninstallColormap;	pScreen->ListInstalledColormaps = pmaxListInstalledColormaps;	switch (fb.fb_boardtype) {	case PMAX_FBTYPE_PM_MONO:		if (!mfbScreenInit(pScreen, scrInfo->bitmap, 1024, 864, dpix, 		    dpiy, 2048)) {		    	close(fdPM);		    	return (FALSE);		}		mfbCreateDefColormap(pScreen);		break;	case PMAX_FBTYPE_SFB:		if (fb.fb_depth != 8) {			/* XXX */    		}    		/* FALLTHROUGH */			case PMAX_FBTYPE_PM_COLOR:	case PMAX_FBTYPE_XCFB:	case PMAX_FBTYPE_CFB:		defaultColorVisualClass = class;		if (!cfbScreenInit(pScreen, scrInfo->bitmap, fb.fb_width, 		    fb.fb_height, dpix, dpiy, fb.fb_width)) {		    	close(fdPM);		    	return (FALSE);		}				cfbCreateDefColormap(pScreen);    		break;			case PMAX_FBTYPE_MFB:		/*		 * XXX mfb is mono, but has 1 byte per pixel (only bit 0		 * is significant). Am I doing this right?		 */		defaultColorVisualClass = StaticGray;		cfbSetVisualTypes(1, StaticGray, 8);			if (!cfbScreenInit(pScreen, scrInfo->bitmap, fb.fb_width, 		    fb.fb_height, dpix, dpiy, fb.fb_width)) {		    	close(fdPM);		    	return (FALSE);		}		cfbCreateDefColormap(pScreen);		break;	default:		ErrorF("pmaxScreenInit: unknown fbtype %d\n", fb.fb_boardtype);		close(fdPM);		return (FALSE);	}		sp->CloseScreen = pScreen->CloseScreen;	pScreen->CloseScreen = pmaxCloseScreen;	sp->cursorRange.x1 = -15;	sp->cursorRange.x2 = fb.fb_width - 1;	sp->cursorRange.y1 = -15;	sp->cursorRange.y2 = fb.fb_height - 1;	return (TRUE);}