* Initialise cursor functions.  This example is for the mi * software cursor.
* Initialise cursor functions.
VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv){	ScrnInfoPtr pScrn;	vgaHWPtr hwp;	VMWAREPtr pVMWARE;	Bool ret;	/* Get the ScrnInfoRec */	pScrn = xf86Screens[pScreen->myNum];	pVMWARE = VMWAREPTR(pScrn);        /*         * If using the vgahw module, its data structures and related         * things are typically initialised/mapped here.         */	hwp = VGAHWPTR(pScrn);	vgaHWGetIOBase(hwp);	/* Save the current video state */	VMWARESave(pScrn);	VMWAREInitFIFO(pScrn);	/* Initialise the first mode */	VMWAREModeInit(pScrn, pScrn->currentMode);	/* Set the viewport if supported */	VMWAREAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);	/*	 * Setup the screen's visuals, and initialise the framebuffer	 * code.	 */	VMWAREMapMem(pScrn);	/* Reset the visual list */	miClearVisualTypes();	/*	 * Setup the visuals supported.  This driver only supports	 * TrueColor for bpp > 8, so the default set of visuals isn't	 * acceptable.  To deal with this, call miSetVisualTypes with	 * the appropriate visual mask.	 */	if (pScrn->bitsPerPixel > 8) {		if (!miSetVisualTypes(pScrn->depth, TrueColorMask,			pScrn->rgbBits, pScrn->defaultVisual)) {			return FALSE;		}	} else {		if (!miSetVisualTypes(pScrn->depth,				miGetDefaultVisualMask(pScrn->depth),			pScrn->rgbBits, pScrn->defaultVisual)) {			return FALSE;		}	}	miSetPixmapDepths ();	/*	 * Initialise the framebuffer.	 */	ret = fbScreenInit (pScreen, pVMWARE->FbBase,			    pScrn->virtualX, pScrn->virtualY,			    pScrn->xDpi, pScrn->yDpi,			    pScrn->displayWidth,			    pScrn->bitsPerPixel);    	if (!ret)		return FALSE;        /* Override the default mask/offset settings */        if (pScrn->bitsPerPixel > 8) {	int i;		VisualPtr visual;		for (i = 0, visual = pScreen->visuals;			i < pScreen->numVisuals; i++, visual++) {			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;			}		}	}	/* must be after RGB ordering fixed */	fbPictureInit (pScreen, 0, 0);	/*	 * Wrap the CloseScreen vector and set SaveScreen.	 */	ScreenToPrivate(pScreen, pScrn);        /*         * If backing store is to be supported (as is usually the case),         * initialise it.         */        miInitializeBackingStore(pScreen);        /*         * Set initial black & white colourmap indices.         */        xf86SetBlackWhitePixels(pScreen);        /*         * Install colourmap functions.  If using the vgahw module,         * vgaHandleColormaps would usually be called here.         */        /*         * Initialise cursor functions.  This example is for the mi         * software cursor.         */	if (pVMWARE->hwCursor) {		vmwareCursorInit(0, pScreen);	} else {	        miDCInitialize(pScreen, xf86GetPointerScreenFuncs());	}    	if (!fbCreateDefColormap(pScreen))	    return FALSE;	if (!xf86HandleColormaps(pScreen, 256, 8,		VMWARELoadPalette, NULL,		CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) {	    return FALSE;	}	/* Report any unused options (only for the first generation) */	if (serverGeneration == 1) {		xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);	}	vmwareSendSVGACmdUpdateFullScreen(pVMWARE);	if (pVMWARE->hwCursor) {		vmwareRestoreCursor(pScreen);	}	/* Done */	return TRUE;}