我想使用 Linux 内核加载自定义 EDID 文件。我添加drm_kms_helper.edid_firmware=edid/myedid.bin
到GRUB_CMDLINE_LINUX
了/etc/defauls/grub
.然后我更新了 grub.cfg 并将grub2-mkconfig > /boot/grub2/grub.cfg
EDID 文件添加到 initrd 并dracut --force --include /usr/lib/firmware/edid /usr/lib/firmware/edid
检查了lsinitrd
文件是否存在
lsinitrd | grep edid
Arguments: --force --include '/usr/lib/firmware/edid' '/usr/lib/firmware/edid'
drwxrwx--- 2 root root 0 Oct 6 01:25 usr/lib/firmware/edid
然后我重新启动计算机,xrandr 提供旧信息,而不是我在 EDID 文件中定义的信息。
DP1 disconnected (normal left inverted right x axis y axis)
DP2 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.00*
800x600 60.32 56.25
848x480 60.00
640x480 59.94
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
这就是 dmesg | grep drm 打印出来(我也尝试将 drm_kms_firmware 更改为 drm,但这仅删除了日志中的警告。我使用的是 kernelversion 3.10,因此 drm_kms_helper 应该是正确的):
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.76.1.el7.x86_64 root=UUID=XXXXX ro drm_kms_helper.edid_firmware=edid/myedid.bin rhgb quiet mem=2G
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.76.1.el7.x86_64 root=UUID=2df6baad-7c38-488e-8acd-14a461e72a99 ro drm_kms_helper.edid_firmware=edid/myedid.bin rhgb quiet
[ 2.652804] [drm] drm_kms_firmware.edid_firmware is deprecated, please use drm.edid_firmware intead.
[ 3.115696] [drm] Replacing VGA console driver
[ 3.117295] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 3.117299] [drm] Driver supports precise vblank timestamp query.
[ 3.179723] [drm] Initialized i915 1.6.0 20181204 for 0000:00:02.0 on minor 0
[ 3.198830] fbcon: inteldrmfb (fb0) is primary device
[ 3.261252] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
这是 /etc/X11/xorg.conf.d 中的我的 intel.conf
# /etc/X11/xorg.conf.d/01-intel.conf
Section "Device"
Identifier "intel(0)"
Driver "intel"
Option "TearFree" "true"
Option "DRI" "2"
Option "ReprobeOutputs" "true"
Option "HotPlug" "false"
EndSection
和我的 Xorg 日志 (grep drm)
[ 96.089] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.76.1.el7.x86_64 root=UUID=XXXXX ro drm_kms_helper.edid_firmware=edid/myedid.bin rhgb quiet
[ 96.098] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 96.098] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
内核版本:3.10.0-1160.76.1.el7.x86_64
在内核配置中进行了设置
CONFIG_DRM_LOAD_EDID_FIRMWARE=y