summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-03-06 09:11:13 +0000
committerJosé Fonseca <[email protected]>2011-03-06 09:11:13 +0000
commite640eec9ba9e2ff0e462671f6a3c548d2e0c40cf (patch)
treeb9ad2c0b3d82bed3579cd4e174484553ca009f1e /src/gallium/drivers
parentdb6d0d9ebf20bfc16ebabd3ff9e8f560ac306210 (diff)
trace: Use pipe_static_mutex.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/trace/tr_dump.c16
-rw-r--r--src/gallium/drivers/trace/tr_dump.h5
-rw-r--r--src/gallium/drivers/trace/tr_screen.c2
3 files changed, 1 insertions, 22 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index 51a4ea96335..8a4ec20fb84 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -60,10 +60,9 @@
static struct os_stream *stream = NULL;
static unsigned refcount = 0;
-static pipe_mutex call_mutex;
+pipe_static_mutex(call_mutex);
static long unsigned call_no = 0;
static boolean dumping = FALSE;
-static boolean initialized = FALSE;
static INLINE void
@@ -225,26 +224,13 @@ trace_dump_trace_close(void)
stream = NULL;
refcount = 0;
call_no = 0;
- pipe_mutex_destroy(call_mutex);
}
}
-void trace_dump_init()
-{
- if (initialized)
- return;
-
- pipe_mutex_init(call_mutex);
- dumping = FALSE;
- initialized = TRUE;
-}
-
boolean trace_dump_trace_begin()
{
const char *filename;
- assert(initialized);
-
filename = debug_get_option("GALLIUM_TRACE", NULL);
if(!filename)
return FALSE;
diff --git a/src/gallium/drivers/trace/tr_dump.h b/src/gallium/drivers/trace/tr_dump.h
index 74c5e83e9e1..62b4fe429b1 100644
--- a/src/gallium/drivers/trace/tr_dump.h
+++ b/src/gallium/drivers/trace/tr_dump.h
@@ -43,11 +43,6 @@ struct pipe_transfer;
struct pipe_box;
/*
- * Call before use.
- */
-void trace_dump_init(void);
-
-/*
* Low level dumping controls.
*
* Opening the trace file and checking if that is opened.
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index c2de2daa883..7cfaab060f1 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -472,8 +472,6 @@ trace_enabled(void)
return trace;
firstrun = FALSE;
- trace_dump_init();
-
if(trace_dump_trace_begin()) {
trace_dumping_start();
trace = TRUE;