Bug#278654: xserver-xfree86: [r128] Problems with existing CCE idle fix
On Thu, Oct 28, 2004 at 09:30:04AM -0400, Daniel Jacobowitz wrote:
> Package: xserver-xfree86
> Version: 4.3.0.dfsg.1-8
> Severity: important
> Tags: patch
>
> When I submitted a patch for #236187 and related bugs, I was under the
> apparently very bad assumption that the idle would always eventually finish.
> Three times in the last month I've found X hung but the machine responsive
> on the network; this time I got a debugger attached, and found i == 31,
> j == 48503. However, with the addition of R128CCE_STOP, timing out isn't
> fatal to the X server - I poked the value of j with the debugger, and now my
> desktop is working again. So I suggest lowering the timeout, as in the
> attached replacement patch.
>
> With R128_TIMEOUT == 2000000, the loop's just not going to finish otherwise.
> My bad. The alternative would be to ignore the first lump of the patch and
> just add the call to R128CCE_STOP; that would probably work too, but trigger
> more often.
Ping? I'd like to have this simple patch applied, to resolve my
xscreensaver lockups.
> $Id: 009_ati_r128_retry_idle_until_timeout.diff 1535 2004-06-15 17:03:25Z branden $
>
> Attempt to mitigate serious DRI performance problems on Rage 128 chips by
> retrying CCE idle commands until the timeout is reached. See Debian
> #223089, #236187, #236373, #243436.
>
> This patch by Daniel Jacobowitz.
>
> Not submitted to XFree86 upstream.
>
> --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c~ 2004-06-01 12:17:33.000000000 -0500
> +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c 2004-06-01 12:21:37.000000000 -0500
> @@ -236,17 +236,23 @@
> i = 0;
> do {
> ret = drmCommandNone(info->drmFD, DRM_R128_CCE_IDLE);
> - } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
> + } while ( ret && errno == EBUSY && i++ < (R128_IDLE_RETRY * R128_IDLE_RETRY) );
>
> if (ret && ret != -EBUSY) {
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> "%s: CCE idle %d\n", __FUNCTION__, ret);
> }
>
> + if (i > R128_IDLE_RETRY) {
> + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> + "%s: (DEBUG) CCE idle took i = %d\n", __FUNCTION__, i);
> + }
> +
> if (ret == 0) return;
>
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> "Idle timed out, resetting engine...\n");
> + R128CCE_STOP(pScrn, info);
> R128EngineReset(pScrn);
>
> /* Always restart the engine when doing CCE 2D acceleration */
--
Daniel Jacobowitz
Reply to: