Following method describes how to fix EDID display size information of your monitor if it's wrong (some of Samsung's monitors report incorrect size when connected over HDMI, for example). It assumes that your monitor is connected to HDMI1 port (HDMI-A-1 is full kernel address).
I used following tools:
- Bless
- edid-decode-git
- edid-rw (I used parts of this script for
edid-checksum.py
) - read-edid (parse-edid, get-edid)
- get the current edid file
cat /sys/class/drm/card0-HDMI-A-1/edid > incorrect-edid.bin
- find display size saved in your edid file
parse-edid < incorrect-edid.bin | grep DisplaySize
you should see something like:
Checksum Correct
DisplaySize 160 90
it means your monitor tells you it has 160mm×90mm size
- update size information
- display size lives on offset 0x15 (width) and 0x16 (height) of the binary file
- it's in centimeters! it means 160mm -> 16cm -> 0x10 and 90mm -> 9cm -> 0x09
- open the binary file in hexadecimal editor (I used Bless)
- find the index and verify that it's the incorrect size you want to fix (in my case 0x10 on 0x15 offset and 0x09 on 0x16 offset)
- delete these two numbers and type new ones instead, 530mm -> 53cm -> 0x35 and 300mm -> 30cm -> 0x1E in my case
- save as
correct-edid.py
and update checksum
create edid-checksum.py
(see below)
chmod u+x edid-checksum.py
./edid-checksum.py < correct-edid.bin
you should see that checksum is now invalid:
You need to fix checksum on offset 0x7f
0x75 is BAD, should be 0x65
update the checksum on offset 0x7f to value 0x65; save and check again, you should see:
Checksums are correct!
- copy fixed edid file
sudo cp correct-edid.bin /usr/lib/firmware/edid/syncmaster-2494hm.bin
-
use it in your kernel; there are two parts:
-
update your
/etc/mkinitcpio.conf
(if you want to have it early when booting) add your graphics driver to modules
MODULES=( … i915 … )
add binary file to files which are added to your initramfs
FILES=(/usr/lib/firmware/edid/syncmaster-2494hm.bin)
regenerate your initramfs
sudo mkinitcpio -p linux
- add kernel options to your bootloader, I use systemd bootloader so I updated
/boot/loader/entries/arch.conf
options drm_kms_helper.edid_firmware=HDMI-A-1:edid/syncmaster-2494hm.bin …
- reboot and be happy again!!!
Do it on your own risk!!! You can really mess up your system if you don't know what exactly you are doing!
how could steps 4-6 be in debian?