Keith, I implemented the smart waiting scheme we discussed yesterday. Just to get the purpose of the whole thing straight again: it is to minimize the amount of busy waiting as well as the number of lost IRQs. In that case the attached patch does a pretty good job.
The simple cases are when either the CPU clearly outpaces the GPU or vice versa. The worst case is if they run at about the same pace. Then small load changes lead to a lost IRQ or a couple of busy cycles each time the waiting scheme is switched. For this to work I had to got back to real busy waiting since usleep is just too slow. On my system usleep(1) takes quite exactly 20 ms. This lead to the following scenario for applications with framerates above 100: - render frame 1 - swap/flip (no waiting, no IRQ emitted) - render frame 2 - swap/flip (wait and emit IRQ) Both frames are completed by the time usleep returns and everything starts from the beginning. So all IRQs are lost and the frame rate is throttled to 100 fps. The new version uses usleep only if RADEON_NO_IRQS is set and RADEON_NO_USLEEPS is not set. Best regards, Felix __\|/__ ___ ___ ___ __Tschüß_______\_6 6_/___/__ \___/__ \___/___\___You can do anything,___ _____Felix_______\Ä/\ \_____\ \_____\ \______U___just not everything____ [EMAIL PROTECTED] >o<__/ \___/ \___/ at the same time!
radeon_smartwait.patch
Description: Binary data