summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-05-12 20:11:37 +0100
committerJakob Bornecrantz <[email protected]>2010-05-12 20:15:23 +0100
commit53cbb81576671d6d39e6a353e79ebda2c512d735 (patch)
tree86affe2ce5b536a34b471a44daaf2a6c1059fb0c /src/gallium/drivers
parent5494332128da0b2826e85df5eeaa878bb5c30a4e (diff)
rbug: Add to all targets that link against trace
Also added calls to the create function in target helpers and in tr_drm.c the latter being a hack and should be replaced with the wrap screen target helper. But at least this way we don't regress.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/rbug/rbug_public.h3
-rw-r--r--src/gallium/drivers/rbug/rbug_screen.c6
-rw-r--r--src/gallium/drivers/trace/tr_drm.c6
-rw-r--r--src/gallium/drivers/trace/tr_public.h3
-rw-r--r--src/gallium/drivers/trace/tr_screen.h3
5 files changed, 16 insertions, 5 deletions
diff --git a/src/gallium/drivers/rbug/rbug_public.h b/src/gallium/drivers/rbug/rbug_public.h
index f3cb19a3405..b66740b49cd 100644
--- a/src/gallium/drivers/rbug/rbug_public.h
+++ b/src/gallium/drivers/rbug/rbug_public.h
@@ -34,4 +34,7 @@ struct pipe_context;
struct pipe_screen *
rbug_screen_create(struct pipe_screen *screen);
+boolean
+rbug_enabled(void);
+
#endif /* RBUG_PUBLIC_H */
diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
index acdb1f6dc01..7d7b9247c35 100644
--- a/src/gallium/drivers/rbug/rbug_screen.c
+++ b/src/gallium/drivers/rbug/rbug_screen.c
@@ -285,6 +285,12 @@ rbug_screen_fence_finish(struct pipe_screen *_screen,
flags);
}
+boolean
+rbug_enabled()
+{
+ return debug_get_option_rbug();
+}
+
struct pipe_screen *
rbug_screen_create(struct pipe_screen *screen)
{
diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c
index 0dc8cca2648..43a4b296de2 100644
--- a/src/gallium/drivers/trace/tr_drm.c
+++ b/src/gallium/drivers/trace/tr_drm.c
@@ -28,6 +28,8 @@
#include "state_tracker/drm_api.h"
#include "util/u_memory.h"
+#include "rbug/rbug_public.h"
+#include "tr_screen.h"
#include "tr_drm.h"
#include "tr_screen.h"
#include "tr_public.h"
@@ -61,7 +63,7 @@ trace_drm_create_screen(struct drm_api *_api, int fd,
screen = api->create_screen(api, fd, arg);
- return trace_screen_create(screen);
+ return trace_screen_create(rbug_screen_create(screen));
}
static void
@@ -84,7 +86,7 @@ trace_drm_create(struct drm_api *api)
if (!api)
goto error;
- if (!trace_enabled())
+ if (!trace_enabled() && !rbug_enabled())
goto error;
tr_api = CALLOC_STRUCT(trace_drm_api);
diff --git a/src/gallium/drivers/trace/tr_public.h b/src/gallium/drivers/trace/tr_public.h
index 62e217097d0..aee4937dd4f 100644
--- a/src/gallium/drivers/trace/tr_public.h
+++ b/src/gallium/drivers/trace/tr_public.h
@@ -38,6 +38,9 @@ struct pipe_context;
struct pipe_screen *
trace_screen_create(struct pipe_screen *screen);
+boolean
+trace_enabled(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h
index 9fadb0d70ac..3598ceaa20f 100644
--- a/src/gallium/drivers/trace/tr_screen.h
+++ b/src/gallium/drivers/trace/tr_screen.h
@@ -64,9 +64,6 @@ struct trace_screen
*/
-boolean
-trace_enabled(void);
-
struct trace_screen *
trace_screen(struct pipe_screen *screen);