#ifdef CONFIG_FB_TRIDENT_ACCEL acc->init_accel(info->var.xres,bpp); #endif 
static int tridentfb_set_par(struct fb_info *info){	struct tridentfb_par * par = (struct tridentfb_par *)(info->par);	u32	htotal,hdispend,hsyncstart,hsyncend,hblankstart,hblankend,		vtotal,vdispend,vsyncstart,vsyncend,vblankstart,vblankend;	struct fb_var_screeninfo *var = &info->var;		int bpp = var->bits_per_pixel;	unsigned char tmp;	debug("enter\n");	htotal = (var->xres + var->left_margin + var->right_margin + var->hsync_len)/8 - 10;	hdispend = var->xres/8 - 1;	hsyncstart = (var->xres + var->right_margin)/8;	hsyncend = var->hsync_len/8;	hblankstart = hdispend + 1;	hblankend = htotal + 5;	vtotal = var->yres + var->upper_margin + var->lower_margin + var->vsync_len - 2;	vdispend = var->yres - 1;	vsyncstart = var->yres + var->lower_margin;	vsyncend = var->vsync_len;	vblankstart = var->yres;	vblankend = vtotal + 2;	enable_mmio();	crtc_unlock();	write3CE(CyberControl,8);	if (flatpanel && var->xres < nativex) {		/*		 * on flat panels with native size larger		 * than requested resolution decide whether		 * we stretch or center		 */		t_outb(0xEB,0x3C2);		shadowmode_on();		if (center) 			screen_center();		else if (stretch)			screen_stretch();	} else {		t_outb(0x2B,0x3C2);		write3CE(CyberControl,8);	}	/* vertical timing values */	write3X4(CRTVTotal, vtotal & 0xFF);	write3X4(CRTVDispEnd, vdispend & 0xFF);	write3X4(CRTVSyncStart, vsyncstart & 0xFF);	write3X4(CRTVSyncEnd, (vsyncend & 0x0F));	write3X4(CRTVBlankStart, vblankstart & 0xFF);	write3X4(CRTVBlankEnd, 0/*p->vblankend & 0xFF*/);	/* horizontal timing values */	write3X4(CRTHTotal, htotal & 0xFF);	write3X4(CRTHDispEnd, hdispend & 0xFF);	write3X4(CRTHSyncStart, hsyncstart & 0xFF);	write3X4(CRTHSyncEnd, (hsyncend & 0x1F) | ((hblankend & 0x20)<<2));	write3X4(CRTHBlankStart, hblankstart & 0xFF);	write3X4(CRTHBlankEnd, 0/*(p->hblankend & 0x1F)*/);	/* higher bits of vertical timing values */	tmp = 0x10;	if (vtotal & 0x100) tmp |= 0x01;	if (vdispend & 0x100) tmp |= 0x02;	if (vsyncstart & 0x100) tmp |= 0x04;	if (vblankstart & 0x100) tmp |= 0x08;	if (vtotal & 0x200) tmp |= 0x20;	if (vdispend & 0x200) tmp |= 0x40;	if (vsyncstart & 0x200) tmp |= 0x80;	write3X4(CRTOverflow, tmp);	tmp = read3X4(CRTHiOrd) | 0x08;	//line compare bit 10	if (vtotal & 0x400) tmp |= 0x80;	if (vblankstart & 0x400) tmp |= 0x40;	if (vsyncstart & 0x400) tmp |= 0x20;	if (vdispend & 0x400) tmp |= 0x10;	write3X4(CRTHiOrd, tmp);	tmp = 0;	if (htotal & 0x800) tmp |= 0x800 >> 11;	if (hblankstart & 0x800) tmp |= 0x800 >> 7;	write3X4(HorizOverflow, tmp);		tmp = 0x40;	if (vblankstart & 0x200) tmp |= 0x20;//FIXME	if (info->var.vmode & FB_VMODE_DOUBLE) tmp |= 0x80;  //double scan for 200 line modes	write3X4(CRTMaxScanLine, tmp);	write3X4(CRTLineCompare,0xFF);	write3X4(CRTPRowScan,0);	write3X4(CRTModeControl,0xC3);	write3X4(LinearAddReg,0x20);	//enable linear addressing	tmp = (info->var.vmode & FB_VMODE_INTERLACED) ? 0x84:0x80;	write3X4(CRTCModuleTest,tmp);	//enable access extended memory	write3X4(GraphEngReg, 0x80);	//enable GE for text acceleration//	if (info->var.accel_flags & FB_ACCELF_TEXT)//FIXME		acc->init_accel(info->var.xres,bpp);		switch (bpp) {		case 8:  tmp = 0x00; break;		case 16: tmp = 0x05; break;		case 24: tmp = 0x29; break;		case 32: tmp = 0x09; 	}	write3X4(PixelBusReg, tmp);	tmp = 0x10;	if (chipcyber)	    tmp |= 0x20;	write3X4(DRAMControl, tmp);	//both IO,linear enable	write3X4(InterfaceSel, read3X4(InterfaceSel) | 0x40);	write3X4(Performance,0x20);	write3X4(PCIReg,0x07);		//MMIO & PCI read and write burst enable	/* convert from picoseconds to MHz */	par->vclk = 1000000/info->var.pixclock;	if (bpp == 32)		par->vclk *=2;	set_vclk(par->vclk);	write3C4(0,3);	write3C4(1,1);		//set char clock 8 dots wide	write3C4(2,0x0F);	//enable 4 maps because needed in chain4 mode	write3C4(3,0);	write3C4(4,0x0E);	//memory mode enable bitmaps ??	write3CE(MiscExtFunc,(bpp==32)?0x1A:0x12);	//divide clock by 2 if 32bpp							//chain4 mode display and CPU path	write3CE(0x5,0x40);	//no CGA compat,allow 256 col	write3CE(0x6,0x05);	//graphics mode	write3CE(0x7,0x0F);	//planes?	if (chip_id == CYBERBLADEXPAi1) {		/* This fixes snow-effect in 32 bpp */		write3X4(CRTHSyncStart,0x84);	}	writeAttr(0x10,0x41);	//graphics mode and support 256 color modes	writeAttr(0x12,0x0F);	//planes	writeAttr(0x13,0);	//horizontal pel panning	//colors	for(tmp = 0;tmp < 0x10;tmp++)		writeAttr(tmp,tmp);	readb(par->io_virt + CRT + 0x0A);	//flip-flop to index	t_outb(0x20, 0x3C0);			//enable attr	switch (bpp) {		case 8:	tmp = 0;break;		//256 colors		case 15: tmp = 0x10;break;		case 16: tmp = 0x30;break;	//hicolor		case 24: 			//truecolor		case 32: tmp = 0xD0;break;	}	t_inb(0x3C8);	t_inb(0x3C6);	t_inb(0x3C6);	t_inb(0x3C6);	t_inb(0x3C6);	t_outb(tmp,0x3C6);	t_inb(0x3C8);	if (flatpanel)		set_number_of_lines(info->var.yres);	set_lwidth(info->var.xres * bpp/(4*16));	info->fix.visual = (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;	info->fix.line_length = info->var.xres * (bpp >> 3);  	info->cmap.len = (bpp == 8) ? 256: 16;	debug("exit\n");	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8dad46cf38c029248d1331b6a97b2999e0751cfa/tridentfb.c/clean/drivers/video/tridentfb.c