printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n"); } 
printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n"); } 
sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *info){	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;	unsigned int htotal = 0, vtotal = 0;	unsigned int drate = 0, hrate = 0;	int found_mode = 0;	int old_mode;	u32 pixclock;	htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len;	vtotal = var->upper_margin + var->lower_margin + var->vsync_len;	pixclock = var->pixclock;	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) {		vtotal += var->yres;		vtotal <<= 1;	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {		vtotal += var->yres;		vtotal <<= 2;	} else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {		vtotal += var->yres;		vtotal <<= 1;	} else 	vtotal += var->yres;	if(!(htotal) || !(vtotal)) {		DPRINTK("sisfb: Invalid 'var' information\n");		return -EINVAL;	}	if(pixclock && htotal && vtotal) {	   	drate = 1000000000 / pixclock;	   	hrate = (drate * 1000) / htotal;	   	ivideo->refresh_rate = (unsigned int) (hrate * 2 / vtotal);	} else {	   	ivideo->refresh_rate = 60;	}	old_mode = ivideo->sisfb_mode_idx;	ivideo->sisfb_mode_idx = 0;	while( (sisbios_mode[ivideo->sisfb_mode_idx].mode_no[0] != 0) &&	       (sisbios_mode[ivideo->sisfb_mode_idx].xres <= var->xres) ) {		if( (sisbios_mode[ivideo->sisfb_mode_idx].xres == var->xres) &&		    (sisbios_mode[ivideo->sisfb_mode_idx].yres == var->yres) &&		    (sisbios_mode[ivideo->sisfb_mode_idx].bpp == var->bits_per_pixel)) {			ivideo->mode_no = sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni];			found_mode = 1;			break;		}		ivideo->sisfb_mode_idx++;	}	if(found_mode) {		ivideo->sisfb_mode_idx = sisfb_validate_mode(ivideo,				ivideo->sisfb_mode_idx, ivideo->currentvbflags);	} else {		ivideo->sisfb_mode_idx = -1;	}       	if(ivideo->sisfb_mode_idx < 0) {		printk(KERN_ERR "sisfb: Mode %dx%dx%d not supported\n", var->xres,		       var->yres, var->bits_per_pixel);		ivideo->sisfb_mode_idx = old_mode;		return -EINVAL;	}	if(sisfb_search_refresh_rate(ivideo, ivideo->refresh_rate, ivideo->sisfb_mode_idx) == 0) {		ivideo->rate_idx = sisbios_mode[ivideo->sisfb_mode_idx].rate_idx;		ivideo->refresh_rate = 60;	}#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	if(ivideo->sisfb_thismonitor.datavalid) {	   if(!sisfb_verify_rate(ivideo, &ivideo->sisfb_thismonitor, ivideo->sisfb_mode_idx,	                         ivideo->rate_idx, ivideo->refresh_rate)) {	      printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");	   }	}#endif#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	if(((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) && isactive) {#else	if(isactive) {#endif		sisfb_pre_setmode(ivideo);		if(SiSSetMode(&ivideo->SiS_Pr, &ivideo->sishw_ext, ivideo->mode_no) == 0) {			printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", ivideo->mode_no);			return -EINVAL;		}		outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);		sisfb_post_setmode(ivideo);		ivideo->video_bpp    = sisbios_mode[ivideo->sisfb_mode_idx].bpp;		ivideo->video_width  = sisbios_mode[ivideo->sisfb_mode_idx].xres;		ivideo->video_height = sisbios_mode[ivideo->sisfb_mode_idx].yres;		sisfb_calc_pitch(ivideo, var);		sisfb_set_pitch(ivideo);		ivideo->accel = 0;#if defined(FBINFO_HWACCEL_DISABLED) && defined(FBINFO_HWACCEL_XPAN)#ifdef STUPID_ACCELF_TEXT_SHIT		if(var->accel_flags & FB_ACCELF_TEXT) {			info->flags &= ~FBINFO_HWACCEL_DISABLED;		} else {			info->flags |= FBINFO_HWACCEL_DISABLED;		}#endif		if(!(info->flags & FBINFO_HWACCEL_DISABLED)) ivideo->accel = -1;#else		if(var->accel_flags & FB_ACCELF_TEXT) ivideo->accel = -1;#endif		sisfb_set_vparms(ivideo);		ivideo->current_width = ivideo->video_width;		ivideo->current_height = ivideo->video_height;		ivideo->current_bpp = ivideo->video_bpp;		ivideo->current_htotal = htotal;		ivideo->current_vtotal = vtotal;		ivideo->current_linelength = ivideo->video_linelength;		ivideo->current_pixclock = var->pixclock;		ivideo->current_refresh_rate = ivideo->refresh_rate;#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)                ivideo->sisfb_lastrates[ivideo->mode_no] = ivideo->refresh_rate;#endif	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/sis_main.c/clean/drivers/video/sis/sis_main.c