i965: Move perf_debug and WARN_ONCE back to brw_context.h.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 26 Nov 2017 09:42:11 +0000 (01:42 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 28 Nov 2017 23:23:16 +0000 (15:23 -0800)
These were moved to src/intel/common/gen_debug.h, but they are not
common code.  They assume that brw_context or gl_context variables
exist, named brw or ctx.  That isn't remotely true outside of i965.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/common/gen_debug.h
src/mesa/drivers/dri/i965/brw_context.h

index ad62054ff2ac4d62f86c0e8f56c53177d68af052..da5b5a569d191b30cc53d21aa9e27ea179c63f1b 100644 (file)
@@ -100,35 +100,6 @@ extern uint64_t INTEL_DEBUG;
                dbg_printf(__VA_ARGS__);                        \
 } while(0)
 
-#define perf_debug(...) do {                                   \
-   static GLuint msg_id = 0;                                    \
-   if (unlikely(INTEL_DEBUG & DEBUG_PERF))                      \
-      dbg_printf(__VA_ARGS__);                                  \
-   if (brw->perf_debug)                                         \
-      _mesa_gl_debug(&brw->ctx, &msg_id,                        \
-                     MESA_DEBUG_SOURCE_API,                     \
-                     MESA_DEBUG_TYPE_PERFORMANCE,               \
-                     MESA_DEBUG_SEVERITY_MEDIUM,                \
-                     __VA_ARGS__);                              \
-} while(0)
-
-#define WARN_ONCE(cond, fmt...) do {                            \
-   if (unlikely(cond)) {                                        \
-      static bool _warned = false;                              \
-      static GLuint msg_id = 0;                                 \
-      if (!_warned) {                                           \
-         fprintf(stderr, "WARNING: ");                          \
-         fprintf(stderr, fmt);                                  \
-         _warned = true;                                        \
-                                                                \
-         _mesa_gl_debug(ctx, &msg_id,                           \
-                        MESA_DEBUG_SOURCE_API,                  \
-                        MESA_DEBUG_TYPE_OTHER,                  \
-                        MESA_DEBUG_SEVERITY_HIGH, fmt);         \
-      }                                                         \
-   }                                                            \
-} while (0)
-
 extern uint64_t intel_debug_flag_for_shader_stage(gl_shader_stage stage);
 
 extern void brw_process_intel_debug_variable(void);
index b3d7c6baf8ae62c71913d0e025e9ed5e6350b4f3..9de1219e6bf6c60cbeb6ddc4d7b809f19e55c521 100644 (file)
@@ -375,6 +375,35 @@ struct brw_cache {
    uint32_t next_offset;
 };
 
+#define perf_debug(...) do {                                    \
+   static GLuint msg_id = 0;                                    \
+   if (unlikely(INTEL_DEBUG & DEBUG_PERF))                      \
+      dbg_printf(__VA_ARGS__);                                  \
+   if (brw->perf_debug)                                         \
+      _mesa_gl_debug(&brw->ctx, &msg_id,                        \
+                     MESA_DEBUG_SOURCE_API,                     \
+                     MESA_DEBUG_TYPE_PERFORMANCE,               \
+                     MESA_DEBUG_SEVERITY_MEDIUM,                \
+                     __VA_ARGS__);                              \
+} while(0)
+
+#define WARN_ONCE(cond, fmt...) do {                            \
+   if (unlikely(cond)) {                                        \
+      static bool _warned = false;                              \
+      static GLuint msg_id = 0;                                 \
+      if (!_warned) {                                           \
+         fprintf(stderr, "WARNING: ");                          \
+         fprintf(stderr, fmt);                                  \
+         _warned = true;                                        \
+                                                                \
+         _mesa_gl_debug(ctx, &msg_id,                           \
+                        MESA_DEBUG_SOURCE_API,                  \
+                        MESA_DEBUG_TYPE_OTHER,                  \
+                        MESA_DEBUG_SEVERITY_HIGH, fmt);         \
+      }                                                         \
+   }                                                            \
+} while (0)
+
 /* Considered adding a member to this struct to document which flags
  * an update might raise so that ordering of the state atoms can be
  * checked or derived at runtime.  Dropped the idea in favor of having