diff options
author | Jerome Glisse <[email protected]> | 2006-11-02 20:02:26 +0000 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2006-11-02 20:02:26 +0000 |
commit | b6c2a6a0f295c078efc4737337ad67deaa7cee0a (patch) | |
tree | a5f3717654fb755acbea7c9b5bba0d23e1bd92f4 | |
parent | 94249ca333eef997f865d0e0862b913cec061c6c (diff) |
Add requested size to r300RefillCurrentDmaRegion.
This way we no longuer have the fixed RADEON_BUFFER_SIZE.
Anyway function calling AllocDmaRegion should check if this
succeed and fail gracefuly if not (see bug 8348).
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_context.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_mm.c | 2 |
4 files changed, 14 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 87276a11aed..0774a2af6b4 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -570,9 +570,10 @@ void r300Flush(GLcontext * ctx) #ifdef USER_BUFFERS #include "radeon_mm.h" -void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) +void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) { struct r300_dma_buffer *dmabuf; + size = MAX2(size, RADEON_BUFFER_SIZE*16); if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) fprintf(stderr, "%s\n", __FUNCTION__); @@ -591,20 +592,20 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) dmabuf->buf = (void *)1; /* hack */ dmabuf->refcount = 1; - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); if (dmabuf->id == 0) { LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */ r300FlushCmdBufLocked(rmesa, __FUNCTION__); radeonWaitForIdleLocked(&rmesa->radeon); - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); #ifdef HW_VBOS if (dmabuf->id == 0) { /* Just kick all */ r300_evict_vbos(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30); - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); } #endif UNLOCK_HARDWARE(&rmesa->radeon); @@ -617,7 +618,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) rmesa->dma.current.buf = dmabuf; rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id); - rmesa->dma.current.end = RADEON_BUFFER_SIZE*16; + rmesa->dma.current.end = size; rmesa->dma.current.start = 0; rmesa->dma.current.ptr = 0; } @@ -665,7 +666,8 @@ void r300AllocDmaRegion(r300ContextPtr rmesa, (rmesa->dma.current.ptr + alignment) & ~alignment; if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end) - r300RefillCurrentDmaRegion(rmesa); + r300RefillCurrentDmaRegion(rmesa, + (bytes + 0x7) & ~0x7); region->start = rmesa->dma.current.start; region->ptr = rmesa->dma.current.start; diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h index 5514214cc6b..52325646e9f 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ b/src/mesa/drivers/dri/r300/r300_ioctl.h @@ -50,7 +50,6 @@ extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, extern void r300Flush(GLcontext * ctx); -extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa); extern void r300ReleaseDmaRegion(r300ContextPtr rmesa, struct r300_dma_region *region, const char *caller); extern void r300AllocDmaRegion(r300ContextPtr rmesa, diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 62a6e1e5f79..9ddd2f4e282 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -267,12 +267,14 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, fprintf(stderr, "%s ctx %p\n", __FUNCTION__, radeon->glCtx); - if ( (radeon->dri.drawable != driDrawPriv) - || (radeon->dri.readable != driReadPriv) ) { - + if (radeon->dri.drawable != driDrawPriv) { driDrawableInitVBlank(driDrawPriv, radeon->vblank_flags, &radeon->vbl_seq); + } + + if (radeon->dri.drawable != driDrawPriv || + radeon->dri.readable != driReadPriv) { radeon->dri.drawable = driDrawPriv; radeon->dri.readable = driReadPriv; diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c index 7595d2144f7..f86a1b4e72e 100644 --- a/src/mesa/drivers/dri/r300/radeon_mm.c +++ b/src/mesa/drivers/dri/r300/radeon_mm.c @@ -213,7 +213,7 @@ int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size) } goto again; #else - WARN_ONCE("Ran out of GART memory!\nPlease consider adjusting GARTSize option.\n"); + WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size); return 0; #endif } |