summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Haehnle <[email protected]>2005-02-18 18:28:52 +0000
committerNicolai Haehnle <[email protected]>2005-02-18 18:28:52 +0000
commit8281cca82fb89001edd3e2360202e358bdc6bda7 (patch)
tree40819f8336413e6b4d1539dcd1a05148e24bc066
parent4d73f1af35aed1483804b7a9639f231be1ee4bf1 (diff)
Always submit command buffers, even when there are no cliprects,
so that we no longer leak DMA buffers (plus, this just might fix some state-setting related problems, if there were any - but that's unlikely). Update the DRM to cope with cmdbuf->nbox == 0.
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index bdb417932b2..a897149c2d0 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -92,22 +92,15 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller)
cmd.boxes = (drm_clip_rect_t *)r300->radeon.pClipRects;
}
- if (cmd.nbox) {
- ret = drmCommandWrite(r300->radeon.dri.fd,
- DRM_RADEON_CMDBUF, &cmd, sizeof(cmd));
+ ret = drmCommandWrite(r300->radeon.dri.fd,
+ DRM_RADEON_CMDBUF, &cmd, sizeof(cmd));
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "Syncing in %s\n\n", __FUNCTION__);
- radeonWaitForIdleLocked(&r300->radeon);
- }
-
- r300->dma.nr_released_bufs = 0;
- } else {
- ret = 0;
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: No cliprects\n", __FUNCTION__);
+ if (RADEON_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "Syncing in %s\n\n", __FUNCTION__);
+ radeonWaitForIdleLocked(&r300->radeon);
}
+ r300->dma.nr_released_bufs = 0;
r300->cmdbuf.count_used = 0;
r300->cmdbuf.count_reemit = 0;