On Tue, Sep 8, 2009 at 11:00 AM, Luc Verhaegen
On Tue, Sep 08, 2009 at 06:33:52AM -0700, Matthias Hopf wrote:
Commit against master at b00c0a75...: commit d8329927aaac5f2d4949785951326ebc782bc420 Author: Marc Dietrich
Date: Tue Sep 8 15:32:38 2009 +0200 Fix softlocks on rs690. Idle commands have to be flushed to be of any use.
diffstat: src/r5xx_exa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Hoping that this would finally fix the longstanding bug that was (of course) on my plate until i got laid off, i looked into this code a bit deeper.
What this patch does, in one case, is the following:
- RHDCSFlush(CS); RHDCSIdle(CS); R5xx2DIdle(pScrn); + RHDCSFlush(CS);
When one looks at this logically, it clearly is not anything one would want.
We need the CS queue to be empty here. We therefor flush the queue, wait for it to go idle and then also wait for the 2d engine to be fully idle afterwards.
Waiting for CS to be idle and then waiting for the 2d engine to go idle, and only then giving CS and the 2d engine something to do is rather wrong. Please check out the code behind the above calls to verify this.
Now, if this "seems" to fix the issue, then we might be barking up the right tree here.
It seems to be locked into the drm call DRM_RADEON_CP_IDLE. I have noticed some things about this call in the past and this is the comment that made it into the DRMCPIdle function in rhd_cs.c:
/* The DRM CP IDLE call does quite a lot more than just wait for the CP * going idle. It waits on the RBBM as well. This number needs to be huge, * as the DRM cluelessly uses loops instead of usecs, and this is therefor * decreasing rapidly with CPU advancement. */
Translation: Fast CPU, slow 2d engine, the loop inside the DRM driver, as even though it is marked as "number of usecs" it is a plain counter based loop, times out way too quickly.
It's not just a simple counter. The code in the drm calls udelay for each iteration of the loop. From radeon_cp.c: for (i = 0; i < dev_priv->usec_timeout; i++) { if (!(RADEON_READ(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE)) { radeon_do_pixcache_flush(dev_priv); return 0; } DRM_UDELAY(1); } Alex -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org