Esempio n. 1
0
void getResolution(UInt32* params)
{
	unsigned char* edidInfo = readEDID();
	
	if(!edidInfo) {
		xResolution = 1024;
		yResolution = 768;
		bpResolution = 32;
		
		free( edidInfo );
	} else {
		// TODO: check *all* resolutions reported and either use the highest,
		// or the native resolution (if there is a flag for that).
		xResolution =  edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
		yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
		
		bpResolution = 32;	// assume 32bits
		
		free( edidInfo );
		
		// Mode Sanity check
		if ((xResolution < 1024) || !yResolution || !xResolution) //Azi: is 1024 the minimum on notebooks ??
		{
			xResolution = 1024;
			yResolution = 768;
		}
		
		params[0]  = xResolution;
		params[1]  = yResolution;
		params[2] = bpResolution;
	}
}
Esempio n. 2
0
void getResolution(UInt32* x, UInt32* y, UInt32* bp)
{
	int val;
	static UInt32 xResolution, yResolution, bpResolution;

	if(getIntForKey(kScreenWidth, &val, DEFAULT_BOOT_CONFIG))
	{
		xResolution = val;
	}
	
	if(getIntForKey(kScreenHeight, &val, DEFAULT_BOOT_CONFIG))
	{
		yResolution = val;
	}

	bpResolution = 32;	// assume 32bits

	
	if(!xResolution || !yResolution || !bpResolution)
	{
		
		char* edidInfo = readEDID();
		
		if(!edidInfo) return;
		
		// TODO: check *all* resolutions reported and either use the highest, or the native resolution (if there is a flag for that)
		xResolution =  edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
		yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
		
		//printf("H Active = %d", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) );
		//printf("V Active = %d", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) );
		
		free( edidInfo );
		
		if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH;
		if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT;

	}

	*x  = xResolution;
	*y  = yResolution;
	*bp = bpResolution;

}
Esempio n. 3
0
VOID getResolution(UINT32* x, UINT32* y, UINT32* bp)
{
//	INT32 val;
	static UINT32 xResolution, yResolution, bpResolution = 32;	// assume 32bits
/*
	if(getIntForKey(kScreenWidth, &val, &bootInfo->chameleonConfig))
	{
		xResolution = val;
	}
	
	if(getIntForKey(kScreenHeight, &val, &bootInfo->chameleonConfig))
	{
		yResolution = val;
	}
*/
	
			edid_mode mode;
		CHAR8* edidInfo = readEDID();
		
		if(!edidInfo) return;
		// TODO: check *all* resolutions reported and either use the highest, or the native resolution (if there is a flag for that)
		//xResolution =  edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);  
		//yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4); 
		//Slice - done here
		
		if(fb_parse_edid((struct EDID *)edidInfo, &mode) == 0)
		{
			xResolution = DEFAULT_SCREEN_WIDTH;
			yResolution = DEFAULT_SCREEN_HEIGHT;
		}
		else {
			xResolution = mode.h_active;
			yResolution = mode.v_active;
		}

		/*
		 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x32 0x0C
		 0x00 0xDF 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0x00
		 0x0C 0xDF 0x00 0x00 0x12 0x03 0x21 0x78 0xE9 0x99 
		 0x53 0x28 0xFF 0xFF 0x32 0xDF 0x00 0x12 0x80 0x78 
		 0xD5 0x53 0x26 0x00 0x01 0x01 0x01 0x01 0xFF 0x00 
		 0xDF 0x00 0x03 0x78 0x99 0x28 0x00 0x01 0x01 0x01 
		 0x01 0x21 0x84 0x20 0xFF 0x0C 0x00 0x03 0x0A 0x53 
		 0x54 0x01 0x01 0x01 0xDE 0x84 0x56 0x00 0xA0 0x30
		 0xFF 0xDF 0x12 0x78 0x53 0x00 0x01 0x01 0x01 0x84 
		 0x00 0x18 0x84 0x00 0x00 0x57 0xFF 0x00 0x80 0x99
		 0x54 0x01 0x01 0x21 0x20 0x00 0x50 0x00 0x00 0x35
		 0x57 0xFE 0x00 0x00 0x78 0x28 0x01 0x01 0x21 0x20
		 0x18 0x30 0x00 0x57 0x34 0xFE 0xAA 0x9A 

		 */
		
		//DBG("H Active = %d ", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) );
		//DBG("V Active = %d \n", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) );
		
		FreePool( edidInfo );
		
		//if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH;
		//if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT;



	*x  = xResolution;
	*y  = yResolution;
	*bp = bpResolution;
  
  DBG("Best mode: %dx%dx%d\n", *x, *y, *bp);
}