diff options
author | Nicolai Haehnle <[email protected]> | 2005-02-18 18:57:38 +0000 |
---|---|---|
committer | Nicolai Haehnle <[email protected]> | 2005-02-18 18:57:38 +0000 |
commit | 3f22c0966dcc26b3a8310afd8baa238ab857b611 (patch) | |
tree | 1195df2a5e4999b8f557c174da5dbf2a53db86f9 /src | |
parent | 8281cca82fb89001edd3e2360202e358bdc6bda7 (diff) |
r300RefillCurrentDmaRegion: Retry buffer acquisition only once, after
waiting for the engine to idle. There's no way for another buffer to
become free anyway once the engine is idle.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index e8e044eab1c..de21bfc81b0 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -403,19 +403,24 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */ - while (1) { - ret = drmDMA(fd, &dma); - if (ret == 0) - break; + ret = drmDMA(fd, &dma); + if (ret != 0) { + /* Try to release some buffers and wait until we can't get any more */ if (rmesa->dma.nr_released_bufs) { r300FlushCmdBufLocked(rmesa, __FUNCTION__); } - if (rmesa->radeon.do_usleeps) { + if (RADEON_DEBUG & DEBUG_DMA) + fprintf(stderr, "Waiting for buffers\n"); + + radeonWaitForIdleLocked(&rmesa->radeon); + ret = drmDMA(fd, &dma); + + if (ret != 0) { UNLOCK_HARDWARE(&rmesa->radeon); - DO_USLEEP(1); - LOCK_HARDWARE(&rmesa->radeon); + fprintf(stderr, "Error: Could not get dma buffer... exiting\n"); + exit(-1); } } |