home *** CD-ROM | disk | FTP | other *** search
/ BUG 14 / BUGCD1998_05.ISO / _runtime / _fastvid / fastv.exe / Fastvid.txt < prev   
Text File  |  1997-04-14  |  19KB  |  378 lines

  1.  
  2. FastVid 1.03.  Copyright 1996 by John Hinkley.  72466.1403@compuserve.com
  3.  
  4. --------------------------------------------------------------------------
  5. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  6. --------------------------------------------------------------------------
  7.  
  8. THIS PROGRAM WILL ONLY WORK ON PENTIUM PRO PROCESSORS.  IT WILL NOT WORK,
  9. AND IS NOT NEEDED, ON PENTIUM AND EARLIER CPU's.
  10.  
  11. According to Intel, enabling Write Posting (see below) on 82450 steppings
  12. before B0 could result in "rare" problems on the PCI bus.  If the program
  13. indicates that Write Posting is enabled when you first run this program
  14. (the "Before" message) then you have a B0 or later stepping of the 82450
  15. and don't need to worry about the A2 bugs.  The problem will manifest
  16. itself when there are high levels of traffic on the PCI bus -- multiple
  17. devices reading and writing at the same time.  A typical example where you
  18. might have problems is when playing multimedia files like AVI and MPEG
  19. animations.  The write combining options of this program can be used
  20. without problems on any version of the 82450.
  21.  
  22. If you have a pre-B0 motherboard you may want to play around with write
  23. posting to see the difference it makes but you shouldn't enable it all the
  24. time -- it will occasionally lock up your computer.  If you really want or
  25. need write posting you should consider getting a new motherboard.
  26.  
  27. Be forewarned: YOU USE THIS PROGRAM AT YOUR OWN RISK.
  28.  
  29. --------------------------------------------------------------------------
  30.             End of Warning.
  31. --------------------------------------------------------------------------
  32.  
  33. This program enables Write Posting, banked VGA Write Combining and SVGA
  34. linear frame buffer Write Combining on Pentium Pro motherboards based on
  35. the 82450 chipset.  This will significantly improve graphic performance
  36. from DOS and Win95.
  37.  
  38. The program must execute privileged instructions so it must be run in real
  39. mode.  For the time being that means it must be run from DOS.  You cannot
  40. run it from a DOS window or a full screen DOS session from Windows 3.x,
  41. Win95, WinNT or OS/2.  For DOS, Windows 3.x and Win95 you can include the
  42. program in your AUTOEXEC.BAT file (keep in mind that DOS4GW.EXE must be in
  43. your search path).  If you try to run the program from a protected mode OS
  44. you will get a DOS4GW error message and register dump.
  45.  
  46.  
  47. --------------------------------------------------------------------------
  48.  
  49. Steppings of the 82450 chipset before B0 have bugs which forced Intel to
  50. disable Write Posting -- in essence cache writes have been disabled for
  51. the PCI bus.  The B0 stepping has been fixed and Write Posting is enabled
  52. by default by the BIOS.  The difference is easily visible in writing to
  53. video memory.  An A2 motherboard can only write about 8MB/sec to the
  54. graphics card, a B0 motherboard gets about 18MB/sec.
  55.  
  56. But this is not the entire story.  With the Pentium Pro, Intel also
  57. decided that Write Combining (the combining of several writes into a cache
  58. line that can be bursted out the PCI bus) should be the responsibility of
  59. the O/S, not the BIOS or hardware.  By enabling Write Combining the
  60. throughput to video RAM can be further increased to 88MB/sec or more.
  61.  
  62. There are two mechanisms for which Write Combining needs to be enabled:
  63. the banked VGA mechanism (the 128KB from A0000 to BFFFF) and the unbanked,
  64. linear frame buffer that many of the newer cards support.  I will refer
  65. henceforth refer to linear frame buffer write combining as LFBWC and
  66. banked VGA write combining as BVWC.
  67.  
  68. Most low resolution DOS graphics applications and games use the banked
  69. mechanism.  But since the VESA committee has defined a standard, and
  70. UNIVBE and a few of the graphic card manufacturers have provided the VESA
  71. services, some of the latest games are using the linear frame buffer (Duke
  72. Nuke'm 3D and the Quake demo are two examples).  The linear frame buffer
  73. usually gives better performance since it alleviates the reqirement to
  74. switch banks in hires modes.
  75.  
  76. I have only personally tested this program with 2MB and 4MB Matrox MGA
  77. Millennium cards.  It has been run by others with other cards (S3 964
  78. based, S3 968 based, Tseng 6000 based) and most benefit to some extent. 
  79. The Number Nine Imagine 128 card does not seem to benefit.
  80.  
  81. With a 2MB Millennium there were problems with BVWC -- most hires VESA
  82. modes would result in vertical stripes over the entire screen.  This
  83. appears to be either a hardware or software bug on the part of Matrox.  I
  84. found a workaround which eliminates the stripes but you don't get the full
  85. speed enhancement from the BVGA.  The LFB will still run at full speed. 
  86. Using a negative value for the number of megabytes (for example
  87. FASTVID  x11 -2) will enable this workaround.
  88.  
  89. I haven't tested FASTVID on any 8MB graphic cards but I think it will work
  90. properly.  Please let me know if you find othewise.
  91.  
  92. On many graphic cards, enabling the BVWC results in problems with some
  93. programs that use VGA mode 0x12 (640x480x16colors).  This appears to be
  94. either a hardware or software problem on the part of Matrox.  The problem
  95. stems from the BVWC so you can run with that disabled if necessary.  Users
  96. of other graphic cards have indicated the same problem.  Note that this is
  97. not the same as the "vertical stripe" problem mentioned above.
  98.  
  99. Unfortunately, I have found that EMM386 interferes in some way with LFBWC
  100. (tested with DOS6.2 and 7.0).  I also have reports from beta testers that
  101. QEMM can interfere with LFBWC under DOS.  When running DOS you must remove
  102. EMM386 from your CONFIG.SYS file for LFBWC to work (BVWC is not affected
  103. by EMM386).  If EMM386 is loaded you will see no increase in speed of the
  104. linear frame buffer.  Early on I wasn't able to get LFBWC with Win95. 
  105. After removing EMM386, LFBWC started working form both DOS and Win95
  106. sessions.  At some point I re-enabled EMM386 and found that LFBWC contiued
  107. to work from Win95.  I don't know what caused this "permanent" change
  108. (maybe re-installing the graphic driver with EMM386 removed and LFBWC
  109. turned on did it) -- let me know if you find out...
  110.  
  111. LFB write combining requires that FASTVID know where the linear frame
  112. buffer is located.  Different graphic card manufacturers put it at
  113. different addresses.  The LFBWC code in FASTVID currently queries any
  114. installed VESA BIOS Extension driver for the LFB address so you should
  115. install your VESA driver before FASTVID.  If you don't have a VESA driver
  116. loaded (keep in mind that many cards have the driver in BIOS so you don't
  117. need to explicitly load one) or your VESA driver doesn't support the LFB,
  118. you will have to supply an address.  Theoretically this program will work
  119. for any LFB address above 0x80000000 but I have only tested and verified
  120. that it works for the Matrox MGA Millennium at 0xFF000000.  (Others have
  121. successfully used it with other graphics cards at other addresses).  If
  122. you supply an incorrect LFB address you will not see any increase in speed
  123. of the LFBWC.
  124.  
  125. If this program can't automatically detect the LFB address, you can
  126. determine it's location from Win95.  Select Start, Settings, Control Panel,
  127. (or My Computer, Control Panel), System, Device Manager, Display Adaptors,
  128. your graphics card, Resources.  Scroll to the bottom of the Resource
  129. Settings box and you will see a line that reads: "Memory Range XXXXXXXX -
  130. YYYYYYYY".  The first value is the location of the linear frame buffer. 
  131. For the Matrox MGA Millennium it is 0xFF000000.  If you have another
  132. address take note of it and input it into FASTVID when asked.
  133.  
  134. --------------------------------------------------------------------------
  135.  
  136. Usage: FASTVID4 XYZ N ADDRESS
  137.  
  138.     X controls Write Posting.
  139.     Y controls VGA (banked) Write Combining.
  140.     Z controls SVGA (linear frame buffer) Write Combining.
  141.         For all three, 0 disables, 1 enables, any other value
  142.         results in no change from the current setting.
  143.     N indicates the amount of video memory in MegaBytes.
  144.         Valid values are 2, 4, and 8.  Also valid are -2, -4,
  145.         and -8 to apply the special "vertical stripe" patch.
  146.     ADDRESS is the address of the linear frame buffer in hex.
  147.         The Matrox MGA Millennium has it at FF000000.
  148.  
  149. Example 1: FASTVID4
  150.  
  151.     If no arguments are supplied you run through a question and answer
  152.     dialogue and the program sets up the environment.  It will also
  153.     tell you what the equivalent command line is for the options you
  154.     chose.
  155.  
  156. Example 2: FASTVID4 111 4 FF000000
  157.  
  158.     Write posting is enabled
  159.     VGA Write Combining is enabled
  160.     SVGA Write Combining is enabled for 4MB video memory at FF000000
  161.  
  162. Example 3: FASTVID4 x01 4 FF000000
  163.  
  164.     The write posting setting is not changed by FASTVID
  165.     VGA Write Combining is disabled
  166.     SVGA Write Combining is enabled for 4MB video memory at FF000000
  167.  
  168. Example 4: FASTVID4 111 -2 FF000000
  169.  
  170.     Write posting is enabled
  171.     VGA Write Combining is enabled.  "Vertical stripe" patch applied.
  172.     SVGA Write Combining is enabled for 2MB video memory at FF000000
  173.  
  174. Example 5: FASTVID4 111 -4 FF000000
  175.  
  176.     Write posting is enabled
  177.     VGA Write Combining is enabled.  "Vertical stripe" patch applied.
  178.     SVGA Write Combining is enabled for 4MB video memory at FF000000
  179.  
  180.  
  181. --------------------------------------------------------------------------
  182.  
  183. Included is a test program called VSPEED.EXE that reports the video
  184. throughput for bit blit operations from DRAM to VRAM for both the banked
  185. VGA and linear frame buffer mechanisms.
  186.  
  187. If you experience difficulties with VSPEED try using -l or -L on the
  188. command line to eliminate the linear frame buffer test.  For example:
  189.  
  190.     VSPEED -l
  191.  
  192. will test only the banked VGA mechanism.
  193.  
  194.     VSPEED
  195.  
  196. will test both the banked VGA and the linear frame buffer (assuming the
  197. card and VESA driver support it).
  198.  
  199. --------------------------------------------------------------------------
  200.  
  201. Sample VSPEED results from an Intel Aurora motherboard with the B0
  202. stepping of the 82450 and a 4MB Matrox MGA Millennium:
  203.  
  204. FASTVID 000
  205. Copy DRAM to banked VGA:           8.07 million bytes per second
  206. Copy DRAM to linear framebuffer:   8.14 million bytes per second
  207.  
  208. FASTVID 100
  209. Copy DRAM to banked VGA:          18.72 million bytes per second
  210. Copy DRAM to linear framebuffer:  18.91 million bytes per second
  211.  
  212. FASTVID 011
  213. Copy DRAM to banked VGA:          37.95 million bytes per second
  214. Copy DRAM to linear framebuffer:  39.60 million bytes per second
  215.  
  216. FASTVID 111
  217. Copy DRAM to banked VGA:          87.72 million bytes per second
  218. Copy DRAM to linear framebuffer:  93.46 million bytes per second
  219.  
  220. FASTVID 111 -2
  221. Copy DRAM to banked VGA:          49.20 million bytes per second
  222. Copy DRAM to linear framebuffer:  93.46 million bytes per second
  223.  
  224. --------------------------------------------------------------------------
  225.  
  226. Sample VSPEED results from other cards with FASTVID 111 (unverified):
  227.  
  228. STB Powergraph (S3 Trio64)                       48 MillionBytes/sec
  229. Spea/V7 (S3 Trio64)                              78 MillionBytes/sec
  230. GXE64Pro (S3-964)                 22 MillionBytes/sec
  231.  
  232. --------------------------------------------------------------------------
  233.  
  234. The following tests were run on an Intel Aurora motherboard with the B0
  235. stepping of the 82450, 64MB DRAM (all four SIMM sockets populated), and a
  236. 4MB Matrox MGA Millennium.  The "000" setting simulates an A2 motherboard
  237. where Write Posting is disabled.
  238.  
  239.  
  240. --------------------------------------------------------------------------
  241. program:               fastvid setting: 000     100     011     111
  242. --------------------------------------------------------------------------
  243.  
  244. VSPEED (LFB, million bytes/sec)           8      19      40      93
  245. Duke Nuke'm 3D (640x480, fps)            14      25      18      31
  246. Doom Benchmark (fps)                     38      70      48      74
  247. 640x480 FLC animation (fps)              25      48      88     121
  248. Chris's 3D benchmark (SVGA)              21      38      66      77
  249.  
  250.  
  251. Note that differences in motherboard and graphic card design may lead to
  252. different results.  Most notably, some cards cannot sustain 93MB/sec in
  253. the VSPEED test.
  254.  
  255. The above are all DOS applications.  If you have an A2 motherboard turning
  256. on write posting will increase the WinBench96 Graphic Winmark score by
  257. about 25 percent.  The write combining features don't make much difference
  258. to the Graphic Winmark score but there _are_ circumstance where write
  259. combining can make a big difference.  One example is using the Media
  260. Player to play an animation to a high resolution, highcolor or truecolor
  261. window.  For example:
  262.  
  263. Run Win95 in a high resolution, direct color mode; say 1024x768, 24bits
  264. per pixel.  Start the Media Player.  Open \FUNSTUFF\VIDEOS\WEEZER.AVI from
  265. the Win95 CD-ROM.  Enlarge the playback window to nearly full screen (do
  266. not use the Media Player's "full screen" option -- if you do it will
  267. change the screen to a lower resolution 8 bit mode for playback).  Press
  268. the Play button.  With write posting and write combining turned off you
  269. will get very poor results, about 2 frames per second.  With write posting
  270. on and write combining off that will improve to about 4 frames per second.
  271. With both write posting and write combining on you will get very smooth
  272. playback with the frame rate too fast to count.
  273.  
  274. You can see similar affects with the Hover! game on the Win95 CD-ROM. 
  275. Again, with Win95 in a hires direct color mode, enlarge the game window as
  276. large as it will let you (about 640x480).  With write posting and write
  277. combinging off you will get poor performance.  With write posting on the
  278. game will be playable.  With write posting and write combining the action
  279. will be very smooth.
  280.  
  281. If you have a pre-B0 motherboard you can still benefit from write
  282. combining (without fear of encountering the 82450 bugs) in the above DOS
  283. and Win95 situations.
  284.  
  285. --------------------------------------------------------------------------
  286.             further descriptions:
  287. --------------------------------------------------------------------------
  288.  
  289. 1) Write Posting:
  290.  
  291. Write Posting is where the processor "posts" data to the PCI bus and then
  292. goes on it's way without waiting for the write operation to complete.
  293. Because of bugs in the pre-B0 stepping of the 82450 chipset Write Posting is
  294. disabled on early Pentium Pro motherboards.  This severly limits the PCI
  295. throughput to about 8MB/sec.  Most Pentium motherboards these days can get
  296. over 80MB/sec, 10 times faster.  FASTVID can enable Write Posting on these
  297. motherboards, increasing PCI throughput to about 18MB/sec.  You don't want to
  298. do this routinely because the bugs in the chipset will eventualy cause the
  299. PCI bus to hang, forcing a reboot of the machine.  Motherboards with the B0
  300. stepping have this bug fixed and Write Posting enabled by default.
  301.  
  302.  
  303. 2) Banked VGA Write Combining (BVGAWC):
  304.  
  305. This function allows seperate writes to the banked VGA mechanism to be
  306. combined into a cacheline that can be bursted out to video memory via the PCI
  307. bus.  I believe this used to be handled in hardware but Intel decided to make
  308. it a programable function with the Pentium Pro to make the motherboard
  309. architecture more general.  If you enable BVGAWC with FASTVID PCI throughput
  310. will increase from 18MB/sec (B0 motherboard) to 90MB/sec for programs that
  311. use the banked VGA mechanism (most DOS games).  If you enable only BVGAWC on
  312. an early motherboard (Write Posting remains off) the bus bandwidth increases
  313. from 8MB/sec to about 40MB/sec.  Some of the newer motherboards (ASUS for
  314. instance) have this as a BIOS setup option.
  315.  
  316.  
  317. 3) Linear Frame Buffer Write Combining:
  318.  
  319. Many newer graphics cards have their graphics memory mapped linearly at very
  320. high physical addresses (in addition to the banked VGA mechanism at A000:0000
  321. and B000:0000) beyond the 2GB mark.  The reason for doing this is to make
  322. access to video memory simpler and faster -- programs (and Windows drivers)
  323. don't have to switch banks all the time to access all of video memory.  I
  324. believe Pentium motherboards enable Write Combining for all high addresses
  325. but the Pentium Pro design requires the use of the processors MSR registers
  326. to enable Write Combining.  Again, this was done to generalize the
  327. motherboard design.  You can theoretically have multiple devices mapped in
  328. high address space with different cachability options.  Intel believes that
  329. proper place for this to be handled is within a PNP operating system.
  330. Unfortunately, no operating system yet supports this.  As with BVGAWC, LFBWC
  331. will increase PCI throughput from 18MB/sec to 90MB/sec (or 8MB/sec to
  332. 45MB/sec with Write Posting off) for programs that use the linear frame
  333. buffer (some of the new hires DOS games, Windows drivers).
  334.  
  335.  
  336. Exactly how much a difference any of these functions makes depends on the
  337. applications being run and the graphics card you're using.  If you are using
  338. a very slow graphics card you won't see much difference.  Programs that do
  339. very little graphic output will show little or no difference.  Programs that
  340. do lots of graphic output (realtime 3D games, multimedia animations) can show
  341. a large difference.  There are even circumstances under Win95, OS/2 and NT
  342. where the difference can be huge.
  343.  
  344. Here are some results with my Matrox MGA Millennium:
  345.  
  346.                                       A2      B0     FASTVID
  347. ----------------------------------------------------------------
  348.  Duke Nuke'm 3D (640x480, fps)        14      25       31
  349.  Doom Benchmark (fps)                 38      70       74
  350.  640x480 FLC animation (fps)          25      48      121
  351.  Chris's 3D benchmark (SVGA)          21      38       77
  352.  Win95 Media Player* (fps)             2       5       15**
  353.  
  354. * WEEZER.AVI from the Win95 CD-ROM enlarged to _nearly_ full screen at
  355. 1152x864, 32 bits-per-pixel.
  356.  
  357. ** the frame rate was too fast to count, 15fps is an estimate -- the
  358. animation played fairly smoothly.
  359.  
  360. --------------------------------------------------------------------------
  361.  
  362. Notes for SuperMicro P6SNF and P6DNF motherboard users, and other 82440
  363. (Natoma chipset) based motherboards:
  364.  
  365. Several FASTVID users have reported that one BIOS setting on these
  366. motherboards conflicts with FASTVID resulting in a system crash.  If you
  367. experience these crashes try turning off "USWC write combining" (Uncached
  368. Speculative Write Combining) using the BIOS setup procedure.
  369.  
  370. FASTVID's controls for write-posting don't seem to have any effect on
  371. 82440 motherboards.  Presumably this means that write-posting is
  372. controlled by a different mechanism.  I suggest using "FASTVID x11" so
  373. that FASTVID doesn't attempt to change the write-posting option if you
  374. have one of these motherboards.
  375.  
  376. --------------------------------------------------------------------------
  377.  
  378.