Reading EDID data on new Apple M1 devices

Can anyone provide an example (preferably in C++) of how to read the EDID data for the current display?

I can do it on an Intel based Mac, the same code does not work on the new Apple M1 devices. The Intel code looks something like:

Code Block
CFMutableDictionaryRef matching = IOServiceMatching("IODisplayConnect");
io_iterator_t iter = 99;
kern_return_t err = IOServiceGetMatchingServices( kIOMasterPortDefault, matching, &iter );
io_service_t serv;
serv = IOIteratorNext( iter );
CFDictionaryRef displayInfo;
displayInfo = IODisplayCreateInfoDictionary( serv, kIODisplayOnlyPreferredName );
( . . . )


It appears that the new Apple M1 devices have a new video architecture, so the IOServiceMatching / IOServiceGetMatchingServices on longer works.
So it turns out that IODisplayConnect is not supported on Apple's M1 systems.

Look for IODPDevice then iterate as needed.
Did you just replace IODisplayConnect by IODPDevice and the iteration worked out of the box ?
Reading EDID data on new Apple M1 devices
 
 
Q