Dear co-developers, Several months ago I noticed that even if I have working DMA, R128PutImage still eats lots of CPU, up to 26%, depending on video size. Several weeks ago I complained about this already, at that time it seemed to be a problem with aviplay or SDL. But since then I was able to reproduce it also with mplayer with -vo xv.
The best problem description I can give you is this like this: when the player is doing nothing for some time after returning from calling XvShmPutImage, top shows X doesn't eat any CPU. However, if it DOES do something (e.g. if I run a multithreaded player like aviplay or set high postprocessing level to mplayer), suddenly X eats 26% CPU. Even worse, if I disable dri (so that DMA isn't used for this function), it eats up to 50% !!!. This must have been introduced roughly in November. I remember it worked wonderfully right after Michel and I wrote the DMA patch in September, aviplay was able to eat 99% and X ate nothing. I remember now this isn't a hardware problem, I also had this before I upgraded the motherboard, just wasn't able to reproduce it predictably (now I CAN reproduce it anytime). You can reproduce it anytime as well, find a high quality divx and run a player (aviplay or mplayer), and run top over ssh, or perhaps even in another window. You'll notice that with no postprocessing and reasonably fast cpu (> 500MHz), everything is ok, but when you turn the postprocessing to the max, X will eat horribly lot of CPU. Setting postprocessing is easy, in aviplay you turn "autoquality" off in the config and while playing the file, right-click, choose properties and slide the slider. With mplayer, use -pp 0 or -pp 4. Zdenek's (aviplay maintainer) and my current theory is that calling the XvShmPutImage returns before it is actually run. A player then does XSync, so that I can actually see the picture appear on screen, and calling another X function until it's finished causes X to "hang" and this "eats" CPU time. Parameters to SDL_Init don't change anything and as I said, I am able to reproduce it with plain XvShmPutImage as well. This is most probably not XF86 related but specific to r128, because I don't remember upgrading X in between. In my hunt to exterminate this problem I upgraded to XF86 4.2.0 (I had cvs 4.1.99 or something like that 'till then), and cvs gatos from about a week a go. This didn't change anything. So, I'd be very happy if someone could tell me if Zdenek's and my assumption is right (that XvShmPutImage on r128 returns immediately and this was introduced around November last year), and how to fix it (or even perhaps fix it himself/herself, though I'm confident with a little hint I can do it myself). Thank you for your attention, Peter Surda (Shurdeek) <[EMAIL PROTECTED]>, ICQ 10236103, +436505122023 -- The best things in life are free, but the expensive ones are still worth a look.
msg02882/pgp00000.pgp
Description: PGP signature