summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/driver_trace
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2019-07-04 11:41:41 -0400
committerIlia Mirkin <[email protected]>2019-07-22 22:13:51 -0400
commit0e30c6b8a7e84211bb417362ec73f24ef134ae34 (patch)
tree7567deb41938d64e8fadcac7514deece8f7c1613 /src/gallium/auxiliary/driver_trace
parent365f24705f9703962b6749f4fafe7cd92d9c60b1 (diff)
gallium: switch boolean -> bool at the interface definitions
This is a relatively minimal change to adjust all the gallium interfaces to use bool instead of boolean. I tried to avoid making unrelated changes inside of drivers to flip boolean -> bool to reduce the risk of regressions (the compiler will much more easily allow "dirty" values inside a char-based boolean than a C99 _Bool). This has been build-tested on amd64 with: Gallium drivers: nouveau r300 r600 radeonsi freedreno swrast etnaviv v3d vc4 i915 svga virgl swr panfrost iris lima kmsro Gallium st: mesa xa xvmc xvmc vdpau va Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/driver_trace')
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_context.c18
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_dump.c34
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_dump.h8
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_dump_defines.h2
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_public.h2
-rw-r--r--src/gallium/auxiliary/driver_trace/tr_screen.c18
6 files changed, 41 insertions, 41 deletions
diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c
index 70565db851d..232fea80504 100644
--- a/src/gallium/auxiliary/driver_trace/tr_context.c
+++ b/src/gallium/auxiliary/driver_trace/tr_context.c
@@ -167,13 +167,13 @@ trace_context_destroy_query(struct pipe_context *_pipe,
}
-static boolean
+static bool
trace_context_begin_query(struct pipe_context *_pipe,
struct pipe_query *query)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
- boolean ret;
+ bool ret;
query = trace_query_unwrap(query);
@@ -211,17 +211,17 @@ trace_context_end_query(struct pipe_context *_pipe,
}
-static boolean
+static bool
trace_context_get_query_result(struct pipe_context *_pipe,
struct pipe_query *_query,
- boolean wait,
+ bool wait,
union pipe_query_result *result)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
struct trace_query *tr_query = trace_query(_query);
struct pipe_query *query = tr_query->query;
- boolean ret;
+ bool ret;
trace_dump_call_begin("pipe_context", "get_query_result");
@@ -248,7 +248,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
static void
trace_context_set_active_query_state(struct pipe_context *_pipe,
- boolean enable)
+ bool enable)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
@@ -1356,7 +1356,7 @@ trace_context_fence_server_sync(struct pipe_context *_pipe,
}
-static inline boolean
+static inline bool
trace_context_generate_mipmap(struct pipe_context *_pipe,
struct pipe_resource *res,
enum pipe_format format,
@@ -1367,7 +1367,7 @@ trace_context_generate_mipmap(struct pipe_context *_pipe,
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
- boolean ret;
+ bool ret;
trace_dump_call_begin("pipe_context", "generate_mipmap");
@@ -1640,7 +1640,7 @@ trace_context_set_context_param(struct pipe_context *_context,
static void
trace_context_render_condition(struct pipe_context *_context,
struct pipe_query *query,
- boolean condition,
+ bool condition,
enum pipe_render_cond_flag mode)
{
struct trace_context *tr_context = trace_context(_context);
diff --git a/src/gallium/auxiliary/driver_trace/tr_dump.c b/src/gallium/auxiliary/driver_trace/tr_dump.c
index 185df214556..5bee07dd54e 100644
--- a/src/gallium/auxiliary/driver_trace/tr_dump.c
+++ b/src/gallium/auxiliary/driver_trace/tr_dump.c
@@ -57,11 +57,11 @@
#include "tr_texture.h"
-static boolean close_stream = FALSE;
+static bool close_stream = false;
static FILE *stream = NULL;
static mtx_t call_mutex = _MTX_INITIALIZER_NP;
static long unsigned call_no = 0;
-static boolean dumping = FALSE;
+static bool dumping = false;
static inline void
@@ -178,7 +178,7 @@ trace_dump_trace_close(void)
trace_dump_writes("</trace>\n");
if (close_stream) {
fclose(stream);
- close_stream = FALSE;
+ close_stream = false;
stream = NULL;
}
call_no = 0;
@@ -199,30 +199,30 @@ trace_dump_call_time(int64_t time)
}
-boolean
+bool
trace_dump_trace_begin(void)
{
const char *filename;
filename = debug_get_option("GALLIUM_TRACE", NULL);
if (!filename)
- return FALSE;
+ return false;
if (!stream) {
if (strcmp(filename, "stderr") == 0) {
- close_stream = FALSE;
+ close_stream = false;
stream = stderr;
}
else if (strcmp(filename, "stdout") == 0) {
- close_stream = FALSE;
+ close_stream = false;
stream = stdout;
}
else {
- close_stream = TRUE;
+ close_stream = true;
stream = fopen(filename, "wt");
if (!stream)
- return FALSE;
+ return false;
}
trace_dump_writes("<?xml version='1.0' encoding='UTF-8'?>\n");
@@ -236,12 +236,12 @@ trace_dump_trace_begin(void)
atexit(trace_dump_trace_close);
}
- return TRUE;
+ return true;
}
-boolean trace_dump_trace_enabled(void)
+bool trace_dump_trace_enabled(void)
{
- return stream ? TRUE : FALSE;
+ return stream ? true : false;
}
/*
@@ -264,15 +264,15 @@ void trace_dump_call_unlock(void)
void trace_dumping_start_locked(void)
{
- dumping = TRUE;
+ dumping = true;
}
void trace_dumping_stop_locked(void)
{
- dumping = FALSE;
+ dumping = false;
}
-boolean trace_dumping_enabled_locked(void)
+bool trace_dumping_enabled_locked(void)
{
return dumping;
}
@@ -291,9 +291,9 @@ void trace_dumping_stop(void)
mtx_unlock(&call_mutex);
}
-boolean trace_dumping_enabled(void)
+bool trace_dumping_enabled(void)
{
- boolean ret;
+ bool ret;
mtx_lock(&call_mutex);
ret = trace_dumping_enabled_locked();
mtx_unlock(&call_mutex);
diff --git a/src/gallium/auxiliary/driver_trace/tr_dump.h b/src/gallium/auxiliary/driver_trace/tr_dump.h
index 7a268e31c46..3c14edfc903 100644
--- a/src/gallium/auxiliary/driver_trace/tr_dump.h
+++ b/src/gallium/auxiliary/driver_trace/tr_dump.h
@@ -47,8 +47,8 @@ struct pipe_box;
*
* Opening the trace file and checking if that is opened.
*/
-boolean trace_dump_trace_begin(void);
-boolean trace_dump_trace_enabled(void);
+bool trace_dump_trace_begin(void);
+bool trace_dump_trace_enabled(void);
void trace_dump_trace_flush(void);
/*
@@ -68,10 +68,10 @@ void trace_dump_call_unlock(void);
*/
void trace_dumping_start_locked(void);
void trace_dumping_stop_locked(void);
-boolean trace_dumping_enabled_locked(void);
+bool trace_dumping_enabled_locked(void);
void trace_dumping_start(void);
void trace_dumping_stop(void);
-boolean trace_dumping_enabled(void);
+bool trace_dumping_enabled(void);
void trace_dump_call_begin_locked(const char *klass, const char *method);
void trace_dump_call_end_locked(void);
diff --git a/src/gallium/auxiliary/driver_trace/tr_dump_defines.h b/src/gallium/auxiliary/driver_trace/tr_dump_defines.h
index 7f969a30333..f6e94addfa1 100644
--- a/src/gallium/auxiliary/driver_trace/tr_dump_defines.h
+++ b/src/gallium/auxiliary/driver_trace/tr_dump_defines.h
@@ -50,7 +50,7 @@ trace_dump_query_type(unsigned value)
if (!trace_dumping_enabled_locked())
return;
- trace_dump_enum(util_str_query_type(value, FALSE));
+ trace_dump_enum(util_str_query_type(value, false));
}
diff --git a/src/gallium/auxiliary/driver_trace/tr_public.h b/src/gallium/auxiliary/driver_trace/tr_public.h
index b03133f8d97..648ead18746 100644
--- a/src/gallium/auxiliary/driver_trace/tr_public.h
+++ b/src/gallium/auxiliary/driver_trace/tr_public.h
@@ -40,7 +40,7 @@ struct pipe_context;
struct pipe_screen *
trace_screen_create(struct pipe_screen *screen);
-boolean
+bool
trace_enabled(void);
#ifdef __cplusplus
diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c
index d14d46d123f..41243cf72af 100644
--- a/src/gallium/auxiliary/driver_trace/tr_screen.c
+++ b/src/gallium/auxiliary/driver_trace/tr_screen.c
@@ -38,7 +38,7 @@
#include "tr_public.h"
-static boolean trace = FALSE;
+static bool trace = false;
static const char *
trace_screen_get_name(struct pipe_screen *_screen)
@@ -220,7 +220,7 @@ trace_screen_get_compute_param(struct pipe_screen *_screen,
}
-static boolean
+static bool
trace_screen_is_format_supported(struct pipe_screen *_screen,
enum pipe_format format,
enum pipe_texture_target target,
@@ -230,7 +230,7 @@ trace_screen_is_format_supported(struct pipe_screen *_screen,
{
struct trace_screen *tr_scr = trace_screen(_screen);
struct pipe_screen *screen = tr_scr->screen;
- boolean result;
+ bool result;
trace_dump_call_begin("pipe_screen", "is_format_supported");
@@ -390,7 +390,7 @@ trace_screen_check_resource_capability(struct pipe_screen *_screen,
return screen->check_resource_capability(screen, resource, bind);
}
-static boolean
+static bool
trace_screen_resource_get_handle(struct pipe_screen *_screen,
struct pipe_context *_pipe,
struct pipe_resource *resource,
@@ -532,7 +532,7 @@ trace_screen_fence_get_fd(struct pipe_screen *_screen,
}
-static boolean
+static bool
trace_screen_fence_finish(struct pipe_screen *_screen,
struct pipe_context *_ctx,
struct pipe_fence_handle *fence,
@@ -637,18 +637,18 @@ trace_screen_destroy(struct pipe_screen *_screen)
FREE(tr_scr);
}
-boolean
+bool
trace_enabled(void)
{
- static boolean firstrun = TRUE;
+ static bool firstrun = true;
if (!firstrun)
return trace;
- firstrun = FALSE;
+ firstrun = false;
if(trace_dump_trace_begin()) {
trace_dumping_start();
- trace = TRUE;
+ trace = true;
}
return trace;