GRUB2 resolution setting not respected by Debian – garbage on screen

8,660

Solution 1

These GRUB settings control the display mode used by GRUB, they don't specify the default framebuffer mode used by the kernel. To configure the latter, you can use the video kernel parameter; in Debian, add this to the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub:

video=1280x1024

This should set the display up correctly as soon as the kernel initialises the framebuffer.

The video parameter is documented in detail in fb/modedb.rst in the kernel documentation.

Solution 2

EDIT: This is my old fix (I am the OP, in case someone didn't notice). There is already another, better answer. I'm leaving my answer for educational reasons.


Old fix:

I can't make GRUB2 setting work, still I can change the resolution to desired 1280x1024 from within the running system. The command is:

fbset -g 1280 1024 1280 1024 32

Adding this line to /etc/rc.local fixed my problem. There is still garbage on a part of my screen when the system starts; but when I log in and work, the full resolution of my monitor is available to me.

Share:
8,660

Related videos on Youtube

Kamil Maciorowski
Author by

Kamil Maciorowski

Updated on September 18, 2022

Comments

  • Kamil Maciorowski
    Kamil Maciorowski over 1 year

    I have Debian GNU/Linux 7 without GUI.

    My LCD monitor native resolution is 1280x1024. I'd like my OS to use this resolution by default on tty1, tty2 etc.

    These are the lines from my /etc/default/grub:

    GRUB_GFXMODE=1280x1024
    GRUB_GFXPAYLOAD_LINUX=1280x1024
    

    I have run sudo update-grub, it went without any problems. Rebooted. This should be enough but it's not.

    The behavior is as follows:

    • GRUB2 menu always uses the configured resolution. I have checked with different GRUB_GFXMODE it can use lower resolutions as well, in this case the picture is stretched and utilizes the entire screen – all OK.
    • When the system starts, few initial messages are displayed as expected and the monitor works with its native resolution.
    • At one moment, about when the message Waiting for /dev to be fully populated... appears, the screen flickers. Just after a second the picture is back with the same resolution but there is garbage (like static pixel noise) at the bottom and on the right edge of the screen.
    • When I log in and work afterwards, there are two stripes (bottom, right edge) that are unavailable to me.

    This is how it looks (excuse low photo resolution, it shouldn't matter though). Blue mc window should occupy the entire screen. Graphical garbage can bee seen in upper right corner. The stripe at the bottom is all black but often there is garbage there as well.

    mc window on just a part of the screen


    Despite GRUB2 setting, my OS doesn't use the desired resolution. This is the output of fbset:

    mode "1024x768"
        geometry 1024 768 1280 1024 32
        timings 0 0 0 0 0 0 0
        accel true
        rgba 8/16,8/8,8/0,0/0
    endmode
    

    Still, the monitor does use its native resolution. See the last line on this photo:

    monitor reporting native resolution in use

    How to make GRUB2 setting work?


    Additional info:

    • The hardware is JBC362F36W-2600-B Barebone Mini-ITX System.
    • Its motherboard is NF36-N2600.
    • The graphics is integrated to Intel Atom N2600 CPU.
    • The cable is DVI-D.
    • The monitor is Philips 190B. It behaves well with GRUB2 menu, so I don't think there is something wrong with it.

    And more:

    # lspci | grep VGA
    00:02.0 VGA compatible controller: Intel Corporation Atom Processor D2xxx/N2xxx Integrated Graphics Controller (rev 09)
    
    # uname -a
    Linux [censored] 3.2.0-4-amd64 #1 SMP Debian 3.2.81-1 x86_64 GNU/Linux
    
    # grep -A 6 1280x1024-60 /etc/fb.modes 
    mode "1280x1024-60"
        # D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz
        geometry 1280 1024 1280 1024 8
        timings 9260 248 48 38 1 112 3
        hsync high
        vsync high
    endmode
    
  • Alessandro Carini
    Alessandro Carini about 6 years
    It works! But when SDDM starts desired resolution will not be maintained.