Jump to content

* * * * * 1 votes

Video redraw acceleration trick

  • Please log in to reply
2 replies to this topic

#1 bearwindows



  • Developer
  • 50 posts

Posted 04 August 2007 - 07:21 AM

If you think that in large resolutions (1024x768 and more) screen redrawing is slow here is the solution:

1) for vbemp.sys - http://bearwindows.b...d.net/vbemp.htm, Mirror #1
Hive : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vbemp\Device0 or HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vgasave\Device0 in legacy mode

Key : Acceleration.Level

Value : (REG_DWORD) = 5
2) for vga.sys
Hive : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vgasave\Device0

 Key : Acceleration.Level

Value : (REG_DWORD) = 5

Note 1: This trick works in Windows2000/XP/2003. But NOT in Windows NT 4 and others.
Note 2: For "normal accelerated drivers" like made by AMD-ATI, Intel, nVidia and others Acceleration.Level=5 key SLOWDOWNS redraw. Do not set it. In this case, optimal setting is Acceleration.Level=0 or when this key is not exist.

#2 bearwindows



  • Developer
  • 50 posts

Posted 08 February 2008 - 04:03 PM

Additional materials: Acceleration.Level investigation.

Acceleration.Level is a tricky key that controls how Windows changes functionality of a vendor (or Microsoft) supplied display driver.

Taken from here: http://msdn2.microso...y/ms797865.aspx
and here: http://msdn2.microso...y/ms797471.aspx

Windows Driver Kit: Display Devices
Dynamic Change of Permitted Driver Accelerations

The driver's acceleration level can be changed through the user interface by using the slider that is produced by clicking on the Display icon in Control Panel. Depending on the value set with this slider, GDI allows the following levels of driver accelerations listed in the following table.

0 All display driver accelerations are permitted.
1 DrvSetPointerShape and DrvCreateDeviceBitmap are disabled.
2 In addition to 1, more sophisticated display driver accelerations are disallowed, including DrvStretchBlt, DrvFillPath, DrvGradientFill, DrvLineTo, DrvAlphaBlend, and DrvTransparentBlt.
3 In addition to 2, all DirectDraw and Direct3D accelerations are disallowed.
4 In addition to 3, almost all display driver accelerations are disallowed, except for solid color fills, DrvCopyBits, DrvTextOut, and DrvStrokePath. DrvEscape is disabled.
5 No hardware accelerations are allowed. The driver will only be called to do bit-block transfers from a system memory surface to the screen.

Pp. 5 means that driver (i.e. vbemp.sys, vga.sys, any other unaccelerated one) only do its job when transferring data from system memory to video memory is performed which is a rather FAST operation due to hardware write optimization in every modern (and not so modern) videoadapter. PCI/AGP/PCI-E (and even ISA/VLB!) videoadapters also uses CPU's speedup features of MTRR registers and USWC ( http://en.wikipedia....Write_Combining ) (Moving are made, for example using REPE MOVSD in 32bit color modes). But transferring data from video memory to system memory is SLOW even if you have an accelerated card and a "simple" driver. But who handles other operations when pp.5 is selected (or slider moved to "No acceleration")? Windows (i.e. win32k.sys) handles them. Using this tool ( http://www.stereopsis.com/blttest/ ) I discovered that reading from video memory to system memory is faster in pp.5 mode comparing to pp.0,1,2,3,4. Reading/Writing from system memory to video memory is performing thousand and hundreds of times when you:
1) Scrolling a text in any window like reading this text. :D
2) Moving/Resizing any window across the screen.
3) Moving mouse cursor or keyboard selection.
This test (blttest) covers not only Windows XP/2003 but also Windows 2000. :thumbsup:
So I definitely think that this speedup is a Windows feature (not VBEMP's). So it works even when you are using standard XP/2003's vga.sys.

P.S. In bsd/linux world (which is rather clear due to OpenSource and so on...) this feature named correctly as shadow acceleration. It minimizes reading from video memory using temporary buffer (or cache) in compter's system RAM. This buffer equals in size to video memory size of display window.

#3 was_jaclaz



  • Advanced user
  • 7100 posts
  • Location:Gone in the mist

Posted 08 February 2008 - 04:23 PM

So it workes even when you are using standard XP/2003's vga.sys.

Interesting! :D

I'll try it in the "10 Mb" (not really :D ) let's call it XPCLI project:



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users