Hi,
As of Wine 1.1.27, XShm support was added for the creation of DIBSECTIONs in winex11.drv. The use of XShm more closely matches to the Windows behavior and can also bring more performance.
An Nvidia developer noticed this change in the ChangeLog and we both wondered why even more XShm code was added in this time because XShm has lost its use due to the emergence of EXA-like display drivers. Modern drivers disable a large amount of hardware acceleration when using XShm because they can't create the pixmaps in video memory since the client owns the memory. This could decrease performance quite a bit for most applications if they aren't hit by dibsection back-and-forth copying bottlenecks. XRender for instance falls back to software rendering for non-video memory based pixmaps.
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Regards, Roderick Colenbrander
On Sun, Aug 9, 2009 at 3:51 PM, Roderick Colenbranderthunderbird2k@gmail.com wrote:
Hi,
As of Wine 1.1.27, XShm support was added for the creation of DIBSECTIONs in winex11.drv. The use of XShm more closely matches to the Windows behavior and can also bring more performance.
An Nvidia developer noticed this change in the ChangeLog and we both wondered why even more XShm code was added in this time because XShm has lost its use due to the emergence of EXA-like display drivers. Modern drivers disable a large amount of hardware acceleration when using XShm because they can't create the pixmaps in video memory since the client owns the memory. This could decrease performance quite a bit for most applications if they aren't hit by dibsection back-and-forth copying bottlenecks. XRender for instance falls back to software rendering for non-video memory based pixmaps.
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
So, it hurts performance on applications that are running on modern drivers without using DIB sections, but helps for applications using DIB sections, or non-modern drivers?
Should probably disable by default and enable optionally with a registry key. The few that need it then have it available, without hurting the majority.
2009/8/10 Austin English austinenglish@gmail.com:
So, it hurts performance on applications that are running on modern drivers without using DIB sections, but helps for applications using DIB sections, or non-modern drivers?
No, XShm pixmaps are only used for DIB sections, if the application doesn't use those the XShm code isn't used either.
2009/8/9 Roderick Colenbrander thunderbird2k@gmail.com:
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
On Mon, Aug 10, 2009 at 10:24 AM, Henri Verbeethverbeet@gmail.com wrote:
2009/8/9 Roderick Colenbrander thunderbird2k@gmail.com:
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
It would be useful if some people using Nvidia, intel or EXA based drivers could compare the results of the test app attached to this mail with and without XShm. A test on ATI fglrx is not useful at this point because it doesn't use an EXA-like architecture yet and they don't accelerate XRender in hardware yet.
Thanks, Roderick
Am 10.08.2009 11:25, schrieb Roderick Colenbrander:
On Mon, Aug 10, 2009 at 10:24 AM, Henri Verbeethverbeet@gmail.com wrote:
2009/8/9 Roderick Colenbranderthunderbird2k@gmail.com:
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
It would be useful if some people using Nvidia, intel or EXA based drivers could compare the results of the test app attached to this mail with and without XShm. A test on ATI fglrx is not useful at this point because it doesn't use an EXA-like architecture yet and they don't accelerate XRender in hardware yet.
Thanks, Roderick
wine-1.1.27-40-g0c862de GeForce 8800 GTS/PCI/SSE2 - 3.1.0 NVIDIA 190.18 The test was build with "i686-pc-mingw32-gcc -m32 -o blt_test test.c -lgdi32 -lcomctl32", I couldn't get winegcc to compile it (path issues - wine is not installed, I'm running it from an out of tree build).
./configure --without-xshm stretchblt 1.0xStretch counts/blit=53 stretchblt 2xStretch counts/blit=39 stretchblt 1.0xStretch counts/blit=52 stretchblt 2xStretch counts/blit=35
./configure (normal) stretchblt 1.0xStretch counts/blit=50 stretchblt 2xStretch counts/blit=36 stretchblt 1.0xStretch counts/blit=52 stretchblt 2xStretch counts/blit=37
xp stretchblt 1.0xStretch counts/blit=22912 stretchblt 2xStretch counts/blit=159396
Why does the test run two times on wine and only one time on xp?
Cheers Rico
2009/8/10 Roderick Colenbrander thunderbird2k@gmail.com:
On Mon, Aug 10, 2009 at 10:24 AM, Henri Verbeethverbeet@gmail.com wrote:
2009/8/9 Roderick Colenbrander thunderbird2k@gmail.com:
I would perhaps suggest that we should perhaps drop XShm support (or at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
It would be useful if some people using Nvidia, intel or EXA based drivers could compare the results of the test app attached to this mail with and without XShm. A test on ATI fglrx is not useful at this point because it doesn't use an EXA-like architecture yet and they don't accelerate XRender in hardware yet.
$ uname -a Linux rowan 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686 GNU/Linux
$ lsb_release -i -r -s Ubuntu 9.04
$ cpuid | grep brand Extended brand string: "Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz"
$ lspci | grep nVidia 01:00.0 VGA compatible controller: nVidia Corporation GeForce 8600M GS (rev a1)
$ nvidia-settings -q all | grep Driver Attribute 'NvidiaDriverVersion' (rowan:0.0): 180.44
$ gcc --version gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
$ ossinfo Version info: OSS 4.1 (b 1052/200903240610) (0x00040100) Platform: Linux/i686 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 (rowan)
NOTE: Not using pulseaudio!
$ ./wine --version wine-1.1.27-40-g0c862de
$ ./configure --without-xshm && make && ./wine blttest.exe.so stretchblt 1.0xStretch counts/blit=57 stretchblt 2xStretch counts/blit=596 stretchblt 1.0xStretch counts/blit=61 stretchblt 2xStretch counts/blit=633
$ ./configure --with-xshm && make && ./wine blttest.exe.so stretchblt 1.0xStretch counts/blit=57 stretchblt 2xStretch counts/blit=589 stretchblt 1.0xStretch counts/blit=63 stretchblt 2xStretch counts/blit=632
Anything else you want me to try?
On 10.08.2009 12:24, Henri Verbeet wrote:
at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
Note that problem is only with *Shm*Pixmap*. *Shm*Image* is fine. So --without-xshm will disable too much.
AFAIR, with really modern nvidia drivers (>=180.x), Xserver should report 'ShmPixmap unsupported' in XShmQueryVersion (see driver's README about 'Option "AllowSHMPixmaps"'; check `xdpyinfo -ext MIT-SHM` to be sure); so new ShmPixmap code should be already no-op on nvidia and not cause pessimization ;-) [not sure about Intel and others; so, maybe, adding wine option still make sense].
On Mon, Aug 10, 2009 at 11:17 PM, Yuriy Kaminskiyyumkam@mail.ru wrote:
On 10.08.2009 12:24, Henri Verbeet wrote:
at least add a registry key for it and disable it perhaps on 'modern drivers'). What do you guys think?
Could you do some benchmarking? You can disable XShm support by passing "--without-xshm" to configure.
Note that problem is only with *Shm*Pixmap*. *Shm*Image* is fine. So --without-xshm will disable too much.
AFAIR, with really modern nvidia drivers (>=180.x), Xserver should report 'ShmPixmap unsupported' in XShmQueryVersion (see driver's README about 'Option "AllowSHMPixmaps"'; check `xdpyinfo -ext MIT-SHM` to be sure); so new ShmPixmap code should be already no-op on nvidia and not cause pessimization ;-) [not sure about Intel and others; so, maybe, adding wine option still make sense].
Thanks Yuriy I wasn't aware of the pixmap query in XShmQueryVersion, so apparently we already disable XShm on at least Nvidia drivers. Hopefully other drivers do the same, I should ask some Xorg developers.
The test I added is not really correct and doesn't stress the dibsection code. I would have to modify the test to render to the dibsection to do a better job.
Roderick