How to get display info from EDID?

1,345 views
Skip to first unread message

Simon Que

unread,
Jun 7, 2017, 5:14:44 PM6/7/17
to chromium-os-dev
Is there currently any tool or library in CrOS to retrieve and parse EDID info from the display(s) connected to a Chrome OS device?

(We used to have xrandr for that but X has been removed. What has replaced xrandr?)

Simon

Brian Norris

unread,
Jun 7, 2017, 5:19:32 PM6/7/17
to Simon Que, chromium-os-dev
Does 'modetest' give you what you need?

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en


Bernie Thompson

unread,
Jun 7, 2017, 5:19:54 PM6/7/17
to Simon Que, chromium-os-dev
I believe the next closest we have is `modetest`.

-Bernie

On Wed, Jun 7, 2017 at 2:14 PM, Simon Que <sq...@chromium.org> wrote:

--

Wilson, Brian

unread,
Jun 7, 2017, 5:39:26 PM6/7/17
to chromium-os-dev

Will this give you what you need?

 

Example is for the device’s eDP panel:

cd /sys/class/drm/card0-eDP/

hexdump –C edid

 

-Brian

---
You received this message because you are subscribed to the Google Groups "Chromium OS dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Simon Que

unread,
Jun 7, 2017, 5:42:41 PM6/7/17
to Wilson, Brian, chromium-os-dev
Yeah, pretty much.

My use case is to get the following info from DRM/EDID and put into a protobuf (or some other structured data format) to be sent to Chrome:
  1. Model number
  2. Manufacturer
  3. Serial number
  4. Output port on computer
  5. Input port on display
Items 1-3 can be parsed from the raw EDID blob.

Item 4 can be obtained from the sysfs path.

Item 5, I'm not sure how to get.


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dev+unsubscribe@chromium.org.

Mark Hayter

unread,
Jun 8, 2017, 1:52:36 PM6/8/17
to Simon Que, Wilson, Brian, chromium-os-dev

Some edid parsing tools made their way into libcras

Not sure how much use they have had recently.

Mark

Doug Anderson

unread,
Jun 8, 2017, 2:17:41 PM6/8/17
to Mark Hayter, Simon Que, Wilson, Brian, chromium-os-dev
I always use a tool called "edid_decode". I think I had to track down
the source code and compile it myself since the version that Ubuntu
installed by default for me was old and had some big bugs. I don't
remember where I found it. I then use this absolutely awful python
code to convert a chunk of hex values into binary and pass it there.

---

#!/usr/bin/python

import sys
import binascii
import subprocess

if __name__ == '__main__':
s = sys.stdin.read()
s = s.replace(' ', '').replace('\n', '').replace('\t', '')
b = binascii.unhexlify(s)

print ", ".join("%#02x" % ord(c) for c in b)

p = subprocess.Popen(['/b/tip/scripts/edid_decode'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out, _ = p.communicate(b)
print out
>>> email to chromium-os-d...@chromium.org.

Tom Wai-Hong Tam (談偉航)

unread,
Jun 8, 2017, 4:40:42 PM6/8/17
to Doug Anderson, Mark Hayter, Simon Que, Wilson, Brian, chromium-os-dev
There is a Python implementation edidparser under chameleon repo:

Use it like:
 $ ./edidparser parse test_edid

And also some conversion tools:
 jsonedid: convert EDID binary to JSON
 jsonparser: convert JSON to EDID binary



>>>
>>> --
>>> --
>>> Chromium OS Developers mailing list: chromiu...@chromium.org
>>> View archives, change email options, or unsubscribe:
>>> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>>>
>>
>> --
>> --
>> Chromium OS Developers mailing list: chromiu...@chromium.org
>> View archives, change email options, or unsubscribe:
>> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>>
>
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

Mike Frysinger

unread,
Jun 8, 2017, 4:43:57 PM6/8/17
to Tom Wai-Hong Tam (談偉航), Doug Anderson, Mark Hayter, Simon Que, Wilson, Brian, chromium-os-dev
there is also the read-edid project which is written in C.  it provides `get-edid` which uses raw i/o commands or Linux i2c to read the blob, and then passes it to `parse-edid` to do the actual display.  in our case, if the edid is available via sysfs files, could just run `parse-edid` on that directly.
-mike

Dominik Behr

unread,
Jun 8, 2017, 5:32:49 PM6/8/17
to Chromium OS dev
You could read EDID from EDID blob property for the connector using DRM/KMS wrappers in Chrome. This probably would be the best way to make sure you are reading from correct connector/monitor. EDID format is pretty well described on Wikipedia and parsing it is not hard https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages