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¶
- Search for your monitor model on EDID.tv, an open collection of EDID files.
- 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:
-
Install the necessary tools:
Text Only -
Extract the EDID using
read-edid:Text Only -
Analyse the extracted EDID using
edid-decode:Text Only -
If the EDID is incorrect, fix it using
edid-generator:Text Only Follow the prompts to input the correct monitor specifications.
1.3 Copying the EDID file¶
-
Create a directory named
edidunder/usr/lib/firmware, if it doesn't already exist:Text Only -
Copy the downloaded or generated
.edidbinary file to/usr/lib/firmware/edid:Text Only The directory structure should look like this (the name of the EDID file will differ):
2. Configure kernel parameters¶
-
Identify the correct display identifier using
xrandr:Text Only Look for the connected display, e.g.,
DP-1,HDMI-0, etc. -
Modify the boot loader's configuration file, e.g.,
/boot/loader/entries/archlinux.conf. -
Load the EDID by specifying
drm.edid_firmware=DP-1:edid/mymonitor.edid video=DP-1:e. Make sure to replaceDP-1with the correct display identifier andmymonitor.edidwith the actual EDID file name. For example:Text Only 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:
-
Open the initramfs configuration file (e.g.,
/etc/mkinitcpio.conf). -
Locate the
FILESarray and add the path to your custom EDID file:Text Only -
Regenerate the initramfs image by running the appropriate command for your distribution:
Text Only
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/ediddirectory. - 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:
-
Remove the custom EDID file from the
/usr/lib/firmware/ediddirectory:Text Only -
Remove the
drm.edid_firmwareandvideokernel parameters from the boot loader configuration file. -
If you included the EDID file in the initramfs:
- Remove the EDID file path from the
FILESarray in the initramfs configuration file (e.g.,/etc/mkinitcpio.conf). - Regenerate the initramfs image:
Text Only - Remove the EDID file path from the
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
xrandrcommand 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
i915for Intel graphics, accept parameters that allow you to specify the EDID. Consult your graphics driver's documentation for more information.