I have Linux Mint 17 on my laptop. Also I have 22'' monitor connected to laptop using HDMI cable. My disk if fully encrypted with LUKS and LVM. On boot I get graphical prompt to enter password for encrypted partitions. Screen resolution on on both laptop and external monitor is wrong when asking for password. Graphical prompt and linux mint logo is moved to top left corner on both monitors and rest of space is black. Resolution is correct only after I log in to my profile. This is what xrandr shows when I'm logged in:
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 32767 x 32767
LVDS1 connected 1366x768+1920+312 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.1*+ 40.1
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 298mm
1920x1080 60.0*+
1680x1050 59.9
1600x900 60.0
1280x1024 75.0 60.0
1280x800 59.9
1152x864 75.0
1280x720 60.0
1024x768 75.1 60.0
832x624 74.6
800x600 75.0 60.3
640x480 75.0 60.0
720x400 70.1
DP1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
After mounting encrypted disk I can change resolution on monitors using xrandr command. But this command is unavailable with initramfs.
I was recently fixing another laptop screen brightness on boot using initramfs script and it worked. This script was setting brightness by echoing correct value to to /sys/class/backlight/acpi_video0/brightness. Can I also use something similar to change screen resolution somehow?
UPDATE
I've tried @mikeserv solution:
EDID files from monitors (not sure if they are correct):
# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/edid > /lib/firmware/edid/1366x768.bin # cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1/edid > /lib/firmware/edid/1920x1080.bin # hexdump /lib/firmware/edid/1366x768.bin 0000000 ff00 ffff ffff 00ff e430 033b 0000 0000 0000010 1600 0401 2290 7813 610a 9ed5 5b5e 269a 0000020 501a 0054 0000 0101 0101 0101 0101 0101 0000030 0101 0101 0101 1de2 b456 0050 3038 3024 0000040 0035 c258 0010 1900 13ec c656 0050 302e 0000050 3024 0035 c258 0010 1900 0000 fe00 3500 0000060 4833 3935 3180 3635 4857 0a34 0000 0000 0000070 0000 3141 0096 0000 0100 0a01 2020 ac00 0000080 # hexdump /lib/firmware/edid/1920x1080.bin 0000000 ff00 ffff ffff 00ff d109 78a5 5445 0000 0000010 1626 0301 3580 781e b72e a4d5 5456 279f 0000020 500c a554 806b 0081 c081 8081 c0a9 00b3 0000030 c0d1 0101 0101 3a02 1880 3871 402d 2c58 0000040 0045 2a13 0021 1e00 0000 ff00 4c00 4339 0000050 3030 3537 3039 3931 200a 0000 fd00 3200 0000060 1e4c 1153 0a00 2020 2020 2020 0000 fc00 0000070 4200 6e65 2051 4c47 3432 3035 200a d900 0000080Hook script for initramfs, loads
i915module and includeEDIDfiles into/lib/firmware/edid/directory insideinitramfs(I've checked andEDIDfiles are inside initramfs)# cat /etc/initramfs-tools/hooks/include-edid-data #!/bin/sh PREREQ="udev" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions # Begin real processing below this line if [ ! -e "${DESTDIR}/lib/firmware/edid" ]; then mkdir -p "${DESTDIR}/lib/firmware/edid" fi if [ -r "/lib/firmware/edid/1366x768.bin" ]; then cp "/lib/firmware/edid/1366x768.bin" "${DESTDIR}/lib/firmware/edid/" fi if [ -r "/lib/firmware/edid/1920x1080.bin" ]; then cp "/lib/firmware/edid/1920x1080.bin" "${DESTDIR}/lib/firmware/edid/" fi manual_add_modules i915 exit 0 # chmod a+rx /etc/initramfs-tools/hooks/include-edid-data # update-initramfs -uOn reboot I've added boot parameter (not sure if it should be HDMI-1 or HDMI1 or something else)
drm_kms_helper.edid_firmware=HDMI1:/lib/firmware/edid/1920x1080.binIt didn't change anything. So I also tried:
drm_kms_helper.edid_firmware=HDMI-1:/lib/firmware/edid/1920x1080.bin drm_kms_helper.edid_firmware=HDMI1:edid/1920x1080.bin drm_kms_helper.edid_firmware=HDMI-1:edid/1920x1080.bin
No luck at all. Everything is like it was before I took steps from above.
I also want to add that when HDMI monitor id disconnected resolution on laptop monitor is correct.
What am I doing wrong?
UPDATE 2
Still not working. Steps I took:
Found out correct names for my monitors:
$ for p in /sys/class/drm/*/status; do if [ "$(cat "$p")" == "connected" ]; then echo -n "$p" | awk -F '/' '{print $5}'; fi; done card0-HDMI-A-1 card0-LVDS-1Install
linux-doc(to get docs describing creation of customEDID),dos2unix,make(for compilingEDIDfiles) packages$ sudo apt-get install linux-doc dos2unix makeCreate temporary directory for compilation and copy source files for
EDID$ mkdir ~/Tmp/edid $ cd ~/Tmp/edid $ cp /usr/share/doc/linux-doc/EDID/* . $ rm *.S $ cp /usr/share/doc/linux-doc/EDID/1920x1080.S . $ cp /usr/share/doc/linux-doc/EDID/1920x1080.S 1366x768.SEdit file
1366x768.Swith correct values, compile, copy to/lib/firmware/edid:Obtain current working modeline for my laptop screen
$ xvidtune -show "1366x768" 76.50 1366 1402 1450 1546 768 771 776 824 -hsync -vsyncThey are in turn:
resolution,clock MHz,hdisp,hsyncstart,hsyncend,htotal,vdisp,vsyncstart,vsyncend,vtotalCalculate values:
CLOCK = 76500 XPIX = hdisp = 1366 XBLANK = htotal - hdisp = 1546 - 1366 = 180 XOFFSET = hsyncstart - hdisp = 1402 - 1366 = 36 XPULSE = hsyncend - hsyncstart = 1450 - 1402 = 48 YPIX = vdisp = 768 YBLANK = vtotal - vdisp = 824 - 768 = 56 YOFFSET = 63 + vsyncstart - vdisp = 63 + 771 - 768 = 66 YPULSE = 63 + vsyncend - vsyncstart = 63 + 776 - 771 = 68 TIMING_NAME "Linux HDR" CRC 0xcdFinal version
1366x768.S:$ cat 1366x768.S /* EDID */ #define VERSION 1 #define REVISION 3 /* Display */ #define CLOCK 76500 /* kHz */ #define XPIX 1366 #define YPIX 768 #define XY_RATIO XY_RATIO_16_9 #define XBLANK 180 #define YBLANK 56 #define XOFFSET 36 #define XPULSE 48 #define YOFFSET 66 #define YPULSE 68 #define DPI 96 #define VFREQ 60 /* Hz */ #define TIMING_NAME "Linux HDR" #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */ #define HSYNC_POL 1 #define VSYNC_POL 1 #define CRC 0xcd #include "edid.S"Compile files and check if no errors using
edid-decode(sudo apt-get install edid-decode):$ make clean && make rm 1920x1080.o 1366x768.o $ ls -1 *.bin 1366x768.bin 1920x1080.bin $ edid-decode 1366x768.bin Extracted contents: header: 00 ff ff ff ff ff ff 00 serial number: 31 d8 00 00 00 00 00 00 05 16 version: 01 03 basic params: 6d 23 14 78 ea chroma info: 5e c0 a4 59 4a 98 25 20 50 54 established: 00 00 00 standard: 8b c0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 descriptor 1: e2 1d 56 b4 50 00 38 30 24 30 35 00 63 c8 10 00 00 1e descriptor 2: 00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20 descriptor 3: 00 00 00 fd 00 3b 3d 30 32 08 00 0a 20 20 20 20 20 20 descriptor 4: 00 00 00 fc 00 4c 69 6e 75 78 20 48 44 52 0a 20 20 20 extensions: 00 checksum: cd Manufacturer: LNX Model 0 Serial Number 0 Made week 5 of 2012 EDID version: 1.3 Analog display, Input voltage level: 0.7/0.7 V Sync: Separate Composite Serration Maximum image size: 35 cm x 20 cm Gamma: 2.20 DPMS levels: Standby Suspend Off RGB color display First detailed timing is preferred timing Established timings supported: Standard timings supported: 1360x816@60Hz Detailed mode: Clock 76.500 MHz, 355 mm x 200 mm 1366 1402 1450 1546 hborder 0 768 771 776 824 vborder 0 +hsync +vsync Serial number: Linux #0 Monitor ranges: 59-61HZ vertical, 48-50kHz horizontal, max dotclock 80MHz Monitor name: Linux HDR Checksum: 0xcd $ edid-decode 1920x1080.bin Extracted contents: header: 00 ff ff ff ff ff ff 00 serial number: 31 d8 00 00 00 00 00 00 05 16 version: 01 03 basic params: 6d 32 1c 78 ea chroma info: 5e c0 a4 59 4a 98 25 20 50 54 established: 00 00 00 standard: d1 c0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 descriptor 1: 02 3a 80 18 71 38 2d 40 58 2c 45 00 f4 19 11 00 00 1e descriptor 2: 00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20 descriptor 3: 00 00 00 fd 00 3b 3d 42 44 0f 00 0a 20 20 20 20 20 20 descriptor 4: 00 00 00 fc 00 4c 69 6e 75 78 20 46 48 44 0a 20 20 20 extensions: 00 checksum: 05 Manufacturer: LNX Model 0 Serial Number 0 Made week 5 of 2012 EDID version: 1.3 Analog display, Input voltage level: 0.7/0.7 V Sync: Separate Composite Serration Maximum image size: 50 cm x 28 cm Gamma: 2.20 DPMS levels: Standby Suspend Off RGB color display First detailed timing is preferred timing Established timings supported: Standard timings supported: 1920x1152@60Hz Detailed mode: Clock 148.500 MHz, 500 mm x 281 mm 1920 2008 2052 2200 hborder 0 1080 1084 1089 1125 vborder 0 +hsync +vsync Serial number: Linux #0 Monitor ranges: 59-61HZ vertical, 66-68kHz horizontal, max dotclock 150MHz Monitor name: Linux FHD Checksum: 0x5Copy files to
/lib/firmware/edid$ sudo cp *.bin /lib/firmware/edid
Update
initramfs, hook script should add edid files (they are there, I've checked)$ sudo update-initramfs -uOn boot, edit grub command line (pressed shift on boot to show grub menu and after press
e) from:linux /vmlinuz-3.13.0-24-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoffto
linux /vmlinuz-3.13.0-24-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff drm_kms_helper.edid_firmware=card0-LVDS-1:/lib/firmware/edid/1366x768.bin drm_kms_helper.edid_firmware=card0-HDMI-A-1:/lib/firmware/edid/1920x1080.bin
Also I've tried setting it just for one monitor. But no luck at all. I'm starting to think that it is not a problem with resolution but with plymouth image itself. When I see boot image it is not blurred, stretched or anything and Linux mint logo is sharp and clear. It's just smaller than my screen and placed in left top part of my laptop and HDMI screen.
I've found this bug that is really similar to my problem. So I think I must wait for them to fix this.