[Intel-gfx] Specific resolution without monitor

paulo louro paulo_louro at msn.com
Sat May 19 11:31:19 CEST 2012


Hey Carl,
I had the same problem as you.
So i wanted my MediaCenter to start up at for example 15h just before i get home. But since my TV and my AV receiver where in standby the resolution detected by the drm driver as always wrong. So to by pass this i have changed a bit intel drm driver and hard coded my TV EDID data directly into the driver. This ways every time the MC starts up it thinks is connected to the PC and setups the right resolution. 
Now this is not a simple thing to do since you will need to compile the linux kernel, you can also only compile the drm driver/module for sure but i dont know how to do that ....
So what i did was, with some linux software, named edid grab or read or something, i extracted my TV edid in HEX format. Then i changed the function "drm_do_get_edid" inside the drm_edid.c file located at the linux kernel/drivers/gpu/drm/  to ignore the i2c bus and to use the edid i defined inside my block1 byte array. Also needed to comment out some code, since EDID something comes in multiple messages. Below you can find my modifications.

I hope this help you out. Maybe this is not the right way of doing it, but it worked for me. I´m not and expert on DRM or I915 driver, just wanted to make it worked so i hard coded it all. You can always improve and maybe add the function of reading the EDID from a file like the NVIDIA driver has. 


static u8 *drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter){	int i, j = 0, valid_extensions = 0;	u8 *block, *new;	u8 block1[256] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x34,0xa9,0xa4,0xa0,0x01,0x01,0x01,0x01,		       0x00,0x14,0x01,0x03,0x80,0x00,0x00,0x78,0x0a,0xda,0xff,0xa3,0x58,0x4a,0xa2,0x29,		       0x17,0x49,0x4b,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,		       0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x3a,0x80,0xd0,0x72,0x38,0x2d,0x40,0x10,0x2c,		       0x45,0x80,0xba,0x88,0x21,0x00,0x00,0x1e,0x02,0x3a,0x80,0x18,0x71,0x38,0x2d,0x40,		       0x58,0x2c,0x45,0x00,0xba,0x88,0x21,0x00,0x00,0x1e,0x00,0x00,0x00,0xfc,0x00,0x50,		       0x61,0x6e,0x61,0x73,0x6f,0x6e,0x69,0x63,0x2d,0x54,0x56,0x0a,0x00,0x00,0x00,0xfd,		       0x00,0x17,0x3d,0x0f,0x44,0x0f,0x00,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x01,0xd3,		       0x02,0x03,0x36,0x72,0x50,0x9f,0x90,0x14,0x05,0x20,0x13,0x04,0x12,0x03,0x11,0x02,		       0x16,0x07,0x15,0x06,0x01,0x23,0x09,0x07,0x01,0x78,0x03,0x0c,0x00,0x10,0x00,0xb8,		       0x26,0x2f,0xc0,0x0a,0x81,0x49,0xff,0xfc,0x06,0x16,0x08,0x00,0x18,0x00,0x00,0x00,		       0x00,0x00,0xe3,0x05,0x1f,0x01,0x01,0x1d,0x80,0xd0,0x72,0x1c,0x16,0x20,0x10,0x2c,		       0x25,0x80,0xba,0x88,0x21,0x00,0x00,0x9e,0x01,0x1d,0x80,0x18,0x71,0x1c,0x16,0x20,		       0x58,0x2c,0x25,0x00,0xba,0x88,0x21,0x00,0x00,0x9e,0x01,0x1d,0x00,0xbc,0x52,0xd0,		       0x1e,0x20,0xb8,0x28,0x55,0x40,0xba,0x88,0x21,0x00,0x00,0x1e,0x01,0x1d,0x00,0x72,		       0x51,0xd0,0x1e,0x20,0x6e,0x28,0x55,0x00,0xba,0x88,0x21,0x00,0x00,0x1e,0x00,0xb6};
	//if ((block = kmalloc(EDID_LENGTH, GFP_KERNEL)) == NULL)	//	return NULL;
	if ((block = kmalloc(EDID_LENGTH*2, GFP_KERNEL)) == NULL)		return NULL;
		/* base block fetch */	//for (i = 0; i < 4; i++) {	//	if (drm_do_probe_ddc_edid(adapter, block, 0, EDID_LENGTH))	//		goto out;	//	if (drm_edid_block_valid(block))	//		break;	//	if (i == 0 && drm_edid_is_zero(block, EDID_LENGTH)) {	//		connector->null_edid_counter++;	//		goto carp;	//	}	//}	//if (i == 4)	//	goto carp;
	//DRM_DEBUG_KMS("DUMP EDID START\n");	//for(i = 0 ; i < EDID_LENGTH; i += 16 )	//	DRM_DEBUG_KMS("0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x\n",block[i],block[i+1],block[i+2],block[i+3],block[i+4],block[i+5],block[i+6],block[i+7],block[i+8],block[i+9],block[i+10],block[i+11],block[i+12],block[i+13],block[i+14],block[i+15]);	//DRM_DEBUG_KMS("\nDUMP EDID END\n");
	DRM_DEBUG_KMS("Overwriting EDID\n");	//DRM_DEBUG_KMS("EDID_LENGTH: %d\n",EDID_LENGTH);
	for(i = 0; i < 256; i++)		block[i]=block1[i];		
	return block;
	/* if there's no extensions, we're done */	if (block[0x7e] == 0)		return block;
	new = krealloc(block, (block[0x7e] + 1) * EDID_LENGTH, GFP_KERNEL);	if (!new)		goto out;	block = new;
	for (j = 1; j <= block[0x7e]; j++) {		for (i = 0; i < 4; i++) {			if (drm_do_probe_ddc_edid(adapter,				  block + (valid_extensions + 1) * EDID_LENGTH,				  j, EDID_LENGTH))				goto out;			if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH)) {				valid_extensions++;				break;			}		}		if (i == 4)			dev_warn(connector->dev->dev,			 "%s: Ignoring invalid EDID block %d.\n",			 drm_get_connector_name(connector), j);	}
	if (valid_extensions != block[0x7e]) {		block[EDID_LENGTH-1] += block[0x7e] - valid_extensions;		block[0x7e] = valid_extensions;		new = krealloc(block, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);		if (!new)			goto out;		block = new;	}
	return block;
carp:	dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n",		 drm_get_connector_name(connector), j);
out:	kfree(block);	return NULL;}
> Date: Wed, 16 May 2012 15:48:55 -0400
> From: cahunter at cbnco.com
> To: intel-gfx at lists.freedesktop.org
> Subject: [Intel-gfx] Specific resolution without monitor
> 
> I'm trying to set my xorg.conf file up so that I get a specific 
> resolution when my monitor is turned off and I reboot my PC.  lspci 
> shows that I've got a 945GME and Xorg.0.log shows that I'm using version 
> 2.17.0 of the Intel driver.  I'm running Mythbuntu 11.10.  With my other 
> systems running the nvidia driver I can use the option 
> "ConnectedMonitor" to achieve this.  I guess I'm looking for the 
> equivalent for the Intel driver.
> 
> Thanks
> 
> Carl
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120519/99358407/attachment.html>


More information about the Intel-gfx mailing list