Where is /lib/firmware?
The final resting place for your EDID mode firmware should be under
/lib/firmware/edid. However, many linux distributions place the example EDID mode-setting firmware source and the Makefile under the directory for the linux kernel documentation. For Fedora, this is provided by the
kernel-doc package and resides under
/usr/share/doc/kernel-doc-3.11.4/Documentation/EDID. After you compile the firmware for your monitor, you can place the edid binary anywhere that is accessable to grub upon boot, but the convention is
Can I tweak an existing edid.bin file to match my monitor's resolution?
edid.bin files are in binary format so the correct way to tweak it would not be intuitive.
How can I make an EDID file from scratch?
The post you provided links to the official kernel documentation for building your custom edid file. The same instructions are also provided in the
HOWTO.txt file in the kernel documentation directory referenced above. Essentially you edit one of the example firmware files, say
1024x768.S, providing the parameters for your monitor. Then compile it with the provided
Makefile and configure grub to use the new firmware.
For me, there were two tricky bits to accomplishing this. The first one is where to find the edid source file that needs to be compiled. This was answered for Fedora above.
The second tricky bit is finding the correct values to place in
1024x768.S for your monitor. This is achieved by running
cvt to generate your desired modeline and then doing a little arithmetic. For a resolution of 1600x900 with 60 Hz refresh rate and reduced blanking (recommended for LCDs), you would have:
[user@host ~]$ cvt 1600 900 60 -r
# 1600x900 59.82 Hz (CVT 1.44M9-R) hsync: 55.40 kHz; pclk: 97.50 MHz
Modeline "1600x900R" 97.50 1600 1648 1680 1760 900 903 908 926 +hsync -vsync
You can match the last line of this output to the instructions in
Please note that the EDID data structure expects the timing
values in a different way as compared to the standard X11 format.
HTimings: hdisp hsyncstart hsyncend htotal
VTimings: vdisp vsyncstart vsyncend vtotal
#define XPIX hdisp
#define XBLANK htotal-hdisp
#define XOFFSET hsyncstart-hdisp
#define XPULSE hsyncend-hsyncstart
#define YPIX vdisp
#define YBLANK vtotal-vdisp
#define YOFFSET (63+(vsyncstart-vdisp))
#define YPULSE (63+(vsyncend-vsyncstart))
The 2nd - 5th numbers in the last line of the
cvt output (
1600 1648 1680 1760) are the four "HTimings" parameters (
hdisp hsyncstart hsyncend htotal) and the 6th - 9th numbers (
900 903 908 926) are the four "VTimings" parameters (
vdisp vsyncstart vsyncend vtotal).
Lastly, you'll need to compile the firmware a second time in order to set the correct CRC value in the last line (see the
HOWTO.txt for details).