diff options
author | Dave Airlie <[email protected]> | 2009-04-22 21:41:57 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2009-04-22 21:41:57 +1000 |
commit | 466c78c93538f2853449124c06274d538830cd5a (patch) | |
tree | a6bd88060ba328d8bed1ff2ea1a37ee741a90a17 /src/gallium/drivers/trace/tr_screen.h | |
parent | 65fe0c86ffcff99f9f09606d462bf3731ea0c308 (diff) | |
parent | f057f6543da469f231d551cb5728d98df8add4fa (diff) |
Merge remote branch 'origin/master' into radeon-rewrite
Diffstat (limited to 'src/gallium/drivers/trace/tr_screen.h')
-rw-r--r-- | src/gallium/drivers/trace/tr_screen.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h index 8c65516b509..59f254166d4 100644 --- a/src/gallium/drivers/trace/tr_screen.h +++ b/src/gallium/drivers/trace/tr_screen.h @@ -30,6 +30,7 @@ #include "pipe/p_screen.h" +#include "pipe/p_thread.h" #ifdef __cplusplus @@ -37,6 +38,11 @@ extern "C" { #endif +struct tr_list { + struct tr_list *next; + struct tr_list *prev; +}; + /** * It often happens that new data is written directly to the user buffers * without mapping/unmapping. This flag marks user buffers, so that their @@ -50,6 +56,18 @@ struct trace_screen struct pipe_screen base; struct pipe_screen *screen; + + pipe_mutex list_mutex; + int num_buffers; + int num_contexts; + int num_textures; + int num_surfaces; + int num_transfers; + struct tr_list buffers; + struct tr_list contexts; + struct tr_list textures; + struct tr_list surfaces; + struct tr_list transfers; }; @@ -65,6 +83,21 @@ void trace_screen_user_buffer_update(struct pipe_screen *screen, struct pipe_buffer *buffer); +#define trace_screen_add_to_list(tr_scr, name, obj) \ + do { \ + pipe_mutex_lock(tr_scr->list_mutex); \ + insert_at_head(&tr_scr->name, &obj->list); \ + tr_scr->num_##name++; \ + pipe_mutex_unlock(tr_scr->list_mutex); \ + } while (0) + +#define trace_screen_remove_from_list(tr_scr, name, obj) \ + do { \ + pipe_mutex_lock(tr_scr->list_mutex); \ + remove_from_list(&obj->list); \ + tr_scr->num_##name--; \ + pipe_mutex_unlock(tr_scr->list_mutex); \ + } while (0) #ifdef __cplusplus } |