diff options
author | Keith Whitwell <[email protected]> | 2010-08-20 15:14:19 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-08-25 10:29:27 +0100 |
commit | b6e03eafe3311142445ca42c1574d3f6998eecc3 (patch) | |
tree | 2cf79af5315a1e27fa295bc9281901bfcf3de3ae /src/gallium/drivers/llvmpipe/lp_fence.c | |
parent | 285ea417ef5ee1027d1e8dd03b069cb157105bf7 (diff) |
llvmpipe: fence debugging, add llvmpipe_finish
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_fence.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_fence.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c b/src/gallium/drivers/llvmpipe/lp_fence.c index f9805e5d688..4d549b07504 100644 --- a/src/gallium/drivers/llvmpipe/lp_fence.c +++ b/src/gallium/drivers/llvmpipe/lp_fence.c @@ -44,6 +44,7 @@ struct lp_fence * lp_fence_create(unsigned rank) { + static int fence_id; struct lp_fence *fence = CALLOC_STRUCT(lp_fence); pipe_reference_init(&fence->reference, 1); @@ -51,8 +52,12 @@ lp_fence_create(unsigned rank) pipe_mutex_init(fence->mutex); pipe_condvar_init(fence->signalled); + fence->id = fence_id++; fence->rank = rank; + if (LP_DEBUG & DEBUG_FENCE) + debug_printf("%s %d\n", __FUNCTION__, fence->id); + return fence; } @@ -61,6 +66,9 @@ lp_fence_create(unsigned rank) void lp_fence_destroy(struct lp_fence *fence) { + if (LP_DEBUG & DEBUG_FENCE) + debug_printf("%s %d\n", __FUNCTION__, fence->id); + pipe_mutex_destroy(fence->mutex); pipe_condvar_destroy(fence->signalled); FREE(fence); @@ -126,13 +134,17 @@ llvmpipe_fence_finish(struct pipe_screen *screen, void lp_fence_signal(struct lp_fence *fence) { + if (LP_DEBUG & DEBUG_FENCE) + debug_printf("%s %d\n", __FUNCTION__, fence->id); + pipe_mutex_lock(fence->mutex); fence->count++; assert(fence->count <= fence->rank); - LP_DBG(DEBUG_RAST, "%s count=%u rank=%u\n", __FUNCTION__, - fence->count, fence->rank); + if (LP_DEBUG & DEBUG_FENCE) + debug_printf("%s count=%u rank=%u\n", __FUNCTION__, + fence->count, fence->rank); pipe_condvar_signal(fence->signalled); |