The goal is to obtain the manufacturer and product ID and the serial number of the display under the Linux platform. I eventually need to get this information in the program in C++. But I also accept the command line acquisition method.
Such information is available via
/sys/class/drm subsystem. Tools such as
xrandr use it extensively. Now, specifically there is directory for each display in this subsystem, with a file
edid, Extended Display Identification Data.
On Debian-based systems there are two packages available,
read-edid. Both seem to work alright, but on old and dated models
read-edid seems to work well enough, whereas
edid-decode returns errors:
EDID block does NOT conform to EDID 1.3! Detailed block string not properly terminated EDID block does not conform at all! Bad year of manufacture
So I would recommend installing
read-edid package. After you have installed, use
parse-edid command as shown below:
$ parse-edid < /sys/class/drm/card0-HDMI-A-1/edid Checksum Correct Section "Monitor" Identifier "X20G-NagaIII" ModelName "X20G-NagaIII" VendorName "SPT" # Monitor Manufactured week 42 of 2005 # EDID version 1.3 # Digital Display DisplaySize 410 310 Gamma 2.20 Option "DPMS" "true" Horizsync 30-92 VertRefresh 40-86 # Maximum pixel clock is 170MHz
The other command
get-edid appears to connect to i2c bus and figures out automatically which displays are connected and what data is available. Now, of course this is no C++ method, but these two tools are likely written in C. Consider looking at their source code and note which libraries they use.