Always submit command buffers, even when there are no cliprects,
authorNicolai Haehnle <prefect_@gmx.net>
Fri, 18 Feb 2005 18:28:52 +0000 (18:28 +0000)
committerNicolai Haehnle <prefect_@gmx.net>
Fri, 18 Feb 2005 18:28:52 +0000 (18:28 +0000)
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.

src/mesa/drivers/dri/r300/r300_cmdbuf.c

index bdb417932b2589075f6854be2ec5ba2df75eb74a..a897149c2d0c5348b1225c18459853896750e435 100644 (file)
@@ -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;