LVDS and DP through i2c

Kai-Uwe Behrmann ku.b at gmx.de
Fri Dec 24 04:14:20 PST 2010


Am 23.12.10, 11:09 -0500 schrieb Alex Deucher:
> On Thu, Dec 23, 2010 at 2:25 AM, Kai-Uwe Behrmann <ku.b at gmx.de> wrote:
>> Hello,
>>
>> I try to talk to LVDS and DP connected displays over the i2c bus. What works
>> nicely for external DVI displays appears silent for the internal one and DP.
>> Any pointer what could be used or what shall be done to get a communication?
>>
>> example code for EDID fetching:
>> /* 1. select i2c-dev node */
>> const char * device_name = "/dev/i2c-0";
>> /* 2. open device node */
>> int fd = open( device_name, O_RDWR );
>> /* 3. set adress */
>> ioctl(fd, I2C_SLAVE, 0x50)
>>
>> /* 4. request desired block */
>> usleep(50000);
>> char bits[128] = {0};
>> int ret = write( fd, &bits, 1 );
>> if(ret == 1)
>> {
>>  /* 5. read data from node */
>>  char data[128];
>>  usleep(50000);
>>  ret = read( fd, &data, 128 );
>> }
>>
>> Already point 4 fails )-1) with a LVDS i2c node.
>> The DP port returns arbitrary data in point 5.
>>
>> The DP is on a nvidia card, LVDS seems good on nvidia but not working on a
>> evergreen.
>>
>
> For radeon, make sure you are using at least 2.6.34, as previous
> kernels did not expose i2c buses properly due to missing pre/post_xfer
> i2c bit algo hooks.  Next, make sure you are opening the correct i2c

2.6.35 worked nicely. Thanks for the tip.

> bus.   On radeons, we expose all of the on board i2c buses.  In most
> cases, each connector uses a different i2c bus and there are
> additional buses for thermal chips and fan controllers, etc.  Finally,

I check the return values in the code above and the received EDID header.

> not all oems implement an EDID for the laptop panels, or in some cases
> the EDID image is stored in the vbios.  If you just want the EDID, you
> can query that using randr or via sysfs.

For xrandr people seem to have to wait until the KMS patch is not 
rejecting for wrong checksum. sysfs looks interessting too.

> Alex


kind regards
Kai-Uwe Behrmann
-- 
developing for colour management 
www.behrmann.name + www.oyranos.org


More information about the xorg mailing list