radeon_bo_unref(rmesa->radeon.tcl.elt_dma_bo);
rmesa->radeon.tcl.elt_dma_bo = NULL;
- if (R200_ELT_BUF_SZ > elt_used)
- radeonReturnDmaRegion(rmesa, R200_ELT_BUF_SZ - elt_used);
-
if (R200_DEBUG & DEBUG_SYNC) {
fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
radeonFinish( rmesa->radeon.glCtx );
radeonEmitState(&rmesa->radeon);
- radeonAllocDmaRegion(&rmesa->radeon, &rmesa->radeon.tcl.elt_dma_bo,
- &rmesa->radeon.tcl.elt_dma_offset, R200_ELT_BUF_SZ, 4);
+ rmesa->radeon.tcl.elt_dma_bo = radeon_bo_open(rmesa->radeon.radeonScreen->bom,
+ 0, R200_ELT_BUF_SZ, 4,
+ RADEON_GEM_DOMAIN_GTT, 0);
+ rmesa->radeon.tcl.elt_dma_offset = 0;
rmesa->tcl.elt_used = min_nr * 2;
+ radeon_validate_bo(&rmesa->radeon, rmesa->radeon.tcl.elt_dma_bo,
+ RADEON_GEM_DOMAIN_GTT, 0);
+ if (radeon_revalidate_bos(rmesa->radeon.glCtx) == GL_FALSE)
+ fprintf(stderr,"failure to revalidate BOs - badness\n");
+
radeon_bo_map(rmesa->radeon.tcl.elt_dma_bo, 1);
retval = rmesa->radeon.tcl.elt_dma_bo->ptr + rmesa->radeon.tcl.elt_dma_offset;
+
if (R200_DEBUG & DEBUG_PRIMS)
fprintf(stderr, "%s: header prim %x \n",
__FUNCTION__, primitive);
size = MAX2(size, MAX_DMA_BUF_SZ);
if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
- fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->dma.nr_released_bufs);
+ fprintf(stderr, "%s\n", __FUNCTION__);
if (rmesa->dma.flush) {
rmesa->dma.flush(rmesa->glCtx);
rmesa->dma.nr_released_bufs = 0;
}
- radeonReleaseDmaRegion(rmesa);
+ if (rmesa->dma.current) {
+ radeon_bo_unmap(rmesa->dma.current);
+ radeon_bo_unref(rmesa->dma.current);
+ rmesa->dma.current = 0;
+ }
again_alloc:
rmesa->dma.current = radeon_bo_open(rmesa->radeonScreen->bom,
assert(rmesa->dma.current_used <= rmesa->dma.current->size);
}
-void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes)
-{
- if (!rmesa->dma.current)
- return;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, return_bytes);
- rmesa->dma.current_used -= return_bytes;
- rmesa->dma.current_vertexptr = rmesa->dma.current_used;
-}
-
void radeonReleaseDmaRegion(radeonContextPtr rmesa)
{
if (RADEON_DEBUG & DEBUG_IOCTL)
void rcommon_emit_vector(GLcontext * ctx, struct radeon_aos *aos,
GLvoid * data, int size, int stride, int count);
-void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes);
void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size);
void radeonAllocDmaRegion(radeonContextPtr rmesa,
struct radeon_bo **pbo, int *poffset,