Skip to content

Enforcing correct EDID for a monitor

If your monitor's native resolution is not automatically detected or no display is detected at all, it may be due to the monitor sending an incorrect or missing EDID (Extended Display Identification Data) file. In such cases, the kernel will attempt to set one of the most common resolutions as a fallback.

If you have a valid EDID file for your monitor, you can explicitly enforce it to resolve the issue. However, in most cases, you may not have direct access to a correct EDID file. In this situation, you can either extract an existing EDID and fix it or generate a new one.

Note

This guide assumes you are using an Arch Linux (or a related distribution) system with systemd-boot as the boot manager.

Remember to test your changes and keep a backup of any modified configuration files.

1. Prepare the EDID

1.1 Searching for an EDID file

  1. Search for your monitor model on EDID.tv, an open collection of EDID files.
  2. If you find a suitable EDID file, download it and proceed to step 1.3.

1.2 Extracting EDID from the monitor

If you couldn't find a suitable EDID file on EDID.tv, you can try extracting the EDID directly from your monitor:

  1. Install the necessary tools:

    Text Only
    sudo pacman -S read-edid edid-decode-git
    
  2. Extract the EDID using read-edid:

    Text Only
    sudo read-edid > mymonitor.edid
    
  3. Analyse the extracted EDID using edid-decode:

    Text Only
    edid-decode mymonitor.edid
    
  4. If the EDID is incorrect, fix it using edid-generator:

    Text Only
    edid-generator --output mymonitor-fixed.edid
    

    Follow the prompts to input the correct monitor specifications.

1.3 Copying the EDID file

  1. Create a directory named edid under /usr/lib/firmware, if it doesn't already exist:

    Text Only
    sudo mkdir -p /usr/lib/firmware/edid
    
  2. Copy the downloaded or generated .edid binary file to /usr/lib/firmware/edid:

    Text Only
    sudo cp mymonitor.edid /usr/lib/firmware/edid/
    

    The directory structure should look like this (the name of the EDID file will differ):

    Text Only
    /usr/lib/firmware/edid
    └── mymonitor.edid
    

2. Configure kernel parameters

  1. Identify the correct display identifier using xrandr:

    Text Only
    xrandr --query
    

    Look for the connected display, e.g., DP-1, HDMI-0, etc.

  2. Modify the boot loader's configuration file, e.g., /boot/loader/entries/archlinux.conf.

  3. Load the EDID by specifying drm.edid_firmware=DP-1:edid/mymonitor.edid video=DP-1:e. Make sure to replace DP-1 with the correct display identifier and mymonitor.edid with the actual EDID file name. For example:

    Text Only
    1
    2
    3
    4
    5
    title Arch Linux
    sort-key archlinux
    options root=UUID=0a3407de-014b-458b-b5c1-848e92a327a3 rw rootfstype=ext4 drm.edid_firmware=DP-1:edid/mymonitor.edid video=DP-1:e
    linux /vmlinuz-linux
    initrd /initramfs-linux.img
    

    Warning

    If you are using early KMS, you must include the custom EDID file in the initramfs. Otherwise, you may encounter problems. If you are not using early KMS, no further setup is needed.

3. Include the EDID in the initramfs (if using early KMS)

The FILES option in the initramfs configuration allows you to add files to the initial ramdisk image (initramfs). These files are added before hooks are run and can be used to override files used or provided by a hook. Unlike the files added via the BINARIES option, FILES are added as-is. To include the custom EDID file in the initramfs:

  1. Open the initramfs configuration file (e.g., /etc/mkinitcpio.conf).

  2. Locate the FILES array and add the path to your custom EDID file:

    Text Only
    FILES=(/usr/lib/firmware/edid/mymonitor.edid)
    
  3. Regenerate the initramfs image by running the appropriate command for your distribution:

    Text Only
    sudo mkinitcpio -P
    

4. Troubleshooting

If you encounter issues after applying the custom EDID, try the following:

  • Verify that the EDID file is correctly named and placed in the /usr/lib/firmware/edid directory.
  • Double-check that the kernel parameters in the boot loader configuration are correct, especially the display identifier and EDID file name.
  • If using early KMS, ensure that the EDID file is properly included in the initramfs and that the initramfs has been regenerated.
  • Try a different EDID file, either from EDID.tv or by extracting and fixing the EDID from your monitor.

5. Reverting changes

If you need to revert the changes made:

  1. Remove the custom EDID file from the /usr/lib/firmware/edid directory:

    Text Only
    sudo rm /usr/lib/firmware/edid/mymonitor.edid
    
  2. Remove the drm.edid_firmware and video kernel parameters from the boot loader configuration file.

  3. If you included the EDID file in the initramfs:

    • Remove the EDID file path from the FILES array in the initramfs configuration file (e.g., /etc/mkinitcpio.conf).
    • Regenerate the initramfs image:
    Text Only
    sudo mkinitcpio -P
    

6. Alternative methods

Depending on your setup, you may be able to enforce the correct EDID using alternative methods:

  • Xorg configuration: Create a custom Xorg configuration file that specifies the correct monitor settings, including the EDID. This method is suitable for systems using a standalone Xorg server.
  • Xrandr: Use the xrandr command to manually set the desired resolution and refresh rate for your monitor. This can be added to your desktop environment's startup script or xinitrc file.
  • Kernel module parameters: Some kernel modules, such as i915 for Intel graphics, accept parameters that allow you to specify the EDID. Consult your graphics driver's documentation for more information.