Accessing EDID Information From UEFI Shell

EDID (Extended display Identification Data) is a defined data structure published by a digital monitor to describe its capabilities to a video source such as a graphics card on a computer. This enables a computer to easily determine what types of monitor(s) are connected to it. The EDID structure and possible values for the members of the structure is defined in a standard published by the Video Electronics Standards Association (VESA). Four versions of the EDID structure have been defined over the years. Currently v1.3 ( E-EDID – Enhanced EDID) is probably the most common.

On modern Linux platforms you can access EDID information via the sysfs virtual filesystem which is mounted at /sys. A number of utilities are available on Microsoft Windows that provide the same information. So far, I have not come across a similar utility for the UEFI Shell. Hence I decided to roll my own.

I have written a number of EDID parsers before. The main challenge on this particular platform was to provide support for the representation of decimal numbers as UCS2 strings. UEFI does not currently support floating point or real numbers as native types. I adopted a C language floa implementation I found from an Internet to use a fixed radix of 10 (decimal) and added the ability to specify the number of decimal places.

The other challenge was to find the GOP protocol handle which had the EDID information. See the code in efi_main for how I did it. I am sure there probably is a far more elegant way to do this but so far I have not found it. Please let me know if you know a better way of doing this.

Lots more useful data is available from EDID. I only parsed and outputted a small amount of the data that is available to keep the demo code to a reasonable size. If you are reading this post, I assume that you are reasonably familiar with UEFI concepts including the GOP protocol, and how to build command line applications using the gnu_efi package, so I am not going to explain the above code in detail.

Using the above code, here is what was outputted for a 14″ Lenovo laptop:

I am not sure why the display type is monochrome rather than color. I need to investigate that issue further when I get some spare time (think longhaul flight!)

Feel free to use this code. I would however appreciate it if you would respect my copyright notice and include it at the top of the code. I have placed a copy of this code together with a Makefile and the two necessary headers on GitHub under the showedid subdirectory. To compile the code, you need to have the gnu_efi package installed.

By the way, no future versions of the EDID standard are planned. DisplayID is a VESA standard first published in 2009 which is intended to replace EDID and E-EDID. It features variable-length structures which encompass all existing EDID extensions as well as new extensions for 3D displays, embedded displays and more. However, I suspect that EDID will live on for a long time simply because of the enormous number of EDID-enabled monitors that are out there.