Skip to content

CEC physical address and edid

Pekka Nikander edited this page Nov 13, 2012 · 2 revisions

The CEC protocol needs the physical address from the HMDI EDID DDC.

Mac OS X reads the EDID information automatically at the kernel level, in IOFramebuffer::getDDCBlock and stores it in the I/O registry at IODisplay::readFramebufferEDID under the key kIODisplayEDIDKey.

These commands reads it:

 ioreg -l -w0 | grep EDID
 system_profiler SPDisplaysDataType

Have a look at this blog.

http://opensource.apple.com/source/IOKitUser/IOKitUser-177/graphics.subproj/IOGraphicsLibInternal.h

For programmatic access:

#include "IOGraphicsLibInternal.h"

foo (io_service_t framebuffer,
     IOOptionBits options )

CFDataRef data = 0;
CFMutableDictionaryRef regDict;
io_service_t service = 0;
EDID *edid = 0;

service = IODisplayForFramebuffer( framebuffer, options)
IORegistryEntryCreateCFProperties( service, &regDict, kCFAllocatorDefault, kNilOptions );
data = CFDictionaryGetValue( regDict, CFSTR(kIODisplayEDIDKey) );
edid = (EDID *) CFDataGetBytePtr( data );

Clone this wiki locally