[FR] report laptop display in [detect --brief]
As-is:
Running ddcutil --brief detect doesn't give explicit information about the existence of a laptop display:
$ ddcutil --brief detect
Invalid display
I2C bus: /dev/i2c-4
DRM connector: card0-eDP-1
drm_connector_id: 100
Monitor: LEN::
Invalid display
I2C bus: /dev/i2c-8
drm_connector_id: 0
Monitor: AUO::
/ valid displays follow /
...whereas without the --brief option it's stated:
$ ddcutil detect
Invalid display
I2C bus: /dev/i2c-4
DRM_connector: card0-eDP-1
EDID synopsis:
Mfg id: LEN - Lenovo Group Limited
Model:
Product code: 16553 (0x40a9)
Serial number:
Binary serial number: 0 (0x00000000)
Manufacture year: 2018, Week: 0
This is a laptop display. Laptop displays do not support DDC/CI. <--- !!!!!!!!!!!!!!!
Invalid display
I2C bus: /dev/i2c-8
EDID synopsis:
Mfg id: AUO - UNK
Model:
Product code: 22333 (0x573d)
Serial number:
Binary serial number: 0 (0x00000000)
Manufacture year: 2018, Week: 0
This appears to be a laptop display. Laptop displays do not support DDC/CI.
/ valid displays follow /
To-be:
Would like to see an indication of a laptop display in the detect --brief output. Either something like titling the display as Laptop display as opposed to "Invalid display", or adding a row under its Invalid display block.
Motivation: Want to use the output in a script in order to detect whether we're running on a laptop.
Alternative
Or should the existing DRM_connector with a value containing "eDP" be taken as sure-as-it-gets indication of a laptop display?
Normal and verbose output is intended for human consumption, so modifying it is not an issue. The burden is on script writers if the output changes. On the other hand, it is expected that brief output will be relied on in scripts, and changing it in any way may cause script failure. So it will be only be changed for bugs.
A more robust solution that would allow for extension would be a --json or --yaml option for getvcp output and setvcp input.
A DRM_connector whose name includes "eDP" is almost always a laptop display, but it's not perfect. See my bug report DRM connector for external monitor has name card1-eDP-1. It's also possible that the laptop video driver does not support DRM, in which case there's no DRM_connector.
and changing it in any way may cause script failure.
Addition of new rows would be safe. If that breaks the logic, then it sounds entirely like scipts' issue.
more robust solution that would allow for extension would be a --json or --yaml option
That'd be the best for machine consumption for sure.