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