[Intel-gfx] Is there a way to determine which display is the laptop display?
alan.amaral at virtualcomputer.com
Thu Feb 2 13:28:15 PST 2012
With earlier hardware it was pretty easy to determine which display was the laptop display
as it was usually (always?) "LVDS". With new hardware it's sometimes an embedded display
port (eDP) display, and I've seen at least one laptop which has the laptop monitor listed as simply
Display Port (DP), although that may not have been an Intel machine. In the DP case the laptop
monitor can't be distinguished from a normal display port monitor.
Is there a way to definitively determine which, if any, monitor is the one that belongs to the laptop
on a laptop machine? I need to know in order to write a utility which tracks the laptop lid state (i.e.
open or closed), and automatically enables or disables the laptop monitor via XRandR when the state
changes. It has to work across all Intel (and if possible ATI) machines.
The current code I have uses some heuristics to figure out what outputs are available on the system,
i.e. checks for LVDS, then eDP, then DP, and makes a guess as to which one is the laptop monitor,
but in some cases, like the DisplayPort case I described above, it's impossible to know for sure, and
if a future release changes the names it will fail.
One thing I have seen is that the serial number contained in the laptop's display EDID information
for the laptops I've tried have all been 0, but that may simply be a fluke of the particular machines
I've tried. Plus there are normal monitors which provide badly formed EDID information, so I can't
rely on this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Intel-gfx