int yres_specified = 0; 
int yres_specified = 0, cvt = 0, rb = 0, interlace = 0, margins = 0; 
int fb_find_mode(struct fb_var_screeninfo *var,		 struct fb_info *info, const char *mode_option,		 const struct fb_videomode *db, unsigned int dbsize,		 const struct fb_videomode *default_mode,		 unsigned int default_bpp){    int i;    /* Set up defaults */    if (!db) {	db = modedb;	dbsize = sizeof(modedb)/sizeof(*modedb);    }    if (!default_mode)	default_mode = &modedb[DEFAULT_MODEDB_INDEX];    if (!default_bpp)	default_bpp = 8;    /* Did the user specify a video mode? */    if (mode_option || (mode_option = global_mode_option)) {	const char *name = mode_option;	unsigned int namelen = strlen(name);	int res_specified = 0, bpp_specified = 0, refresh_specified = 0;	unsigned int xres = 0, yres = 0, bpp = default_bpp, refresh = 0;	int yres_specified = 0;	u32 best, diff;	for (i = namelen-1; i >= 0; i--) {	    switch (name[i]) {		case '@':		    namelen = i;		    if (!refresh_specified && !bpp_specified &&			!yres_specified) {			refresh = my_atoi(&name[i+1]);			refresh_specified = 1;		    } else			goto done;		    break;		case '-':		    namelen = i;		    if (!bpp_specified && !yres_specified) {			bpp = my_atoi(&name[i+1]);			bpp_specified = 1;		    } else			goto done;		    break;		case 'x':		    if (!yres_specified) {			yres = my_atoi(&name[i+1]);			yres_specified = 1;		    } else			goto done;		    break;		case '0'...'9':		    break;		default:		    goto done;	    }	}	if (i < 0 && yres_specified) {	    xres = my_atoi(name);	    res_specified = 1;	}done:	DPRINTK("Trying specified video mode%s %ix%i\n",	    refresh_specified ? "" : " (ignoring refresh rate)", xres, yres);	diff = refresh;	best = -1;	for (i = 0; i < dbsize; i++) {		if ((name_matches(db[i], name, namelen) &&			!fb_try_mode(var, info, &db[i], bpp)))			return 1;		if (res_specified && res_matches(db[i], xres, yres)) {			if(!fb_try_mode(var, info, &db[i], bpp)) {				if(!refresh_specified || db[i].refresh == refresh)					return 1;				else {					if(diff > abs(db[i].refresh - refresh)) {						diff = abs(db[i].refresh - refresh);						best = i;					}				}			}		}	}	if (best != -1) {		fb_try_mode(var, info, &db[best], bpp);		return 2;	}	diff = xres + yres;	best = -1;	DPRINTK("Trying best-fit modes\n");	for (i = 0; i < dbsize; i++) {	    if (xres <= db[i].xres && yres <= db[i].yres) {		DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres);		if (!fb_try_mode(var, info, &db[i], bpp)) {		    if (diff > (db[i].xres - xres) + (db[i].yres - yres)) {			diff = (db[i].xres - xres) + (db[i].yres - yres);			best = i;		    }		}	    }	}	if (best != -1) {	    fb_try_mode(var, info, &db[best], bpp);	    return 5;	}    }    DPRINTK("Trying default video mode\n");    if (!fb_try_mode(var, info, default_mode, default_bpp))	return 3;    DPRINTK("Trying all modes\n");    for (i = 0; i < dbsize; i++)	if (!fb_try_mode(var, info, &db[i], default_bpp))	    return 4;    DPRINTK("No valid mode found\n");    return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/96fe6a2109db29cd15b90a093c16e6cb4b19371a/modedb.c/clean/drivers/video/modedb.c