diff options
author | Michel Dänzer <[email protected]> | 2009-09-21 10:48:32 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-09-21 10:48:32 +0200 |
commit | c67bb22fe7b4a7176efd9177d8de413d7c1a9192 (patch) | |
tree | 86539a3fc2d0a691d6729a5f00c356c7b6473217 /src/mesa/drivers/dri/radeon | |
parent | 774db70506670b4f4121b6697ac39abd184a56d9 (diff) | |
parent | 1d4dbd8d9b00cdba8c4aef4a3994d8763fea0dff (diff) |
Merge branch 'mesa_7_6_branch'
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_debug.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_debug.h | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_dma.c | 9 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c index 3b6f0038037..413000b6c06 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.c +++ b/src/mesa/drivers/dri/radeon/radeon_debug.c @@ -39,7 +39,7 @@ static const struct dri_debug_control debug_control[] = { {"fall", RADEON_FALLBACKS}, {"tex", RADEON_TEXTURE}, {"ioctl", RADEON_IOCTL}, - {"verts", RADEON_RENDER}, + {"verts", RADEON_VERTS}, {"render", RADEON_RENDER}, {"swrender", RADEON_SWRENDER}, {"state", RADEON_STATE}, diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.h b/src/mesa/drivers/dri/radeon/radeon_debug.h index 2a8302293b2..26da31c1c48 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.h +++ b/src/mesa/drivers/dri/radeon/radeon_debug.h @@ -149,21 +149,22 @@ static inline void radeon_debug_remove_indent(void) } } + /* From http://gcc. gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html . I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble with other compilers ... GLUE! */ -#define WARN_ONCE(a, ...) { \ - static int warn##__LINE__=1; \ - if(warn##__LINE__){ \ +#define WARN_ONCE(a, ...) do { \ + static int __warn_once=1; \ + if(__warn_once){ \ radeon_warning("*********************************WARN_ONCE*********************************\n"); \ radeon_warning("File %s function %s line %d\n", \ __FILE__, __FUNCTION__, __LINE__); \ radeon_warning( (a), ## __VA_ARGS__);\ radeon_warning("***************************************************************************\n"); \ - warn##__LINE__=0;\ + __warn_once=0;\ } \ - } + } while(0) #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index c9a32c808be..c6edbae9a1b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -207,7 +207,6 @@ again_alloc: counter on unused buffers for later freeing them from begin of list */ dma_bo = last_elem(&rmesa->dma.free); - assert(dma_bo->bo->cref == 1); remove_from_list(dma_bo); insert_at_head(&rmesa->dma.reserved, dma_bo); } @@ -307,6 +306,10 @@ static int radeon_bo_is_idle(struct radeon_bo* bo) WARN_ONCE("Your libdrm or kernel doesn't have support for busy query.\n" "This may cause small performance drop for you.\n"); } + /* Protect against bug in legacy bo handling that causes bos stay + * referenced even after they should be freed */ + if (bo->cref != 1) + return 0; return ret != -EBUSY; } @@ -343,7 +346,9 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) foreach_s(dma_bo, temp, &rmesa->dma.wait) { if (dma_bo->expire_counter == time) { WARN_ONCE("Leaking dma buffer object!\n"); - radeon_bo_unref(dma_bo->bo); + /* force free of buffer so we don't realy start + * leaking stuff now*/ + while ((dma_bo->bo = radeon_bo_unref(dma_bo->bo))) {} remove_from_list(dma_bo); FREE(dma_bo); continue; |