for(j = 0; j < 8; j++) { if((xres == sisfb_ddcfmodes[j].x) && (yres == sisfb_ddcfmodes[j].y) && 
for(j = 0; j < 8; j++) { if((xres == sisfb_ddcfmodes[j].x) && (yres == sisfb_ddcfmodes[j].y) && 
sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer){	int i, j, xres, yres, refresh, index;	u32 emodes;	if(buffer[0] != 0x00 || buffer[1] != 0xff ||	   buffer[2] != 0xff || buffer[3] != 0xff ||	   buffer[4] != 0xff || buffer[5] != 0xff ||	   buffer[6] != 0xff || buffer[7] != 0x00) {	   printk(KERN_DEBUG "sisfb: Bad EDID header\n");	   return FALSE;	}	if(buffer[0x12] != 0x01) {	   printk(KERN_INFO "sisfb: EDID version %d not supported\n",	   	buffer[0x12]);	   return FALSE;	}	monitor->feature = buffer[0x18];	if(!buffer[0x14] & 0x80) {	   if(!(buffer[0x14] & 0x08)) {	      printk(KERN_INFO "sisfb: WARNING: Monitor does not support separate syncs\n");	   }	}	if(buffer[0x13] >= 0x01) {	   /* EDID V1 rev 1 and 2: Search for monitor descriptor	    * to extract ranges	    */	    j = 0x36;	    for(i=0; i<4; i++) {	       if(buffer[j]     == 0x00 && buffer[j + 1] == 0x00 &&	          buffer[j + 2] == 0x00 && buffer[j + 3] == 0xfd &&		  buffer[j + 4] == 0x00) {		  monitor->hmin = buffer[j + 7];		  monitor->hmax = buffer[j + 8];		  monitor->vmin = buffer[j + 5];		  monitor->vmax = buffer[j + 6];		  monitor->dclockmax = buffer[j + 9] * 10 * 1000;		  monitor->datavalid = TRUE;		  break;	       }	       j += 18;	    }	}	if(!monitor->datavalid) {	   /* Otherwise: Get a range from the list of supported	    * Estabished Timings. This is not entirely accurate,	    * because fixed frequency monitors are not supported	    * that way.	    */	   monitor->hmin = 65535; monitor->hmax = 0;	   monitor->vmin = 65535; monitor->vmax = 0;	   monitor->dclockmax = 0;	   emodes = buffer[0x23] | (buffer[0x24] << 8) | (buffer[0x25] << 16);	   for(i = 0; i < 13; i++) {	      if(emodes & sisfb_ddcsmodes[i].mask) {	         if(monitor->hmin > sisfb_ddcsmodes[i].h) monitor->hmin = sisfb_ddcsmodes[i].h;		 if(monitor->hmax < sisfb_ddcsmodes[i].h) monitor->hmax = sisfb_ddcsmodes[i].h + 1;		 if(monitor->vmin > sisfb_ddcsmodes[i].v) monitor->vmin = sisfb_ddcsmodes[i].v;		 if(monitor->vmax < sisfb_ddcsmodes[i].v) monitor->vmax = sisfb_ddcsmodes[i].v;		 if(monitor->dclockmax < sisfb_ddcsmodes[i].d) monitor->dclockmax = sisfb_ddcsmodes[i].d;	      }	   }	   index = 0x26;	   for(i = 0; i < 8; i++) {	      xres = (buffer[index] + 31) * 8;	      switch(buffer[index + 1] & 0xc0) {	         case 0xc0: yres = (xres * 9) / 16; break;	         case 0x80: yres = (xres * 4) /  5; break;	         case 0x40: yres = (xres * 3) /  4; break;	         default:   yres = xres;	    break;	      }	      refresh = (buffer[index + 1] & 0x3f) + 60;	      if((xres >= 640) && (yres >= 480)) {                 for(j = 0; j < 8; j++) {	            if((xres == sisfb_ddcfmodes[j].x) &&	               (yres == sisfb_ddcfmodes[j].y) &&		       (refresh == sisfb_ddcfmodes[j].v)) {		      if(monitor->hmin > sisfb_ddcfmodes[j].h) monitor->hmin = sisfb_ddcfmodes[j].h;		      if(monitor->hmax < sisfb_ddcfmodes[j].h) monitor->hmax = sisfb_ddcfmodes[j].h + 1;		      if(monitor->vmin > sisfb_ddcsmodes[j].v) monitor->vmin = sisfb_ddcsmodes[j].v;		      if(monitor->vmax < sisfb_ddcsmodes[j].v) monitor->vmax = sisfb_ddcsmodes[j].v;		      if(monitor->dclockmax < sisfb_ddcsmodes[j].d) monitor->dclockmax = sisfb_ddcsmodes[i].d;	            }	         }	      }	      index += 2;           }	   if((monitor->hmin <= monitor->hmax) && (monitor->vmin <= monitor->vmax)) {	      monitor->datavalid = TRUE;	   }	} 	return(monitor->datavalid);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/sis_main.c/clean/drivers/video/sis/sis_main.c