gallium: add async flag to pipe_debug_callback
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Jul 2016 07:11:17 +0000 (09:11 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 8 Jul 2016 08:58:52 +0000 (10:58 +0200)
v2: fix typo db -> cb

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/clover/core/queue.cpp
src/mesa/state_tracker/st_debug.c

index ad7bf0f88db81dbe232e77e6a261d62c104eca5c..a73a77111a993bc84ed7ee66fd5319ba5dde4f94 100644 (file)
@@ -809,6 +809,12 @@ struct pipe_compute_state
  */
 struct pipe_debug_callback
 {
+   /**
+    * When set to \c true, the callback may be called asynchronously from a
+    * driver-created thread.
+    */
+   bool async;
+
    /**
     * Callback for the driver to report debug/performance/etc information back
     * to the state tracker.
index 24d71f186e0212510c6239816da3733b096777a1..c91b97ad15e94ba55081959475dd326317f3380b 100644 (file)
@@ -50,7 +50,10 @@ command_queue::command_queue(clover::context &ctx, clover::device &dev,
       throw error(CL_INVALID_DEVICE);
 
    if (ctx.notify) {
-      struct pipe_debug_callback cb = { &debug_notify_callback, this };
+      struct pipe_debug_callback cb;
+      memset(&cb, 0, sizeof(cb));
+      cb.debug_message = &debug_notify_callback;
+      cb.data = this;
       if (pipe->set_debug_callback)
          pipe->set_debug_callback(pipe, &cb);
    }
index eaf25490bd64d4287fece33e2ab4c2df39f08a93..214e22381480174a2570562fa154cfe4942b3cb7 100644 (file)
@@ -172,7 +172,10 @@ st_enable_debug_output(struct st_context *st, boolean enable)
       return;
 
    if (enable) {
-      struct pipe_debug_callback cb = { st_debug_message, st };
+      struct pipe_debug_callback cb;
+      memset(&cb, 0, sizeof(cb));
+      cb.debug_message = st_debug_message;
+      cb.data = st;
       pipe->set_debug_callback(pipe, &cb);
    } else {
       pipe->set_debug_callback(pipe, NULL);