http://bugs.winehq.org/show_bug.cgi?id=13801
--- Comment #30 from Jan Ploski jpljpl@gmx.de 2008-09-20 09:27:16 --- (In reply to comment #29)
Overall, it seems to me like some sort of lock contention problem, with NtProtectVirtualMemory being called a lot of times from the execution path containing DrawTextExA, X11DRV_XRender_ExtTextOut, X11DRV_LockDIBSection, X11DRV_DIB_Coerce.
I have to retract that. Further experiments reveal that the locking mechanism per se does not cause trouble. The bad performance can be instead attributed to the call to XShmGetImage in X11DRV_DIB_GetImageBits (which is invoked a lot from X11DRV_DIB_Coerce when text rendering operations are performed). Commenting out just that call makes, like the previously described actions, all text disappear and restores good performance.
Elsewhere I read that XShmGetImage may be slow because of pixel data being stored directly in the video memory and having to be transferred to the main memory. Inspired by this explanation, I switched from the proprietary nvidia driver 96.43.07 (my video card is a GeForce4 MX 440 AGP) to the framebuffer device driver. Lo and behold, it also restored good performance! This workaround is easy and good enough for playing the TSE2 game, but probably too drastic in general. However, it could also be that the particular versions of the nvidia driver and video hardware are to blame, so it is recommended that other people try to reproduce this bug to help estimate its significance.