# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/22 15:44:23+01:00 spock@spock.one.pl # Fixed compilation warnings (remap_page_range -> io_remap_page_range). # # drivers/video/vesafb-thread.c # 2004/11/22 15:44:08+01:00 spock@spock.one.pl +2 -2 # Fixed compilation warnings (remap_page_range -> io_remap_page_range). # # ChangeSet # 2004/11/21 14:18:54+01:00 spock@spock.one.pl # Only use fb_get_options() if vesafb-tng is compiled into the kernel. # # drivers/video/vesafb-tng.c # 2004/11/21 14:15:09+01:00 spock@spock.one.pl +4 -2 # Only use fb_get_options() if vesafb-tng is compiled into the kernel. # # ChangeSet # 2004/11/21 10:52:50+01:00 spock@spock.one.pl # Merge spock.one.pl:/devel/kernel/linux-2.5 # into spock.one.pl:/devel/kernel/linux-vesafb-tng # # drivers/video/fbmem.c # 2004/11/21 10:52:33+01:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/11/01 19:28:20+01:00 spock@spock.one.pl # Fixed partially broken mode-matching code. # # drivers/video/vesafb-tng.c # 2004/11/01 19:10:52+01:00 spock@spock.one.pl +18 -7 # Fixed partially broken mode-matching code. # # ChangeSet # 2004/11/01 19:06:12+01:00 spock@spock.one.pl # Merge # # drivers/video/fbmem.c # 2004/11/01 19:06:10+01:00 spock@spock.one.pl +0 -0 # SCCS merged # # drivers/video/Makefile # 2004/10/30 21:23:36+02:00 spock@spock.one.pl +0 -0 # Auto merged # # drivers/video/Kconfig # 2004/10/30 21:23:35+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/10/28 19:02:21+02:00 spock@spock.one.pl # Added a fix for yres_virtual. # # drivers/video/vesafb-tng.c # 2004/10/28 19:02:09+02:00 spock@spock.one.pl +6 -2 # Added a fix for yres_virtual. # # ChangeSet # 2004/10/28 00:34:25+02:00 spock@spock.one.pl # Merged changes from vesafb (vram_remap, vram_total). # # drivers/video/vesafb-tng.c # 2004/10/28 00:34:12+02:00 spock@spock.one.pl +66 -24 # Merged changes from vesafb (vram_remap, vram_total). # # ChangeSet # 2004/10/28 00:25:27+02:00 spock@spock.one.pl # Merge spock.one.pl:/devel/kernel/linux-2.5 # into spock.one.pl:/devel/kernel/linux-vesafb-tng # # drivers/video/fbmem.c # 2004/10/28 00:25:12+02:00 spock@spock.one.pl +0 -0 # Auto merged # # drivers/video/Kconfig # 2004/10/28 00:25:12+02:00 spock@spock.one.pl +0 -0 # Auto merged # # arch/i386/boot/video.S # 2004/10/28 00:25:12+02:00 spock@spock.one.pl +0 -0 # Auto merged # # Documentation/fb/vesafb.txt # 2004/10/28 00:25:12+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/10/21 22:19:02+02:00 spock@spock.one.pl # Added automatic selection of FB_MODE_HELPERS. # # drivers/video/Kconfig # 2004/10/21 22:18:49+02:00 spock@spock.one.pl +1 -0 # Added automatic selection of FB_MODE_HELPERS. # # ChangeSet # 2004/10/18 16:24:05+02:00 spock@spock.one.pl # Merge spock.one.pl:/devel/kernel/linux-2.5 # into spock.one.pl:/devel/kernel/linux-vesafb-tng # # drivers/video/Kconfig # 2004/10/18 16:23:59+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/09/30 16:33:03+02:00 spock@spock.one.pl # Changed the code to reflect changes in fb_get_options' behaviour. # # drivers/video/vesafb-tng.c # 2004/09/30 16:19:46+02:00 spock@spock.one.pl +3 -1 # Changed to reflect changes in fb_get_options' behaviour. # # ChangeSet # 2004/09/30 16:14:04+02:00 spock@spock.one.pl # Resolved makefile conflicts. # # drivers/video/Makefile # 2004/09/30 16:13:51+02:00 spock@spock.one.pl +17 -1 # Fixed makefile. # # drivers/video/fbmem.c # 2004/09/30 16:07:32+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/09/15 16:47:57+02:00 spock@spock.one.pl # Moved module_init() call to make the driver work with the new fb init code. # # drivers/video/vesafb-tng.c # 2004/09/15 16:47:46+02:00 spock@spock.one.pl +2 -1 # Moved module_init() call to make the driver work with the new fb init code. # # ChangeSet # 2004/09/14 19:46:14+02:00 spock@spock.one.pl # Merged minor changes. # # drivers/video/vesafb-tng.c # 2004/09/14 19:12:58+02:00 spock@spock.one.pl +1 -0 # Merged minor changes. # # ChangeSet # 2004/09/14 19:03:28+02:00 spock@spock.one.pl # Resolved vesafb-tng conflicts. # # drivers/video/fbmem.c # 2004/09/14 19:03:19+02:00 spock@spock.one.pl +6 -0 # Resolved vesafb-tng conflicts. # # drivers/video/Makefile # 2004/09/14 19:03:19+02:00 spock@spock.one.pl +17 -1 # Resolved vesafb-tng conflicts. # # ChangeSet # 2004/09/10 22:06:10+02:00 spock@spock.one.pl # Removed info about 'used hacks' from the docs. # TAG: vesafb-tng-0.9-rc4-r3 # # Documentation/fb/vesafb.txt # 2004/09/10 22:05:53+02:00 spock@spock.one.pl +3 -11 # Removed info about 'used hacks' from the docs. # # ChangeSet # 2004/09/10 21:17:52+02:00 spock@spock.one.pl # Removed the code for copying OEM data from RAM. # # drivers/video/vesafb-thread.c # 2004/09/10 21:17:37+02:00 spock@spock.one.pl +5 -14 # Removed the code for copying OEM data from RAM. # # ChangeSet # 2004/09/10 20:11:45+02:00 spock@spock.one.pl # Changed the VBE mode matching and mode setting logic. Cleaned up the code. # # drivers/video/vesafb-tng.c # 2004/09/10 20:11:36+02:00 spock@spock.one.pl +252 -242 # Changed the VBE mode matching and mode setting logic. Cleaned up the code. # # ChangeSet # 2004/09/09 16:48:42+02:00 spock@spock.one.pl # Merge spock.one.pl:/devel/kernel/linux-2.5 # into spock.one.pl:/devel/kernel/linux-vesafb-tng # # drivers/video/fbmem.c # 2004/09/09 16:48:36+02:00 spock@spock.one.pl +0 -0 # Auto merged # # drivers/video/Makefile # 2004/09/09 16:48:36+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/08/24 23:02:56+02:00 spock@spock.one.pl # Merge spock.one.pl:/devel/kernel/linux-2.5 # into spock.one.pl:/devel/kernel/linux-vesafb-tng # # drivers/video/fbmem.c # 2004/08/24 23:02:46+02:00 spock@spock.one.pl +0 -0 # Auto merged # # drivers/video/Makefile # 2004/08/24 23:02:46+02:00 spock@spock.one.pl +0 -0 # Auto merged # # drivers/video/Kconfig # 2004/08/24 23:02:45+02:00 spock@spock.one.pl +0 -0 # Auto merged # # arch/i386/boot/video.S # 2004/08/24 23:02:45+02:00 spock@spock.one.pl +0 -0 # Auto merged # # ChangeSet # 2004/08/24 11:18:50+02:00 spock@spock.one.pl # Updated the docs, fixed a minor bug with maxclk, add the code to switch the DAC palette format to 8 bit. # TAG: vesafb-tng-0.9-rc4-r1 # # drivers/video/vesafb-tng.c # 2004/08/24 11:18:42+02:00 spock@spock.one.pl +48 -19 # Added the code to switch DAC palette format to 8bit in 256 color modes. Changes 'forward-ported' from vesafb. # Fixed a type which caused maxpixclock to be set to 0 in some cases. # # include/video/vesa.h # 2004/08/23 17:13:30+02:00 spock@spock.one.pl +1 -0 # Added the CAP_CAN_SWITCH_DAC constant. # # Documentation/fb/vesafb.txt # 2004/08/23 16:42:35+02:00 spock@spock.one.pl +4 -0 # Added a hint about vbemode and nocrtc no the docs. # # ChangeSet # 2004/08/23 16:16:51+02:00 spock@spock.one.pl # Fixed a stupid bit-logic problem ('do not clear the screen' bit set instead of 'use linear framebuffer'), fixed Makefile and Kconfig. # # drivers/video/Kconfig # 2004/08/23 16:16:35+02:00 spock@spock.one.pl +1 -1 # Changed Kconfig to not allow to choose vesafb-tng on x86_64 systems. # # drivers/video/Makefile # 2004/08/23 16:11:41+02:00 spock@spock.one.pl +14 -13 # Fixed a bug in the Makefile that caused vesafb to be built even if CONFIG_FB_VESA was set to 'n'. # # BitKeeper/etc/config # 2004/08/19 00:20:28+02:00 spock@spock.one.pl +2 -3 # Changed configuration settings for vesafb-tng # # BitKeeper/etc/logging_ok # 2004/08/19 00:10:17+02:00 spock@spock.one.pl +0 -6 # Removed all entries # # drivers/video/vesafb-tng.c # 2004/08/18 23:35:52+02:00 spock@spock.one.pl +1 -5 # Fixed the LFB bit problem (D15 was set instead of D14). # # ChangeSet # 2004/08/18 23:33:08+02:00 spock@spock.one.pl # Merged vesafb-tng-0.9-rc4 # # drivers/video/fbmem.c # 2004/08/18 23:32:56+02:00 spock@spock.one.pl +4 -1 # Merged vesafb-tng-0.9-rc4 # # drivers/video/Makefile # 2004/08/18 23:32:56+02:00 spock@spock.one.pl +18 -1 # Merged vesafb-tng-0.9-rc4 # # drivers/video/Kconfig # 2004/08/18 23:32:56+02:00 spock@spock.one.pl +42 -1 # Merged vesafb-tng-0.9-rc4 # # arch/i386/boot/video.S # 2004/08/18 23:32:56+02:00 spock@spock.one.pl +10 -2 # Merged vesafb-tng-0.9-rc4 # # Documentation/fb/vesafb.txt # 2004/08/18 23:30:19+02:00 spock@spock.one.pl +171 -62 # # include/video/vesa.h # 2004/08/18 23:29:33+02:00 spock@spock.one.pl +125 -0 # # include/video/vesa.h # 2004/08/18 23:29:33+02:00 spock@spock.one.pl +0 -0 # BitKeeper file /devel/kernel/linux-vesafb-tng/include/video/vesa.h # # drivers/video/vesafb-tng.c # 2004/08/18 23:29:22+02:00 spock@spock.one.pl +1124 -0 # # drivers/video/vesafb-tng.c # 2004/08/18 23:29:22+02:00 spock@spock.one.pl +0 -0 # BitKeeper file /devel/kernel/linux-vesafb-tng/drivers/video/vesafb-tng.c # # drivers/video/vesafb-thread.c # 2004/08/18 23:29:21+02:00 spock@spock.one.pl +578 -0 # # drivers/video/vesafb-thread.c # 2004/08/18 23:29:21+02:00 spock@spock.one.pl +0 -0 # BitKeeper file /devel/kernel/linux-vesafb-tng/drivers/video/vesafb-thread.c # diff -Nru a/Documentation/fb/vesafb.txt b/Documentation/fb/vesafb.txt --- a/Documentation/fb/vesafb.txt 2004-11-22 15:45:15 +01:00 +++ b/Documentation/fb/vesafb.txt 2004-11-22 15:45:15 +01:00 @@ -2,16 +2,18 @@ What is vesafb? =============== -This is a generic driver for a graphic framebuffer on intel boxes. +Vesafb is a generic framebuffer driver for x86 and x86_64 boxes. -The idea is simple: Turn on graphics mode at boot time with the help -of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k -(and other) ports do. - -This means we decide at boot time whenever we want to run in text or -graphics mode. Switching mode later on (in protected mode) is -impossible; BIOS calls work in real mode only. VESA BIOS Extensions -Version 2.0 are required, because we need a linear frame buffer. +VESA BIOS Extensions Version 2.0 are required, because we need a linear +frame buffer. VBE 3.0 is required if you want to use modes with a higher +(than the standard 60Hz) refresh rate. + +The VESA framebuffer driver comes in two flavors - the standard vesafb +and vesafb-tng. Vesafb-tng is available only on 32-bit x86 due to the +technology it uses (vm86). Vesafb-tng has more features than vesafb +(adjusting the refresh rate on VBE3.0-compliant boards, switching the +video mode without rebooting, selecting a mode by providing its +modedb name, and more) but might be unstable on some systems. Advantages: @@ -29,16 +31,27 @@ How to use it? ============== -Switching modes is done using the vga=... boot parameter. Read -Documentation/svga.txt for details. - -You should compile in both vgacon (for text mode) and vesafb (for -graphics mode). Which of them takes over the console depends on -whenever the specified mode is text or graphics. - -The graphic modes are NOT in the list which you get if you boot with -vga=ask and hit return. The mode you wish to use is derived from the -VESA mode number. Here are those VESA mode numbers: +If you are running your system on hardware platform where vm86 is supported +(this is 32-bit x86 only as of the time of writing this document) and you +decide to use vesafb-tng, you can either the driver into the kernel or use it +as a module. The graphic mode you want to use is in both cases specified using +the standard modedb format. + +If your system doesn't support vm86 calls yet (all 64-bit platforms), things +get a little more tricky. Since on such systems you can't do BIOS calls from +protected mode in which kernel runs, you have to decide at boot time whenever +you want to run in text or in graphics mode. Switching mode later on is +impossible. Switching modes is done using the vga=... boot parameter. Read +Documentation/svga.txt for details. Below is a more detailed description of +what to do on systems using the standard vesafb driver. + +You should compile in both vgacon (for text mode) and vesafb (for graphics mode). +Which of them takes over the console depends on whenever the specified mode is +text or graphics. + +The graphic modes are NOT in the list which you get if you boot with vga=ask +and hit return. The mode you wish to use is derived from the VESA mode number. +Here are those VESA mode numbers: | 640x480 800x600 1024x768 1280x1024 ----+------------------------------------- @@ -47,8 +60,7 @@ 64k | 0x111 0x114 0x117 0x11A 16M | 0x112 0x115 0x118 0x11B -The video mode number of the Linux kernel is the VESA mode number plus -0x200. +The video mode number of the Linux kernel is the VESA mode number plus 0x200. Linux_kernel_mode_number = VESA_mode_number + 0x200 @@ -61,10 +73,10 @@ 64k | 0x311 0x314 0x317 0x31A 16M | 0x312 0x315 0x318 0x31B -To enable one of those modes you have to specify "vga=ask" in the -lilo.conf file and rerun LILO. Then you can type in the desired -mode at the "vga=ask" prompt. For example if you like to use -1024x768x256 colors you have to say "305" at this prompt. +To enable one of those modes you have to specify "vga=ask" in the lilo.conf +file and rerun LILO. Then you can type in the desired mode at the "vga=ask" +prompt. For example if you like to use 1024x768x256 colors you have to say +"305" at this prompt. If this does not work, this might be because your BIOS does not support linear framebuffers or because it does not support this mode at all. @@ -77,6 +89,7 @@ 2. Note: Some newer versions of LILO appear to work with those hex values, if you set the 0x in front of the numbers. + X11 === @@ -86,65 +99,73 @@ The X-Server must restore the video mode correctly, else you end up with a broken console (and vesafb cannot do anything about this). +With vesafb-tng chances are that the console will be restored properly +even if the X server messed up the video mode. Refresh rates ============= -There is no way to change the vesafb video mode and/or timings after -booting linux. If you are not happy with the 60 Hz refresh rate, you -have these options: +With VBE3.0 compatible BIOSes and vesafb-tng it is possible to change +the refresh rate either at boot time (by specifying the @ part of +the mode name) or later, using the fbset utility. + +With VBE2.0 there is no way to change the mode timings after booting +Linux. If you are not happy with the 60 Hz refresh rate, you have +these options: - * configure and load the DOS-Tools for your the graphics board (if - available) and boot linux with loadlin. + * configure and load the DOS tools for your the graphics board (if + available) and boot Linux with loadlin. * use a native driver (matroxfb/atyfb) instead if vesafb. If none is available, write a new one! - * VBE 3.0 might work too. I have neither a gfx board with VBE 3.0 - support nor the specs, so I have not checked this yet. + * use a BIOS editor to change the default refresh rate (such an + editor does exist at least for ATI Radeon BIOSes). + * if you're running a non-vm86 and VBE3.0-compatible system, you can + use a kernel patch to hard-code some mode timings in the kernel and + use these while setting the graphic mode at boot time. Configuration ============= -The VESA BIOS provides protected mode interface for changing -some parameters. vesafb can use it for palette changes and -to pan the display. It is turned off by default because it -seems not to work with some BIOS versions, but there are options -to turn it on. - -You can pass options to vesafb using "video=vesafb:option" on -the kernel command line. Multiple options should be separated -by comma, like this: "video=vesafb:ypan,invers" - -Accepted options: - -invers no comment... - -ypan enable display panning using the VESA protected mode - interface. The visible screen is just a window of the +The VESA BIOS provides protected mode interface for changing some parameters. +vesafb can use it for palette changes and to pan the display. It is turned +off by default because it seems not to work with some BIOS versions, but there +are options to turn it on. + +You can pass options to vesafb using "video=vesafb:option" on the kernel +command line. Multiple options should be separated by comma, like this: +"video=vesafb:ypan,1024x768-32@85" + +Accepted options (both vesafb and vesafb-tng): + +ypan Enable display panning using the VESA protected mode + interface or vm86 calls. The visible screen is just a window of the video memory, console scrolling is done by changing the start of the window. pro: * scrolling (fullscreen) is fast, because there is no need to copy around data. - * You'll get scrollback (the Shift-PgUp thing), + * you'll get scrollback (the Shift-PgUp thing), the video memory can be used as scrollback buffer - kontra: * scrolling only parts of the screen causes some + con: * scrolling only parts of the screen causes some ugly flicker effects (boot logo flickers for example). -ywrap Same as ypan, but assumes your gfx board can wrap-around - the video memory (i.e. starts reading from top if it - reaches the end of video memory). Faster than ypan. - -redraw scroll by redrawing the affected part of the screen, this - is the safe (and slow) default. +ywrap Same as ypan, but assumes your gfx board can wrap-around the video + memory (i.e. starts reading from top if it reaches the end of video + memory). Faster than ypan. +redraw Scroll by redrawing the affected part of the screen, this is the + safe (and slow) default. -vgapal Use the standard vga registers for palette changes. +vgapal Use the standard VGA registers for palette changes. This is the default. + pmipal Use the protected mode interface for palette changes. -mtrr setup memory type range registers for the vesafb framebuffer. +mtrr Setup memory type range registers for the vesafb framebuffer. + +nomtrr Do not use memory type range registers for vesafb. vremap:n remap 'n' MiB of video RAM. If 0 or not specified, remap memory @@ -156,12 +177,96 @@ if the video BIOS of your card incorrectly determines the total amount of video RAM, use this option to override the BIOS (in MiB). -Have fun! +Options accepted only by vesafb-tng: + + The mode you want to set, in the standard modedb format. Refer to + modedb.txt for detailed description. If you specify a mode that is + not supported by your board's BIOS, vesafb will attempt to set a + similar mode. The list of supported modes can be found in + /proc/fbx/modes, where x is the framebuffer number (usually 0). + When vesafb is compiled as a module, the mode string should be + provided as a value of the parameter 'mode'. + +vbemode:x + Force the use of VBE mode x. The mode will only be set if it's + found in VBE-provided list of supported modes. + NOTE: The mode number 'x' should be specified in VESA mode number + notation, not the Linux kernel one (ie. 257 instead of 769). + HINT: If you use this option because normal parameter does + not work for you and you use a X server, you'll probably want to + set the 'nocrtc' option to ensure that the video mode is properly + restored after console <-> X switches. + +nocrtc Do not use CRTC timings while setting the graphic mode. This option + makes sence only with VBE3.0 compliant systems. Use it if you have + problems with the modes set in the standard way. Note that specifying + this option means the refresh rate will be ignored and will stay at + your BIOS' default (60 Hz). + +noedid Do not try to fetch and use EDID-provided modes. + +gtf Force the use of VESA's GTF (Generalized Timing Formula). Specifying + this will cause vesafb to skip it's internal modedb and EDID-modedb + and jump straight to the GTF part of the code (normally used only is + everything else failed). This can be useful if you want to get as much + as possible from you graphics board but your BIOS doesn't support + modes with refresh rates you require. Note that you may need to + specify the maxhf, maxvf and maxclk parameters if they are not + provided by EDID. + +Additionally, the following parameters may be provided. They all override the +EDID-provided values and BIOS defaults. Refer to you monitor's specs to get +the correct values for maxhf, maxvf and maxclk for your hardware. + +maxhf:n Maximum horizontal frequency (in kHz). +maxvf:n Maximum vertical frequency (in Hz). +maxclk:n Maximum pixel clock (in MHz). + + +Vesafb-tng Technical details +============================ + +1. The driver architecture. + +The driver's code is stored in 3 files: + /drivers/video/vesafb-tng.c + /drivers/video/vesafb-thread.c + /include/video/vesa.h + +vesafb-tng.c contains the main code. vesafb-thread.c contains code for the +vesafb service thread. A separate thread is necessary because we need to remap +memory in order to be able to use the vm86 calls. The service thread is started +regardless of whether vesafb is compiled into the kernel or compiled as a +module. This is necessary because of the active_mm stuff, better described in +the header of vesafb-thread.c. + +2. The driver initialization + + o vesafb_vbe_init + - get basic info about the graphics BIOS + - fetch data about all modes supported by VBE + - get info about the protected mode interface + - get EDID data and attempt to create an EDID modedb + + o vesafb_probe + - get service thread's PID (started earlier from fbmem.c) + - call vesafb_vbe_init + - find a matching VBE mode + - try to find the specified mode in vesa_modes modedb + - try to find the specified mode in the EDID modedb + - try to calculate timings with the GTF + - low level setup - request_mem_region, ioremap, etc. + - setup /proc/fb/modes and /proc/fb/vbe_info - Gerd +Have fun! -- +Original document for the vesafb driver by Gerd Knorr -Minor (mostly typo) changes -by Nico Schmoigl +Minor (mostly typo) changes by +Nico Schmoigl + +Extended documentation for vm86, VBE3.0 and vesafb-tng by +Micha³ Januszewski + diff -Nru a/arch/i386/boot/video.S b/arch/i386/boot/video.S --- a/arch/i386/boot/video.S 2004-11-22 15:45:15 +01:00 +++ b/arch/i386/boot/video.S 2004-11-22 15:45:15 +01:00 @@ -164,10 +164,12 @@ # parameters in the default 80x25 mode -- these are set directly, # because some very obscure BIOSes supply insane values. mode_params: +#ifdef CONFIG_FB_VESA_STD #ifdef CONFIG_VIDEO_SELECT cmpb $0, graphic_mode jnz mopar_gr #endif +#endif movb $0x03, %ah # Read cursor position xorb %bh, %bh int $0x10 @@ -200,6 +202,7 @@ ret #ifdef CONFIG_VIDEO_SELECT +#ifdef CONFIG_FB_VESA_STD # Fetching of VESA frame buffer parameters mopar_gr: leaw modelist+1024, %di @@ -278,6 +281,7 @@ movw %es, %fs:(PARAM_VESAPM_SEG) movw %di, %fs:(PARAM_VESAPM_OFF) no_pm: ret +#endif # The video mode menu mode_menu: @@ -492,10 +496,12 @@ cmpb $VIDEO_FIRST_V7>>8, %ah jz setv7 - + +#ifdef CONFIG_FB_VESA_STD cmpb $VIDEO_FIRST_VESA>>8, %ah jnc check_vesa - +#endif + orb %ah, %ah jz setmenu @@ -567,6 +573,7 @@ movw -4(%si), %ax # Fetch mode ID jmp _m_s +#ifdef CONFIG_FB_VESA_STD check_vesa: leaw modelist+1024, %di subb $VIDEO_FIRST_VESA>>8, %bh @@ -600,6 +607,7 @@ ret _setbad: jmp setbad # Ugly... +#endif # Recalculate vertical display end registers -- this fixes various # inconsistencies of extended modes on many adapters. Called when diff -Nru a/drivers/video/Kconfig b/drivers/video/Kconfig --- a/drivers/video/Kconfig 2004-11-22 15:45:15 +01:00 +++ b/drivers/video/Kconfig 2004-11-22 15:45:15 +01:00 @@ -329,13 +329,55 @@ cards. Say Y if you have one of those. config FB_VESA - bool "VESA VGA graphics support" + tristate "VESA VGA graphics support" depends on FB && (X86 || X86_64) help This is the frame buffer device driver for generic VESA 2.0 compliant graphic cards. The older VESA 1.2 cards are not supported. You will get a boot time penguin logo at no additional cost. Please read . If unsure, say Y. + +choice + prompt "VESA driver type" + depends on FB_VESA + default FB_VESA_STD if X86_64 + default FB_VESA_TNG if X86 + +config FB_VESA_STD + bool "vesafb" + help + This is the frame buffer device driver for generic VESA 2.0 + compliant graphic cards. The older VESA 1.2 cards are not supported. + You will get a boot time penguin logo at no additional cost. Please + read . Choose this driver if you + are experiencing problems with vesafb-tng or if you own a 64-bit system. + + Note that this driver cannot be compiled as a module. + +config FB_VESA_TNG + bool "vesafb-tng" + depends on !X86_64 + select FB_MODE_HELPERS + help + This is the frame buffer device driver for generic VESA 2.0 + compliant graphic cards. It is capable of taking advantage of + VBE 3.0 features. With this driver you will be able to adjust + the refresh rate (VBE 3.0 compliant boards only) and change + the graphic mode on-the-fly. + + You will also get a boot time penguin logo at no additional cost. Please + read . + +endchoice + +config FB_VESA_DEFAULT_MODE + string "VESA default mode" + depends on FB_VESA_TNG + default "640x480@60" + help + This option is used to determine the default mode vesafb is + supposed to switch to in case no mode is provided as a kernel + command line parameter. config VIDEO_SELECT bool diff -Nru a/drivers/video/Makefile b/drivers/video/Makefile --- a/drivers/video/Makefile 2004-11-22 15:45:15 +01:00 +++ b/drivers/video/Makefile 2004-11-22 15:45:15 +01:00 @@ -96,7 +96,23 @@ obj-$(CONFIG_FB_PXA) += pxafb.o cfbimgblt.o cfbcopyarea.o cfbfillrect.o # Platform or fallback drivers go here -obj-$(CONFIG_FB_VESA) += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o +ifeq ($(CONFIG_FB_VESA),m) + ifeq ($(CONFIG_FB_VESA_STD),y) + obj-y += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o + else + obj-m += vesafb-tng.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o + obj-y += vesafb-thread.o + endif +else + ifeq ($(CONFIG_FB_VESA),y) + ifeq ($(CONFIG_FB_VESA_STD),y) + obj-y += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o + else + obj-y += vesafb-tng.o vesafb-thread.o cfbfillrect.o \ + cfbcopyarea.o cfbimgblt.o + endif + endif +endif obj-$(CONFIG_FB_VGA16) += vga16fb.o cfbfillrect.o cfbcopyarea.o \ cfbimgblt.o vgastate.o obj-$(CONFIG_FB_OF) += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c --- a/drivers/video/fbmem.c 2004-11-22 15:45:15 +01:00 +++ b/drivers/video/fbmem.c 2004-11-22 15:45:15 +01:00 @@ -51,6 +51,8 @@ * Frame buffer device initialization and setup routines */ +extern int vesafb_init_thread(void); + #define FBPIXMAPSIZE (1024 * 8) static struct notifier_block *fb_notifier_list; @@ -1161,6 +1163,10 @@ printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class)); fb_class = NULL; } + +#if defined(CONFIG_FB_VESA_TNG) || defined(CONFIG_FB_VESA_TNG_MODULE) + vesafb_init_thread(); +#endif return 0; } module_init(fbmem_init); diff -Nru a/drivers/video/vesafb-thread.c b/drivers/video/vesafb-thread.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/video/vesafb-thread.c 2004-11-22 15:45:15 +01:00 @@ -0,0 +1,569 @@ +/* + * Framebuffer driver for VBE 2.0+ compliant graphic boards - kernel thread + * and vm86 routines. + * + * This code has to be compiled into the kernel even if vesafb is configured + * as a module. If vesafb_thread were to be started while the module is being + * initialized, it would share its active_mm with modprobe. This mm would be + * lost after modprobe finished its work, and we can't allow it, because we + * need it for as long as the vesafb thread is active. + * + * (c) 2004 Micha³ Januszewski + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include