# Uvesafb wrong resolution

## jvmnck

I did all uvesafb installation procedure. http://dev.gentoo.org/~spock/projects/uvesafb/

However with this grub boot line:

```

kernel /boot/kernel-3.2.12-gentoo root=/dev/sda8 rootfstype=ext4 splash=silent video=uvesafb:1024x768-32,mtrr:3,ywrap

```

I my lcd monitors show a true resolution of 1280x768

Any ideas of what is wrong ? may be klibc needs to be reemerge?  :Confused: 

Thanks in advance.

----------

## VinzC

What kind of video card do you have? Guessing... an nVidia?  :Wink: 

----------

## jvmnck

 *VinzC wrote:*   

> What kind of video card do you have? Guessing... an nVidia? 

 

Yep, an Nvidia Geforce FX5200.

----------

## Gusar

What do you mean by "a true resolution"? What's the resolution of your display? And how is it configured to deal with non-native resolutions?

----------

## jvmnck

 *Gusar wrote:*   

> What do you mean by "a true resolution"? What's the resolution of your display? And how is it configured to deal with non-native resolutions?

 

Well, my output device, via vga, is an lcd "ssg" P2370MS with a max resolution of 1920x1080, it has "info" feature that indicates the current image resolution. 

1)when i power up the machine  (and a logo from "cq" appears), info indicates a 700x400.

2)when grub starts, info indicates a 640x480.

3)when gentoo starts booting (the very first) it also says 640x480

4)when uvesafb starts, it changes to 1280x768 (but i set mode 1024x768, and here is my problem).

5)and finally when gdm starts it goes to 1920x1080.

----------

## Gusar

Hmm, weird. Check which resolutions are available with

```
cat /sys/class/graphics/fb0/modes
```

or maybe it's

```
cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes
```

Though 1024x768 should be there, you never know. Also, what's the chance that the info thingy is wrong?

----------

## jvmnck

The output:

```
$ cat /sys/class/graphics/fb0/modes

U:1024x768p-75

U:640x480p-67

V:1600x1200p-60

V:1280x1024p-75

V:1280x1024p-60

V:1024x768p-75

V:1024x768p-70

V:1024x768p-60

V:800x600p-75

V:800x600p-72

V:800x600p-60

V:800x600p-56

V:640x480p-72

V:640x480p-60

U:2048x1536p-60

U:1400x1050p-59

U:1600x1200p-60

U:320x240p-60

U:320x400p-59

U:320x200p-59

U:1280x1024p-59

U:1024x768p-60

U:800x600p-59

U:640x480p-60

U:640x400p-59

$ cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes

640x400-8, 0x0100

640x480-8, 0x0101

800x600-8, 0x0103

1024x768-8, 0x0105

1280x1024-8, 0x0107

320x200-16, 0x010e

320x200-32, 0x010f

640x480-16, 0x0111

640x480-32, 0x0112

800x600-16, 0x0114

800x600-32, 0x0115

1024x768-16, 0x0117

1024x768-32, 0x0118

1280x1024-16, 0x011a

1280x1024-32, 0x011b

320x200-8, 0x0130

320x400-8, 0x0131

320x400-16, 0x0132

320x400-32, 0x0133

320x240-8, 0x0134

320x240-16, 0x0135

320x240-32, 0x0136

640x400-16, 0x013d

640x400-32, 0x013e

1600x1200-8, 0x0145

1600x1200-16, 0x0146

1400x1050-8, 0x0147

1400x1050-16, 0x0148

2048x1536-32, 0x0152

```

So its there...

About the info thingy, dunno ("ssg" doesn't say anything about accuracy), if it is wrong it would be the first time, since I tested with:

cp(vga) uvesafb 800x600 fine

cp(vga) uvesafb 1920x1080 fine

cp(vga) uvesafb 1024x768, 1280x720 wrong

cp(vga) gnome many_res fine

cp(vga) windows xp many_res fine

ps3(hdmi) xmb many_res fine

----------

## VinzC

In some sense, that's why I asked if you had an nVidia. I for one *never* (except once) succeeded in making uvesafb use the native resolution of my monitors. Only once the monitor was a Philips and the graphics card a GeForce 8800GTS IIRC. Only at that time could I use the native resolution 1680x1050. Once I changed the monitor to a Dell (1920x1080) the system fell back to 1280x1024.

I never bothered as even distorted on a wide screen 1280x1024 is enough for me. My guess is NVidia cards don't play well with custom VESA modes. EDIT: 640x480 with Grub is also quite normal as it's the biggest standard mode that it supports.

----------

## Gusar

 *VinzC wrote:*   

> My guess is NVidia cards don't play well with custom VESA modes.

 

It's not just Nvidia. And the thing is, why would they need to? Why bother programming custom resolutions into the VBIOS, when the operating system will use native modesetting anyway? VESA is legacy, nothing more, it's not meant to actually be used as primary means of modesetting.

----------

## VinzC

 *Gusar wrote:*   

> And the thing is, why would they need to? Why bother programming custom resolutions into the VBIOS, when the operating system will use native modesetting anyway? VESA is legacy, nothing more, it's not meant to actually be used as primary means of modesetting.

 

If only nVidia driver allowed for mode setting... Does it at all BTW? It didn't the last time I checked.

----------

## Gusar

 *VinzC wrote:*   

> If only nVidia driver allowed for mode setting... Does it at all BTW?

 

Of course it does, you wouldn't get native resolutions in X otherwise. What it lacks is a fbcon driver. KMS drivers have a built-in fbcon driver. But nvidia only cares about X, so there's no fbcon driver in their module.

----------

## jvmnck

 *Gusar wrote:*   

>  *VinzC wrote:*   If only nVidia driver allowed for mode setting... Does it at all BTW? 
> 
> Of course it does, you wouldn't get native resolutions in X otherwise. What it lacks is a fbcon driver. KMS drivers have a built-in fbcon driver. But nvidia only cares about X, so there's no fbcon driver in their module.

 

So as long i have an nvidia card, fb resolutions are out of my control?

If yes, I think that solves my question.

Thanks to VinzC and to Gusar   :Twisted Evil:   :Embarassed:   :Twisted Evil: 

See you.

----------

## Gusar

 *jvmnck wrote:*   

> So as long i have an nvidia card, fb resolutions are out of my control?

 

You can use resolutions that are in the vbios of your card. Now you *do* have 1024x768 in there, so you should be able to use it, I have no idea what crazy quirk you're affected by. One thing you can try is vesafb instead of uvesafb. Compile vesafb into the kernel, then:

```
video=vesafb:mtrr:3,ywrap vga=0x0118
```

----------

