return(ret);
return ret;
I128Init(ScrnInfoPtr pScrn, DisplayModePtr mode){	I128Ptr pI128;	I128RegPtr iR;	int pitch_multiplier, iclock;	Bool ret;	CARD32 tmp;	int doubled = 1;	if (mode->Flags & V_DBLSCAN)		doubled = 2;        pI128 = I128PTR(pScrn);	iR = &pI128->RegRec;	pI128->HDisplay = mode->HDisplay;        if (pI128->Debug)        	xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I128Init start\n");	/* config 1 and 2 were saved in Probe()	 * we reset here again in case there was a VT switch	 */	outl(iR->iobase + 0x1C, pI128->io.config1);	outl(iR->iobase + 0x20, pI128->io.config2);	if (pI128->MemoryType == I128_MEMORY_SGRAM) {		outl(iR->iobase + 0x24, pI128->io.sgram & 0x7FFFFFFF);		outl(iR->iobase + 0x24, pI128->io.sgram | 0x80000000);	}	if (pI128->bitsPerPixel == 32)		pitch_multiplier = 4;	else if (pI128->bitsPerPixel == 16)	pitch_multiplier = 2;	else					pitch_multiplier = 1;	if (pI128->RamdacType == TI3025_DAC)		iclock = 4;	else if (pI128->RamdacType == IBM528_DAC)		iclock = 128 / pI128->bitsPerPixel;	else if (pI128->RamdacType == SILVER_HAMMER_DAC)		iclock = 64 / pI128->bitsPerPixel;	else if ((pI128->MemoryType == I128_MEMORY_DRAM) ||		 (pI128->MemoryType == I128_MEMORY_SGRAM))		iclock = 32 / pI128->bitsPerPixel; /* IBM526 DAC 32b bus */	else		iclock = 64 / pI128->bitsPerPixel; /* IBM524/526 DAC */	pI128->mem.rbase_g[INT_VCNT] = 0x00;	pI128->mem.rbase_g[INT_HCNT] = 0x00;	pI128->mem.rbase_g[DB_ADR] = pI128->displayOffset;	pI128->mem.rbase_g[DB_PTCH] = pI128->displayWidth * pitch_multiplier;	pI128->mem.rbase_g[CRT_HAC] = mode->HDisplay/iclock;	pI128->mem.rbase_g[CRT_HBL] = (mode->HTotal - mode->HDisplay)/iclock;	pI128->mem.rbase_g[CRT_HFP] = (mode->HSyncStart - mode->HDisplay)/iclock;	pI128->mem.rbase_g[CRT_HS] = (mode->HSyncEnd - mode->HSyncStart)/iclock;	pI128->mem.rbase_g[CRT_VAC] = mode->VDisplay * doubled;	pI128->mem.rbase_g[CRT_VBL] = (mode->VTotal - mode->VDisplay) * doubled;	pI128->mem.rbase_g[CRT_VFP] = (mode->VSyncStart - mode->VDisplay)* doubled;	pI128->mem.rbase_g[CRT_VS] = (mode->VSyncEnd - mode->VSyncStart) * doubled;	tmp = 0x00000070;	if (pI128->Chipset == PCI_CHIP_I128_T2R)		tmp |= 0x00000100;	if (pI128->Chipset == PCI_CHIP_I128_T2R4) {		if (pI128->FlatPanel)			tmp |= 0x00000100;    /* Turn on digital flat panel */		else			tmp &= 0xfffffeff;    /* Turn off digital flat panel */	}	if (pI128->DACSyncOnGreen || (mode->Flags & V_CSYNC))		tmp |= 0x00000004;	pI128->mem.rbase_g[CRT_1CON] = tmp;	if ((pI128->MemoryType == I128_MEMORY_DRAM) ||	    (pI128->MemoryType == I128_MEMORY_SGRAM))		tmp = 0x20000100;	else if (pI128->MemoryType == I128_MEMORY_WRAM)		tmp = 0x00040100;	else {		tmp = 0x00040101;		if (pI128->MemorySize == 2048)			tmp |= 0x00000002;		if ((pI128->displayWidth & (pI128->displayWidth-1)) ||		    ((pI128->displayWidth * pI128->bitsPerPixel) > 32768L))			tmp |= 0x01000000;  /* split transfer */	}	pI128->mem.rbase_g[CRT_2CON] = tmp;        if (mode->Flags & V_DBLSCAN)		pI128->DoubleScan = TRUE;        else		pI128->DoubleScan = FALSE;	pI128->mem.rbase_g[CRT_ZOOM] = (pI128->DoubleScan ? 0x00000001 : 0x00000000);	pI128->mem.rbase_w[MW0_CTRL] = 0x00000000;	switch (pI128->MemorySize) {		case 2048:			pI128->mem.rbase_w[MW0_SZ]   = 0x00000009;			break;		case 8192:			pI128->mem.rbase_w[MW0_SZ]   = 0x0000000B;			break;		case 8192+4096:			/* no break */		case 16384:			pI128->mem.rbase_w[MW0_SZ]   = 0x0000000C;			break;		case 16384+4096:			/* no break */		case 16384+8192:			/* no break */		case 16384+8192+4096:			/* no break */		case 32768:			pI128->mem.rbase_w[MW0_SZ]   = 0x0000000D;			break;		case 4096:			/* no break */		default:			pI128->mem.rbase_w[MW0_SZ]   = 0x0000000A;/* default 4MB */			break;	}	pI128->mem.rbase_w[MW0_PGE]  = 0x00000000;	pI128->mem.rbase_w[MW0_ORG]  = 0x00000000;	pI128->mem.rbase_w[MW0_MSRC] = 0x00000000;	pI128->mem.rbase_w[MW0_WKEY] = 0x00000000;	pI128->mem.rbase_w[MW0_KDAT] = 0x00000000;	pI128->mem.rbase_w[MW0_MASK] = 0xFFFFFFFF;									MB;	if ((pI128->io.id&0x7) > 0 || pI128->Chipset == PCI_CHIP_I128_T2R			        || pI128->Chipset == PCI_CHIP_I128_T2R4) {	   	pI128->io.vga_ctl &= 0x0000FF00;   		pI128->io.vga_ctl |= 0x00000082;                if (pI128->FlatPanel && (mode->Flags & V_DBLSCAN))		   pI128->io.vga_ctl |= 0x00000020;  /* Stretch horizontally */   		outl(iR->iobase + 0x30, pI128->io.vga_ctl);                if (pI128->Chipset == PCI_CHIP_I128_T2R4) {                        outl(iR->iobase + 0x24, 0x211BF030);			usleep(5000);			outl(iR->iobase + 0x24, 0xA11BF030);		} else if (pI128->MemoryType == I128_MEMORY_SGRAM) {			outl(iR->iobase + 0x24, 0x21089030);			usleep(5000);			outl(iR->iobase + 0x24, 0xA1089030);		}	}	ret = pI128->ProgramDAC(pScrn, mode);	pI128->InitCursorFlag = TRUE;	pI128->Initialized = 1;        if (pI128->Debug)        	xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I128Init complete\n");	return(ret);}