EDID decoding in libXrandr?
josh at freedesktop.org
Tue Nov 13 11:32:09 PST 2007
Keith Packard wrote:
> On Tue, 2007-11-13 at 19:51 +0100, Soeren Sandmann wrote:
>> I am considering adding an EDID parser to libXrandr. I am going to
>> need on in various places in GNOME, and the alternative is to cut and
>> paste it, since a libedidparser.so doesn't make much ssense, and since
>> a full EDID parser doesn't really belong in the GTK+ API either.
> Sticking it into libXrandr would mean that XCB-based apps would use a
> different API then? That seems sub-optimal. But, sharing code is good,
> so it should go somewhere.
I personally don't see any problem with a dedicated library for EDID
parsing. I don't think it has any dependence on the X API (client or
server), and it could prove useful in several places.
> We could consider sharing the same code as the X server, including EDID
> quirks, which would unify this information in a single place.
That sounds like a good idea, but then you'd need to extend the API
to supply the information needed to evaluate the quirks. The library
shouldn't directly grab machine information, for instance. Do any of
the quirks need DMI information, or PCI information?
>> The parser would be a single API entry:
>> XRRParseEDID (const unsigned char *edid_data,
>> XRRMonitorInfo *info);
>> that would fill out the info struct if edid_data resembles an EDID
>> block sufficently (ie., it would be reasonably forgiving of malformed
> The library should probably allocate the structure and fill it in, and
> the structure should contain version information so apps could tell
> which parts were valid, and whether various extension bits existed.
Yes. And if it allocates the structure, you need a corresponding free
method. Also, the structure forms part of the API as well, unless you
make the structure opaque and have accessor functions for its fields.
- Josh Triplett
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 252 bytes
Desc: OpenPGP digital signature
More information about the xorg