From: Nicolai Haehnle Date: Fri, 18 Feb 2005 18:28:52 +0000 (+0000) Subject: Always submit command buffers, even when there are no cliprects, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8281cca82fb89001edd3e2360202e358bdc6bda7;p=mesa.git 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. --- 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;