^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) EDID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) In the good old days when graphics parameters were configured explicitly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) in a file called xorg.conf, even broken hardware could be managed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Today, with the advent of Kernel Mode Setting, a graphics board is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) either correctly working because all components follow the standards -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) or the computer is unusable, because the screen remains dark after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) booting or it displays the wrong area. Cases when this happens are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) - The graphics board does not recognize the monitor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) - The graphics board is unable to detect any EDID data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) - The graphics board incorrectly forwards EDID data to the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) - The monitor sends no or bogus EDID data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) - A KVM sends its own EDID data instead of querying the connected monitor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) Adding the kernel parameter "nomodeset" helps in most cases, but causes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) restrictions later on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) As a remedy for such situations, the kernel configuration item
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) CONFIG_DRM_LOAD_EDID_FIRMWARE was introduced. It allows to provide an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) individually prepared or corrected EDID data set in the /lib/firmware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) directory from where it is loaded via the firmware interface. The code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) (see drivers/gpu/drm/drm_edid_load.c) contains built-in data sets for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) commonly used screen resolutions (800x600, 1024x768, 1280x1024, 1600x1200,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 1680x1050, 1920x1080) as binary blobs, but the kernel source tree does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) not contain code to create these data. In order to elucidate the origin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) of the built-in binary EDID blobs and to facilitate the creation of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) individual data for a specific misbehaving monitor, commented sources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) and a Makefile environment are given here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) To create binary EDID and C source code files from the existing data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) material, simply type "make" in tools/edid/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) If you want to create your own EDID file, copy the file 1024x768.S,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) replace the settings with your own data and add a new target to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) Makefile. Please note that the EDID data structure expects the timing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) values in a different way as compared to the standard X11 format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) X11:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) HTimings:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) hdisp hsyncstart hsyncend htotal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) VTimings:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) vdisp vsyncstart vsyncend vtotal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) EDID::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #define XPIX hdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define XBLANK htotal-hdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define XOFFSET hsyncstart-hdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define XPULSE hsyncend-hsyncstart
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define YPIX vdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define YBLANK vtotal-vdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define YOFFSET vsyncstart-vdisp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define YPULSE vsyncend-vsyncstart