# [SOLVED] efifb - set resolution

## Marcih

On my UEFI machine, I've switched from booting using GRUB2 to EFI stub kernel. Everything went swimmingly except for the console resolution. I'm using the proprietary nvidia-drivers, which don't set the console resolution automagically like nouveau does. When using GRUB2, I've worked around this using the GRUB config file.

In "/etc/default/grub":

```
# The resolution used on graphical terminal.

# Note that you can use only modes which your graphic card supports via VBE.

# You can see them in real GRUB with the command `vbeinfo'.

GRUB_GFXMODE=1920x1080x32,640x480x32,auto
```

If I understood correctly, this set the efifb resolution. Is there a way to achieve this without GRUB?

My current attempt:

```
$ dmesg | grep efifb

[    0.000000] Kernel command line: root=PARTUUID=[REDACTED] video=efifb:1920x1080x32

[    0.199859] efifb: probing for efifb

[    0.199867] efifb: framebuffer at 0xe0000000, mapped to 0xffffc90000400000, using 3072k, total 3072k

[    0.199871] efifb: mode is 1024x768x32, linelength=4096, pages=1

[    0.199944] efifb: scrolling: redraw

[    0.199947] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
```

----------

## DaggyStyle

 *Marcih wrote:*   

> On my UEFI machine, I've switched from booting using GRUB2 to EFI stub kernel. Everything went swimmingly except for the console resolution. I'm using the proprietary nvidia-drivers, which don't set the console resolution automagically like nouveau does. When using GRUB2, I've worked around this using the GRUB config file.
> 
> In "/etc/default/grub":
> 
> ```
> ...

 

create an efi app that sets the proper mode you want and boot the kernel afterwards and use efibootmgr to set it as the first boot entry

----------

## bammbamm808

Or use the boot manager rEFInd which allows you set the efifb resolution via configuration file. I use it to select efi stub kernels or Windows.

----------

## Marcih

bammbamm808, you mention using rEFInd and DaggyStyle, you say to write an app. If a separate program is capable of doing this, how is it done?

I assume this is not a kernel command line option, what is it? Is it something I can do this in a simple manner (ideally without using extra applications, just booting the stub kernel)?

----------

## DaggyStyle

 *Marcih wrote:*   

> bammbamm808, you mention using rEFInd and DaggyStyle, you say to write an app. If a separate program is capable of doing this, how is it done?
> 
> I assume this is not a kernel command line option, what is it? Is it something I can do this in a simple manner (ideally without using extra applications, just booting the stub kernel)?

 

in general, each uefi bios has GOP defined, GOP stands for Graphical Output Protocol. there can be more than one.

it is assumed that there are at least one which is active, that is the one you seek.

the active GOP has resolution modes which can be set, that is bios dependent. if the bios supports more than 1024x768x32, you can change to it, if not, than that what you get.

you can use this uefi example: https://blog.fpmurphy.com/2015/05/check-available-text-and-graphics-modes-from-uefi-shell.html to find out what supported resolutions there are.

I'd recommend to try and run this example and see if there is higher resolution than 1024x768x32, if there is, look into rEFInd on how to set it

----------

## Marcih

Odd, I tried rEFInd and I still don't get the results I get with GRUB2. I've set "resolution 1920 1080 " in refind.conf, the graphics menu displays in the correct resolution, but a) Linux's console is still in the wrong resolution and b) rEFInd's "textmode" is in a low resolution too...

Advice?  :Confused: 

----------

## charles17

 *Marcih wrote:*   

> My current attempt:
> 
> ```
> $ dmesg | grep efifb
> 
> ...

 

For comparison: *Quote:*   

> $ dmesg | grep efifb 
> 
> [    0.253444] pci 0000:00:02.0: BAR 2: assigned to efifb
> 
> [    0.370145] efifb: probing for efifb
> ...

  *Quote:*   

> $ lspci | grep 00:02.0
> 
> 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
> 
> 

 

----------

## Marcih

 *charles17 wrote:*   

>  *Marcih wrote:*   My current attempt:
> 
> ```
> $ dmesg | grep efifb
> 
> ...

 

Bah, dead end!  :Sad: 

```
$ dmesg | grep efifb

EFI stub only and rEFInd

[    0.190760] efifb: probing for efifb

[    0.190769] efifb: framebuffer at 0xe0000000, mapped to 0xffffc90000400000, using 3072k, total 3072k

[    0.190773] efifb: mode is 1024x768x32, linelength=4096, pages=1

[    0.190776] efifb: scrolling: redraw

[    0.190778] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0

GRUB2

[    0.197737] efifb: probing for efifb

[    0.197745] efifb: framebuffer at 0xe0000000, mapped to 0xffffc90001000000, using 8640k, total 8640k

[    0.197750] efifb: mode is 1920x1080x32, linelength=8192, pages=1

[    0.197752] efifb: scrolling: redraw

[    0.197755] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
```

----------

## Marcih

Found the solution. I have an ASUS motherboard, which has the usual splash screen with "Press Del to enter setup" kind of thing. This seems to be somehow tied to the EFI FB - most of the time it displays in an ugly, stretched 1024x768.

In older firmware revisions, the way to get it set to the (I assume) native resolution of the screen would be to disable CSM and set the "Boot logo" setting (in "Boot options") to "Full Screen" (default is "Auto"). This changed in the most recent firmware update; you now need to leave it at "Auto", "Full Screen" sets the FB's resolution to 1024x768, which carries over when Linux boots.

I can now boot an EFI stub kernel and have the Linux console's resolution be full HD. Thanks for everybody's suggestions!  :Smile: 

----------

## dantrell

 *Marcih wrote:*   

> I have an ASUS motherboard [...]

 

I have two generations of ASUS motherboards.

In addition to almost everything here, I had to enable Above 4G Decoding which is off by default on the older one but enabled by default on the newer one with a recent BIOS update.

Without that, I was capped to 1024x768x32.

----------

