442 lines · plain
1=================2What is matroxfb?3=================4 5.. [This file is cloned from VesaFB. Thanks go to Gerd Knorr]6 7 8This is a driver for a graphic framebuffer for Matrox devices on9Alpha, Intel and PPC boxes.10 11Advantages:12 13 * It provides a nice large console (128 cols + 48 lines with 1024x768)14 without using tiny, unreadable fonts.15 * You can run XF{68,86}_FBDev or XFree86 fbdev driver on top of /dev/fb016 * Most important: boot logo :-)17 18Disadvantages:19 20 * graphic mode is slower than text mode... but you should not notice21 if you use same resolution as you used in textmode.22 23 24How to use it?25==============26 27Switching modes is done using the video=matroxfb:vesa:... boot parameter28or using `fbset` program.29 30If you want, for example, enable a resolution of 1280x1024x24bpp you should31pass to the kernel this command line: "video=matroxfb:vesa:0x1BB".32 33You should compile in both vgacon (to boot if you remove you Matrox from34box) and matroxfb (for graphics mode). You should not compile-in vesafb35unless you have primary display on non-Matrox VBE2.0 device (see36Documentation/fb/vesafb.rst for details).37 38Currently supported video modes are (through vesa:... interface, PowerMac39has [as addon] compatibility code):40 41 42Graphic modes43-------------44 45=== ======= ======= ======= ======= =======46bpp 640x400 640x480 768x576 800x600 960x72047=== ======= ======= ======= ======= =======48 4 0x12 0x10249 8 0x100 0x101 0x180 0x103 0x18850 15 0x110 0x181 0x113 0x18951 16 0x111 0x182 0x114 0x18A52 24 0x1B2 0x184 0x1B5 0x18C53 32 0x112 0x183 0x115 0x18B54=== ======= ======= ======= ======= =======55 56 57Graphic modes (continued)58-------------------------59 60=== ======== ======== ========= ========= =========61bpp 1024x768 1152x864 1280x1024 1408x1056 1600x120062=== ======== ======== ========= ========= =========63 4 0x104 0x10664 8 0x105 0x190 0x107 0x198 0x11C65 15 0x116 0x191 0x119 0x199 0x11D66 16 0x117 0x192 0x11A 0x19A 0x11E67 24 0x1B8 0x194 0x1BB 0x19C 0x1BF68 32 0x118 0x193 0x11B 0x19B69=== ======== ======== ========= ========= =========70 71 72Text modes73----------74 75==== ======= ======= ======== ======== ========76text 640x400 640x480 1056x344 1056x400 1056x48077==== ======= ======= ======== ======== ========78 8x8 0x1C0 0x108 0x10A 0x10B 0x10C798x16 2, 3, 7 0x10980==== ======= ======= ======== ======== ========81 82You can enter these number either hexadecimal (leading `0x`) or decimal83(0x100 = 256). You can also use value + 512 to achieve compatibility84with your old number passed to vesafb.85 86Non-listed number can be achieved by more complicated command-line, for87example 1600x1200x32bpp can be specified by `video=matroxfb:vesa:0x11C,depth:32`.88 89 90X1191===92 93XF{68,86}_FBDev should work just fine, but it is non-accelerated. On non-intel94architectures there are some glitches for 24bpp videomodes. 8, 16 and 32bpp95works fine.96 97Running another (accelerated) X-Server like XF86_SVGA works too. But (at least)98XFree servers have big troubles in multihead configurations (even on first99head, not even talking about second). Running XFree86 4.x accelerated mga100driver is possible, but you must not enable DRI - if you do, resolution and101color depth of your X desktop must match resolution and color depths of your102virtual consoles, otherwise X will corrupt accelerator settings.103 104 105SVGALib106=======107 108Driver contains SVGALib compatibility code. It is turned on by choosing textual109mode for console. You can do it at boot time by using videomode1102,3,7,0x108-0x10C or 0x1C0. At runtime, `fbset -depth 0` does this work.111Unfortunately, after SVGALib application exits, screen contents is corrupted.112Switching to another console and back fixes it. I hope that it is SVGALib's113problem and not mine, but I'm not sure.114 115 116Configuration117=============118 119You can pass kernel command line options to matroxfb with120`video=matroxfb:option1,option2:value2,option3` (multiple options should be121separated by comma, values are separated from options by `:`).122Accepted options:123 124============ ===================================================================125mem:X size of memory (X can be in megabytes, kilobytes or bytes)126 You can only decrease value determined by driver because of127 it always probe for memory. Default is to use whole detected128 memory usable for on-screen display (i.e. max. 8 MB).129disabled do not load driver; you can use also `off`, but `disabled`130 is here too.131enabled load driver, if you have `video=matroxfb:disabled` in LILO132 configuration, you can override it by this (you cannot override133 `off`). It is default.134noaccel do not use acceleration engine. It does not work on Alphas.135accel use acceleration engine. It is default.136nopan create initial consoles with vyres = yres, thus disabling virtual137 scrolling.138pan create initial consoles as tall as possible (vyres = memory/vxres).139 It is default.140nopciretry disable PCI retries. It is needed for some broken chipsets,141 it is autodetected for intel's 82437. In this case device does142 not comply to PCI 2.1 specs (it will not guarantee that every143 transaction terminate with success or retry in 32 PCLK).144pciretry enable PCI retries. It is default, except for intel's 82437.145novga disables VGA I/O ports. It is default if BIOS did not enable146 device. You should not use this option, some boards then do not147 restart without power off.148vga preserve state of VGA I/O ports. It is default. Driver does not149 enable VGA I/O if BIOS did not it (it is not safe to enable it in150 most cases).151nobios disables BIOS ROM. It is default if BIOS did not enable BIOS152 itself. You should not use this option, some boards then do not153 restart without power off.154bios preserve state of BIOS ROM. It is default. Driver does not enable155 BIOS if BIOS was not enabled before.156noinit tells driver, that devices were already initialized. You should use157 it if you have G100 and/or if driver cannot detect memory, you see158 strange pattern on screen and so on. Devices not enabled by BIOS159 are still initialized. It is default.160init driver initializes every device it knows about.161memtype specifies memory type, implies 'init'. This is valid only for G200162 and G400 and has following meaning:163 164 G200:165 - 0 -> 2x128Kx32 chips, 2MB onboard, probably sgram166 - 1 -> 2x128Kx32 chips, 4MB onboard, probably sgram167 - 2 -> 2x256Kx32 chips, 4MB onboard, probably sgram168 - 3 -> 2x256Kx32 chips, 8MB onboard, probably sgram169 - 4 -> 2x512Kx16 chips, 8/16MB onboard, probably sdram only170 - 5 -> same as above171 - 6 -> 4x128Kx32 chips, 4MB onboard, probably sgram172 - 7 -> 4x128Kx32 chips, 8MB onboard, probably sgram173 G400:174 - 0 -> 2x512Kx16 SDRAM, 16/32MB175 - 2x512Kx32 SGRAM, 16/32MB176 - 1 -> 2x256Kx32 SGRAM, 8/16MB177 - 2 -> 4x128Kx32 SGRAM, 8/16MB178 - 3 -> 4x512Kx32 SDRAM, 32MB179 - 4 -> 4x256Kx32 SGRAM, 16/32MB180 - 5 -> 2x1Mx32 SDRAM, 32MB181 - 6 -> reserved182 - 7 -> reserved183 184 You should use sdram or sgram parameter in addition to memtype185 parameter.186nomtrr disables write combining on frame buffer. This slows down driver187 but there is reported minor incompatibility between GUS DMA and188 XFree under high loads if write combining is enabled (sound189 dropouts).190mtrr enables write combining on frame buffer. It speeds up video191 accesses much. It is default. You must have MTRR support enabled192 in kernel and your CPU must have MTRR (f.e. Pentium II have them).193sgram tells to driver that you have Gxx0 with SGRAM memory. It has no194 effect without `init`.195sdram tells to driver that you have Gxx0 with SDRAM memory.196 It is a default.197inv24 change timings parameters for 24bpp modes on Millennium and198 Millennium II. Specify this if you see strange color shadows199 around characters.200noinv24 use standard timings. It is the default.201inverse invert colors on screen (for LCD displays)202noinverse show true colors on screen. It is default.203dev:X bind driver to device X. Driver numbers device from 0 up to N,204 where device 0 is first `known` device found, 1 second and so on.205 lspci lists devices in this order.206 Default is `every` known device.207nohwcursor disables hardware cursor (use software cursor instead).208hwcursor enables hardware cursor. It is default. If you are using209 non-accelerated mode (`noaccel` or `fbset -accel false`), software210 cursor is used (except for text mode).211noblink disables cursor blinking. Cursor in text mode always blinks (hw212 limitation).213blink enables cursor blinking. It is default.214nofastfont disables fastfont feature. It is default.215fastfont:X enables fastfont feature. X specifies size of memory reserved for216 font data, it must be >= (fontwidth*fontheight*chars_in_font)/8.217 It is faster on Gx00 series, but slower on older cards.218grayscale enable grayscale summing. It works in PSEUDOCOLOR modes (text,219 4bpp, 8bpp). In DIRECTCOLOR modes it is limited to characters220 displayed through putc/putcs. Direct accesses to framebuffer221 can paint colors.222nograyscale disable grayscale summing. It is default.223cross4MB enables that pixel line can cross 4MB boundary. It is default for224 non-Millennium.225nocross4MB pixel line must not cross 4MB boundary. It is default for226 Millennium I or II, because of these devices have hardware227 limitations which do not allow this. But this option is228 incompatible with some (if not all yet released) versions of229 XF86_FBDev.230dfp enables digital flat panel interface. This option is incompatible231 with secondary (TV) output - if DFP is active, TV output must be232 inactive and vice versa. DFP always uses same timing as primary233 (monitor) output.234dfp:X use settings X for digital flat panel interface. X is number from235 0 to 0xFF, and meaning of each individual bit is described in236 G400 manual, in description of DAC register 0x1F. For normal237 operation you should set all bits to zero, except lowest bit. This238 lowest bit selects who is source of display clocks, whether G400,239 or panel. Default value is now read back from hardware - so you240 should specify this value only if you are also using `init`241 parameter.242outputs:XYZ set mapping between CRTC and outputs. Each letter can have value243 of 0 (for no CRTC), 1 (CRTC1) or 2 (CRTC2), and first letter244 corresponds to primary analog output, second letter to the245 secondary analog output and third letter to the DVI output.246 Default setting is 100 for cards below G400 or G400 without DFP,247 101 for G400 with DFP, and 111 for G450 and G550. You can set248 mapping only on first card, use matroxset for setting up other249 devices.250vesa:X selects startup videomode. X is number from 0 to 0x1FF, see table251 above for detailed explanation. Default is 640x480x8bpp if driver252 has 8bpp support. Otherwise first available of 640x350x4bpp,253 640x480x15bpp, 640x480x24bpp, 640x480x32bpp or 80x25 text254 (80x25 text is always available).255============ ===================================================================256 257If you are not satisfied with videomode selected by `vesa` option, you258can modify it with these options:259 260============ ===================================================================261xres:X horizontal resolution, in pixels. Default is derived from `vesa`262 option.263yres:X vertical resolution, in pixel lines. Default is derived from `vesa`264 option.265upper:X top boundary: lines between end of VSYNC pulse and start of first266 pixel line of picture. Default is derived from `vesa` option.267lower:X bottom boundary: lines between end of picture and start of VSYNC268 pulse. Default is derived from `vesa` option.269vslen:X length of VSYNC pulse, in lines. Default is derived from `vesa`270 option.271left:X left boundary: pixels between end of HSYNC pulse and first pixel.272 Default is derived from `vesa` option.273right:X right boundary: pixels between end of picture and start of HSYNC274 pulse. Default is derived from `vesa` option.275hslen:X length of HSYNC pulse, in pixels. Default is derived from `vesa`276 option.277pixclock:X dotclocks, in ps (picoseconds). Default is derived from `vesa`278 option and from `fh` and `fv` options.279sync:X sync. pulse - bit 0 inverts HSYNC polarity, bit 1 VSYNC polarity.280 If bit 3 (value 0x08) is set, composite sync instead of HSYNC is281 generated. If bit 5 (value 0x20) is set, sync on green is turned282 on. Do not forget that if you want sync on green, you also probably283 want composite sync.284 Default depends on `vesa`.285depth:X Bits per pixel: 0=text, 4,8,15,16,24 or 32. Default depends on286 `vesa`.287============ ===================================================================288 289If you know capabilities of your monitor, you can specify some (or all) of290`maxclk`, `fh` and `fv`. In this case, `pixclock` is computed so that291pixclock <= maxclk, real_fh <= fh and real_fv <= fv.292 293============ ==================================================================294maxclk:X maximum dotclock. X can be specified in MHz, kHz or Hz. Default is295 `don`t care`.296fh:X maximum horizontal synchronization frequency. X can be specified297 in kHz or Hz. Default is `don't care`.298fv:X maximum vertical frequency. X must be specified in Hz. Default is299 70 for modes derived from `vesa` with yres <= 400, 60Hz for300 yres > 400.301============ ==================================================================302 303 304Limitations305===========306 307There are known and unknown bugs, features and misfeatures.308Currently there are following known bugs:309 310 - SVGALib does not restore screen on exit311 - generic fbcon-cfbX procedures do not work on Alphas. Due to this,312 `noaccel` (and cfb4 accel) driver does not work on Alpha. So everyone313 with access to `/dev/fb*` on Alpha can hang machine (you should restrict314 access to `/dev/fb*` - everyone with access to this device can destroy315 your monitor, believe me...).316 - 24bpp does not support correctly XF-FBDev on big-endian architectures.317 - interlaced text mode is not supported; it looks like hardware limitation,318 but I'm not sure.319 - Gxx0 SGRAM/SDRAM is not autodetected.320 - maybe more...321 322And following misfeatures:323 324 - SVGALib does not restore screen on exit.325 - pixclock for text modes is limited by hardware to326 327 - 83 MHz on G200328 - 66 MHz on Millennium I329 - 60 MHz on Millennium II330 331 Because I have no access to other devices, I do not know specific332 frequencies for them. So driver does not check this and allows you to333 set frequency higher that this. It causes sparks, black holes and other334 pretty effects on screen. Device was not destroyed during tests. :-)335 - my Millennium G200 oscillator has frequency range from 35 MHz to 380 MHz336 (and it works with 8bpp on about 320 MHz dotclocks (and changed mclk)).337 But Matrox says on product sheet that VCO limit is 50-250 MHz, so I believe338 them (maybe that chip overheats, but it has a very big cooler (G100 has339 none), so it should work).340 - special mixed video/graphics videomodes of Mystique and Gx00 - 2G8V16 and341 G16V16 are not supported342 - color keying is not supported343 - feature connector of Mystique and Gx00 is set to VGA mode (it is disabled344 by BIOS)345 - DDC (monitor detection) is supported through dualhead driver346 - some check for input values are not so strict how it should be (you can347 specify vslen=4000 and so on).348 - maybe more...349 350And following features:351 352 - 4bpp is available only on Millennium I and Millennium II. It is hardware353 limitation.354 - selection between 1:5:5:5 and 5:6:5 16bpp videomode is done by -rgba355 option of fbset: "fbset -depth 16 -rgba 5,5,5" selects 1:5:5:5, anything356 else selects 5:6:5 mode.357 - text mode uses 6 bit VGA palette instead of 8 bit (one of 262144 colors358 instead of one of 16M colors). It is due to hardware limitation of359 Millennium I/II and SVGALib compatibility.360 361 362Benchmarks363==========364It is time to redraw whole screen 1000 times in 1024x768, 60Hz. It is365time for draw 6144000 characters on screen through /dev/vcsa366(for 32bpp it is about 3GB of data (exactly 3000 MB); for 8x16 font in36716 seconds, i.e. 187 MBps).368Times were obtained from one older version of driver, now they are about 3%369faster, it is kernel-space only time on P-II/350 MHz, Millennium I in 33 MHz370PCI slot, G200 in AGP 2x slot. I did not test vgacon::371 372 NOACCEL373 8x16 12x22374 Millennium I G200 Millennium I G200375 8bpp 16.42 9.54 12.33 9.13376 16bpp 21.00 15.70 19.11 15.02377 24bpp 36.66 36.66 35.00 35.00378 32bpp 35.00 30.00 33.85 28.66379 380 ACCEL, nofastfont381 8x16 12x22 6x11382 Millennium I G200 Millennium I G200 Millennium I G200383 8bpp 7.79 7.24 13.55 7.78 30.00 21.01384 16bpp 9.13 7.78 16.16 7.78 30.00 21.01385 24bpp 14.17 10.72 18.69 10.24 34.99 21.01386 32bpp 16.15 16.16 18.73 13.09 34.99 21.01387 388 ACCEL, fastfont389 8x16 12x22 6x11390 Millennium I G200 Millennium I G200 Millennium I G200391 8bpp 8.41 6.01 6.54 4.37 16.00 10.51392 16bpp 9.54 9.12 8.76 6.17 17.52 14.01393 24bpp 15.00 12.36 11.67 10.00 22.01 18.32394 32bpp 16.18 18.29* 12.71 12.74 24.44 21.00395 396 TEXT397 8x16398 Millennium I G200399 TEXT 3.29 1.50400 401 * Yes, it is slower than Millennium I.402 403 404Dualhead G400405=============406Driver supports dualhead G400 with some limitations:407 + secondary head shares videomemory with primary head. It is not problem408 if you have 32MB of videoram, but if you have only 16MB, you may have409 to think twice before choosing videomode (for example twice 1880x1440x32bpp410 is not possible).411 + due to hardware limitation, secondary head can use only 16 and 32bpp412 videomodes.413 + secondary head is not accelerated. There were bad problems with accelerated414 XFree when secondary head used to use acceleration.415 + secondary head always powerups in 640x480@60-32 videomode. You have to use416 fbset to change this mode.417 + secondary head always powerups in monitor mode. You have to use fbmatroxset418 to change it to TV mode. Also, you must select at least 525 lines for419 NTSC output and 625 lines for PAL output.420 + kernel is not fully multihead ready. So some things are impossible to do.421 + if you compiled it as module, you must insert i2c-matroxfb, matroxfb_maven422 and matroxfb_crtc2 into kernel.423 424 425Dualhead G450426=============427Driver supports dualhead G450 with some limitations:428 + secondary head shares videomemory with primary head. It is not problem429 if you have 32MB of videoram, but if you have only 16MB, you may have430 to think twice before choosing videomode.431 + due to hardware limitation, secondary head can use only 16 and 32bpp432 videomodes.433 + secondary head is not accelerated.434 + secondary head always powerups in 640x480@60-32 videomode. You have to use435 fbset to change this mode.436 + TV output is not supported437 + kernel is not fully multihead ready, so some things are impossible to do.438 + if you compiled it as module, you must insert matroxfb_g450 and matroxfb_crtc2439 into kernel.440 441Petr Vandrovec <vandrove@vc.cvut.cz>442