Skip to contentSkip to conversation

VESAFB CUSTOM RESOLUTION

DISCUSSION Al Boldi 4 participants 10 messages Jul 18, 2007

lore
Share & tools
lore

Al Boldi

author
#0 lore raw
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Sasa Ostrouska

Daniel you seem to be right, as till now, no one of those solutions for me worked, I always end up or with a non recognised option or a small square 640x480 pixels where I see the console. I need to try still the vbetest thing what Mr. Daplas proposed.

Quoted 6 lines
Quoted 3 lines

In any case this laptop has an screen of 16:10 aspect ratio and I belive would be good
to have those modes in the vesafb driver.

There are no modes in the vesafb driver. The vesafb driver uses the video mode that was set by the BIOS before starting Linux.

I have a similar problem with an onboard VIA-UniChrome chip, driven through an out-of-tree vendor-supplied driver just to get 85Hz refresh. Other than the pain of maintaining this driver out-of-tree, I have to contend with a 50% speed reduction compared to vesafb.

vesafb is probably the most important display driver for compatibility reasons, and as such should support a large range of functionality.

Is there any technical reason why vesafb shouldn't support non-BIOS modes?

Thanks!

--
Al

#1 lore raw
Quoted 4 lines · Al Boldi
Quoted 1 line · Geert Uytterhoeven

On Wed, 18 Jul 2007, Sasa Ostrouska wrote:

Is there any technical reason why vesafb shouldn't support non-BIOS modes?

vesafb can only use modes included by the vendor in the card's BIOS. The mode table contains standard modes defined by VESA, and perhaps vendor-defined custom modes. However, the mode ID of custom modes varies from card to card, so you have to 'probe' the BIOS first for the list of modes and their associated ID. X + the 'vesa' driver does that probe, and so does the lrmi tool vbetest.

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Tony

author
#2 lore raw
Quoted 14 lines · Antonino A. Daplas
Quoted 5 lines · Al Boldi
Quoted 1 line · Geert Uytterhoeven

On Wed, 18 Jul 2007, Sasa Ostrouska wrote:

Is there any technical reason why vesafb shouldn't support non-BIOS modes?

vesafb can only use modes included by the vendor in the card's BIOS. The mode table contains standard modes defined by VESA, and perhaps vendor-defined custom modes. However, the mode ID of custom modes varies from card to card, so you have to 'probe' the BIOS first for the list of modes and their associated ID. X + the 'vesa' driver does that probe, and so does the lrmi tool vbetest.

Quoted 4 lines

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Thanks for a great explanation!

Looks like this chip supports VBE 3.0, but it only locks into 60Hz refresh. Here is an excerpt; full log attached.

Thanks!

============================
(II) Loading sub module "vbe"
(II) LoadModule: "vbe"
(II) Loading /usr/X11R6/lib/modules/libvbe.a
(II) Module vbe: vendor="The XFree86 Project"

	compiled for 4.3.0, module version = 1.1.0
	ABI class: XFree86 Video Driver, version 0.6

(II) Loading sub module "int10"
(II) LoadModule: "int10"
(II) Loading /usr/X11R6/lib/modules/linux/libint10.a (II) Module int10: vendor="The XFree86 Project"

	compiled for 4.3.0, module version = 1.0.0
	ABI class: XFree86 Video Driver, version 0.6

(II) VESA(0): initializing int10
(II) VESA(0): Primary V_BIOS segment is: 0xc000
(II) VESA(0): VESA BIOS detected
(II) VESA(0): VESA VBE Version 3.0
(II) VESA(0): VESA VBE Total Mem: 16384 kB
(II) VESA(0): VESA VBE OEM: VIA P4M800 PRO

(II) VESA(0): VESA VBE OEM Software Rev: 1.0 (II) VESA(0): VESA VBE OEM Vendor:
(II) VESA(0): VESA VBE OEM Product:
(II) VESA(0): VESA VBE OEM Product Rev:
(**) VESA(0): Depth 16, (--) framebuffer bpp 16 (==) VESA(0): RGB weight 565
(==) VESA(0): Default visual is TrueColor (==) VESA(0): Using gamma correction (1.0, 1.0, 1.0) (II) Loading sub module "ddc"
(II) LoadModule: "ddc"
(II) Loading /usr/X11R6/lib/modules/libddc.a (II) Module ddc: vendor="The XFree86 Project"

	compiled for 4.3.0, module version = 1.0.0
	ABI class: XFree86 Video Driver, version 0.6

(II) VESA(0): VESA VBE DDC supported
(II) VESA(0): VESA VBE DDC Level 2
(II) VESA(0): VESA VBE DDC transfer in appr. 1 sec.
(II) VESA(0): VESA VBE DDC read successfully
(II) VESA(0): Manufacturer: API Model: 9805 Serial#: 1209 (II) VESA(0): Year: 2002 Week: 8
(II) VESA(0): EDID Version: 1.3
(II) VESA(0): Analog Display Input, Input Voltage Level: 0.700/0.300 V (II) VESA(0): Sync: Separate
(II) VESA(0): Max H-Image Size [cm]: horiz.: 31 vert.: 23 (II) VESA(0): Gamma: 2.90
(II) VESA(0): DPMS capabilities: StandBy Suspend Off; RGB/Color Display (II) VESA(0): First detailed timing is preferred mode
(II) VESA(0): redX: 0.645 redY: 0.320 greenX: 0.273 greenY: 0.593
(II) VESA(0): blueX: 0.143 blueY: 0.063 whiteX: 0.282 whiteY: 0.297
(II) VESA(0): Supported VESA Video Modes:
(II) VESA(0): 720x400@70Hz
(II) VESA(0): 640x480@60Hz
(II) VESA(0): 640x480@72Hz
(II) VESA(0): 640x480@75Hz
(II) VESA(0): 800x600@56Hz
(II) VESA(0): 800x600@60Hz
(II) VESA(0): 800x600@72Hz
(II) VESA(0): 800x600@75Hz
(II) VESA(0): 1024x768@60Hz
(II) VESA(0): 1024x768@70Hz
(II) VESA(0): 1024x768@75Hz
(II) VESA(0): 1280x1024@75Hz
(II) VESA(0): Manufacturer's mask: 0
(II) VESA(0): Supported Future Video Modes:
(II) VESA(0): #0: hsize: 800 vsize 600 refresh: 85 vid: 22853

(II) VESA(0): #1: hsize: 1024  vsize 768  refresh: 85  vid: 22881
(II) VESA(0): #2: hsize: 1600  vsize 1200  refresh: 60  vid: 16553
(II) VESA(0): #3: hsize: 1600  vsize 1200  refresh: 65  vid: 17833

(II) VESA(0): Supported additional Video Mode:
(II) VESA(0): clock: 94.5 MHz Image Size: 310 x 230 mm
(II) VESA(0): h_active: 1024 h_sync: 1072 h_sync_end 1168 h_blank_end 1376
h_border: 0
(II) VESA(0): v_active: 768 v_sync: 769 v_sync_end 772 v_blanking: 808
v_border: 0
(II) VESA(0): Monitor name: Acer G781
(II) VESA(0): Serial No: 01209
(II) VESA(0): Ranges: V min: 50 V max: 120 Hz, H min: 30 H max: 86 kHz, PixClock max 130 MHz
:
:
(II) VESA(0): Total Memory: 256 64KB banks (16384kB)
(II) VESA(0): monitor1: Using hsync range of 30.00-86.00 kHz (II) VESA(0): monitor1: Using vrefresh range of 50.00-120.00 Hz (II) VESA(0): Not using built-in mode "1600x1200" (width too large for virtual size)
(II) VESA(0): Not using built-in mode "1280x1024" (width too large for virtual size)
(--) VESA(0): Virtual size is 1024x768 (pitch 1024)
(**) VESA(0): *Built-in mode "1024x768"
(**) VESA(0): *Built-in mode "800x600"
(**) VESA(0): *Built-in mode "640x480"
(--) VESA(0): Display dimensions: (310, 230) mm
(--) VESA(0): DPI set to (83, 84)
(II) VESA(0): Attempting to use 85Hz refresh for mode "1024x768" (117) (II) VESA(0): Attempting to use 85Hz refresh for mode "800x600" (114) (II) VESA(0): Attempting to use 85Hz refresh for mode "640x480" (111) (**) VESA(0): Using "Shadow Framebuffer"
(II) Loading sub module "shadow"
(II) LoadModule: "shadow"
(II) Loading /usr/X11R6/lib/modules/libshadow.a
(II) Module shadow: vendor="The XFree86 Project"

	compiled for 4.3.0, module version = 1.0.0
	ABI class: XFree86 ANSI C Emulation, version 0.2

(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/X11R6/lib/modules/libfb.a
(II) Module fb: vendor="The XFree86 Project"

	compiled for 4.3.0, module version = 1.0.0
	ABI class: XFree86 ANSI C Emulation, version 0.2

(II) do I need RAC? No, I don't.
:
:
(II) LoadModule: "int10"
(II) Reloading /usr/X11R6/lib/modules/linux/libint10.a (II) VESA(0): initializing int10
(II) VESA(0): Primary V_BIOS segment is: 0xc000 (II) VESA(0): VESA BIOS detected
(II) VESA(0): VESA VBE Version 3.0
(II) VESA(0): VESA VBE Total Mem: 16384 kB (II) VESA(0): VESA VBE OEM: VIA P4M800 PRO

(II) VESA(0): VESA VBE OEM Software Rev: 1.0
(II) VESA(0): VESA VBE OEM Vendor:
(II) VESA(0): VESA VBE OEM Product:
(II) VESA(0): VESA VBE OEM Product Rev:
(==) VESA(0): Write-combining range (0xf4000000,0x1000000) (II) VESA(0): virtual address = 0xb6d7f000,

	physical address = 0xf4000000, size = 16777216

(II) VESA(0): VBESetVBEMode failed...Tried again without customized values.

--
Al

#3 lore raw
Quoted 20 lines · Al Boldi
Quoted 14 lines · Antonino A. Daplas
Quoted 5 lines · Al Boldi
Quoted 1 line · Geert Uytterhoeven

On Wed, 18 Jul 2007, Sasa Ostrouska wrote:

Is there any technical reason why vesafb shouldn't support non-BIOS modes?

vesafb can only use modes included by the vendor in the card's BIOS. The mode table contains standard modes defined by VESA, and perhaps vendor-defined custom modes. However, the mode ID of custom modes varies from card to card, so you have to 'probe' the BIOS first for the list of modes and their associated ID. X + the 'vesa' driver does that probe, and so does the lrmi tool vbetest.

Quoted 4 lines

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Quoted 6 lines

Thanks for a great explanation!

Looks like this chip supports VBE 3.0, but it only locks into 60Hz refresh. Here is an excerpt; full log attached.

What you need to look at the X log is this particular part (this is the output of my card, and for the sake of brevity, I removed the descriptive sections):

Mode: 100 (640x400)
Mode: 101 (640x480)
Mode: 102 (800x600)
Mode: 103 (800x600)
Mode: 104 (1024x768)
Mode: 105 (1024x768)
Mode: 106 (1280x1024)
Mode: 107 (1280x1024)
*Mode: 10e (320x200)
Mode: 10f (320x200)
*Mode: 111 (640x480)
Mode: 112 (640x480)
*Mode: 114 (800x600)
Mode: 115 (800x600)
*Mode: 117 (1024x768)
Mode: 118 (1024x768)
Mode: 11a (1280x1024)
Mode: 11b (1280x1024)
Mode: 130 (320x200)
Mode: 131 (320x400)
*Mode: 132 (320x400)
Mode: 133 (320x400)
Mode: 134 (320x240)
*Mode: 135 (320x240)
Mode: 136 (320x240)
*Mode: 13d (640x400)
Mode: 13e (640x400)
Mode: 145 (1600x1200)
Mode: 146 (1600x1200)
Mode: 147 (1400x1050)
Mode: 148 (1400x1050)
Mode: 152 (2048x1536)

The list of modes include standard VESA modes and custom modes such as 2048x1536. So, if I want to use this mode for vesafb, I will add vga=0x352 (0x152 + 0x200) to my boot line.

Tony

author
#4 lore raw
Quoted 21 lines · Antonino A. Daplas
Quoted 20 lines · Al Boldi
Quoted 18 lines · Antonino A. Daplas
Quoted 5 lines · Al Boldi
Quoted 1 line · Geert Uytterhoeven

On Wed, 18 Jul 2007, Sasa Ostrouska wrote:

Is there any technical reason why vesafb shouldn't support non-BIOS modes?

vesafb can only use modes included by the vendor in the card's BIOS. The mode table contains standard modes defined by VESA, and perhaps vendor-defined custom modes. However, the mode ID of custom modes varies from card to card, so you have to 'probe' the BIOS first for the list of modes and their associated ID. X + the 'vesa' driver does that probe, and so does the lrmi tool vbetest.

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Quoted 8 lines
Quoted 4 lines

Thanks for a great explanation!

Looks like this chip supports VBE 3.0, but it only locks into 60Hz refresh. Here is an excerpt; full log attached.

What you need to look at the X log is this particular part (this is the output of my card, and for the sake of brevity, I removed the descriptive sections):

Here are mine; I tried them all, and they always lock into 60Hz refresh.

Mode: 101 (640x480)
Mode: 112 (640x480)
Mode: 103 (800x600)
Mode: 115 (800x600)
Mode: 105 (1024x768)
Mode: 118 (1024x768)
Mode: 179 (1280x768)
Mode: 17b (1280x768)
Mode: 107 (1280x1024)
Mode: 11b (1280x1024)
Mode: 120 (1600x1200)
Mode: 122 (1600x1200)
Mode: 124 (1600x1200)
Mode: 199 (1920x1440)
Mode: 19a (1920x1440)
Mode: 19b (1920x1440)
Mode: 22e (800x480)
Mode: 230 (800x480)
Mode: 108 (80x60)
Mode: 102 (800x600)

What about the VBE 3.0 arbitrary vertical refresh rate thing?

Thanks!

--
Al

#5 lore raw
Quoted 9 lines · Al Boldi
Quoted 6 lines · Antonino A. Daplas
Quoted 5 lines · Al Boldi
Quoted 4 lines · Antonino A. Daplas
Quoted 3 lines · Al Boldi
Quoted 1 line · Geert Uytterhoeven

On Wed, 18 Jul 2007, Sasa Ostrouska wrote:

What about the VBE 3.0 arbitrary vertical refresh rate thing?

This is not implemented by the video-vesa.c because it will require complex calculations of mode timings (such as with GTF) to be done before starting the kernel. However, uvesafb probably does.

Tony

#6 lore raw
Quoted 7 lines · Antonino A. Daplas
Quoted 2 lines

What about the VBE 3.0 arbitrary vertical refresh rate thing?

This is not implemented by the video-vesa.c because it will require complex calculations of mode timings (such as with GTF) to be done before starting the kernel. However, uvesafb probably does.

There is no real reason video-vesa.c couldn't do those calculations, but it would have to get the information from the command line proper and not just from the 16-bit vga= mode number. That is a minor complication, but not significant (the new setup code has a proper command line parser.)

The desirability of it is another matter, especially since it wouldn't let any switching happen at runtime.

-hpa

#7 lore raw
Quoted 9 lines · H. Peter Anvin
Quoted 7 lines · Antonino A. Daplas
Quoted 2 lines

What about the VBE 3.0 arbitrary vertical refresh rate thing?

This is not implemented by the video-vesa.c because it will require complex calculations of mode timings (such as with GTF) to be done before starting the kernel. However, uvesafb probably does.

Quoted 8 lines

There is no real reason video-vesa.c couldn't do those calculations, but it would have to get the information from the command line proper and not just from the 16-bit vga= mode number. That is a minor complication, but not significant (the new setup code has a proper command line parser.)

The desirability of it is another matter, especially since it wouldn't let any switching happen at runtime.

Yes, it's a lot of extra code that will be used only once, I would rather not have it in the setup code. It's more appropriate for uvesafb to implement that functionality.

Tony

#8 lore raw
In reply to Antonino A. Daplas
Quoted 4 lines · Antonino A. Daplas

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Theoretically, not correct. VBE 3.0 allows arbitrary mode setting - not only vertical refresh, but all mode parameters (the ones appearing in X modelines). This is supported by both svgalib and uvesafb. I don't know on how many VBE3 cards this feature really works, but it does work for some cards.

Signature · 1 line
Matan Ziv-Av.                         [email protected]
#9 lore raw
Quoted 7 lines · Matan Ziv-Av
Quoted 4 lines · Antonino A. Daplas

So, one cannot just set any mode, unless that mode is already defined in the BIOS mode table. In VBE 3.0, you might be able to choose an arbitrary vertical refresh rate, but that's the best mode tuning you can do with the video BIOS.

Quoted 5 lines

Theoretically, not correct. VBE 3.0 allows arbitrary mode setting - not only vertical refresh, but all mode parameters (the ones appearing in X modelines). This is supported by both svgalib and uvesafb. I don't know on how many VBE3 cards this feature really works, but it does work for some cards.

The CRTCInfoBlock structure passed for Function 0x4f02 does not include xres and yres so the horizontal and vertical active lengths cannot be modified arbitrarily, an appropriate mode ID must still be chosen. I cannot set 880x244, for example, if it's not in the table. It's the horizontal timings, the vertical timings and the pixelclock that can be adjusted.

Tony