[Mesa-dev] [PATCH 02/11] mesa: rename logging functions to reflect that they format strings

Mark Janes mark.a.janes at intel.com
Fri Dec 7 00:35:43 UTC 2018


In preparation for the definition of a function to log a formatted
string.
---
 src/mesa/drivers/dri/i915/intel_context.h     | 18 +++++------
 src/mesa/drivers/dri/i915/intel_fbo.c         | 10 +++---
 src/mesa/drivers/dri/i965/brw_context.h       | 18 +++++------
 src/mesa/drivers/dri/i965/genX_state_upload.c | 14 ++++----
 src/mesa/drivers/dri/i965/intel_fbo.c         | 10 +++---
 src/mesa/drivers/dri/i965/intel_screen.c      | 16 +++++-----
 src/mesa/main/bufferobj.c                     | 10 +++---
 src/mesa/main/errors.c                        | 28 ++++++++--------
 src/mesa/main/errors.h                        | 32 +++++++++----------
 src/mesa/main/fbobject.c                      | 10 +++---
 src/mesa/main/pipelineobj.c                   | 16 +++++-----
 src/mesa/state_tracker/st_debug.c             |  2 +-
 12 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h
index b79288d29bc..2ed1a1444e5 100644
--- a/src/mesa/drivers/dri/i915/intel_context.h
+++ b/src/mesa/drivers/dri/i915/intel_context.h
@@ -304,11 +304,11 @@ extern int INTEL_DEBUG;
    if (unlikely(INTEL_DEBUG & DEBUG_PERF))                      \
       dbg_printf(__VA_ARGS__);                                  \
    if (intel->perf_debug)                                       \
-      _mesa_gl_debug(&intel->ctx, &msg_id,                      \
-                     MESA_DEBUG_SOURCE_API,                     \
-                     MESA_DEBUG_TYPE_PERFORMANCE,               \
-                     MESA_DEBUG_SEVERITY_MEDIUM,                \
-                     __VA_ARGS__);                              \
+      _mesa_gl_debugf(&intel->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 {                            \
@@ -320,10 +320,10 @@ extern int INTEL_DEBUG;
          fprintf(stderr, fmt);                                  \
          _warned = true;                                        \
                                                                 \
-         _mesa_gl_debug(ctx, &msg_id,                           \
-                        MESA_DEBUG_SOURCE_API,                  \
-                        MESA_DEBUG_TYPE_OTHER,                  \
-                        MESA_DEBUG_SEVERITY_HIGH, fmt);         \
+         _mesa_gl_debugf(ctx, &msg_id,                          \
+                         MESA_DEBUG_SOURCE_API,                 \
+                         MESA_DEBUG_TYPE_OTHER,                 \
+                         MESA_DEBUG_SEVERITY_HIGH, fmt);        \
       }                                                         \
    }                                                            \
 } while (0)
diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
index 78e2c1e6614..880fd7cfba1 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -536,11 +536,11 @@ intel_finish_render_texture(struct gl_context * ctx, struct gl_renderbuffer *rb)
 #define fbo_incomplete(fb, ...) do {                                          \
       static GLuint msg_id = 0;                                               \
       if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) {    \
-         _mesa_gl_debug(ctx, &msg_id,                                         \
-                        MESA_DEBUG_SOURCE_API,                                \
-                        MESA_DEBUG_TYPE_OTHER,                                \
-                        MESA_DEBUG_SEVERITY_MEDIUM,                           \
-                        __VA_ARGS__);                                         \
+         _mesa_gl_debugf(ctx, &msg_id,                                        \
+                         MESA_DEBUG_SOURCE_API,                               \
+                         MESA_DEBUG_TYPE_OTHER,                               \
+                         MESA_DEBUG_SEVERITY_MEDIUM,                          \
+                         __VA_ARGS__);                                        \
       }                                                                       \
       DBG(__VA_ARGS__);                                                       \
       fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;                               \
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index e5d57dd8df1..7374eef9fb5 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -388,11 +388,11 @@ struct brw_cache {
    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__);                              \
+      _mesa_gl_debugf(&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 {                            \
@@ -404,10 +404,10 @@ struct brw_cache {
          fprintf(stderr, fmt);                                  \
          _warned = true;                                        \
                                                                 \
-         _mesa_gl_debug(ctx, &msg_id,                           \
-                        MESA_DEBUG_SOURCE_API,                  \
-                        MESA_DEBUG_TYPE_OTHER,                  \
-                        MESA_DEBUG_SEVERITY_HIGH, fmt);         \
+         _mesa_gl_debugf(ctx, &msg_id,                          \
+                         MESA_DEBUG_SOURCE_API,                 \
+                         MESA_DEBUG_TYPE_OTHER,                 \
+                         MESA_DEBUG_SEVERITY_HIGH, fmt);        \
       }                                                         \
    }                                                            \
 } while (0)
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 8e3fcbf12ec..6ea7b3758e1 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -3297,13 +3297,13 @@ genX(upload_push_constant_packets)(struct brw_context *brw)
 
                if (binding->BufferObject == ctx->Shared->NullBufferObj) {
                   static unsigned msg_id = 0;
-                  _mesa_gl_debug(ctx, &msg_id, MESA_DEBUG_SOURCE_API,
-                                 MESA_DEBUG_TYPE_UNDEFINED,
-                                 MESA_DEBUG_SEVERITY_HIGH,
-                                 "UBO %d unbound, %s shader uniform data "
-                                 "will be undefined.",
-                                 range->block,
-                                 _mesa_shader_stage_to_string(stage));
+                  _mesa_gl_debugf(ctx, &msg_id, MESA_DEBUG_SOURCE_API,
+                                  MESA_DEBUG_TYPE_UNDEFINED,
+                                  MESA_DEBUG_SEVERITY_HIGH,
+                                  "UBO %d unbound, %s shader uniform data "
+                                  "will be undefined.",
+                                  range->block,
+                                  _mesa_shader_stage_to_string(stage));
                   continue;
                }
 
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index 5bcd846a1bc..b3ba09f2174 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -632,11 +632,11 @@ intel_render_texture(struct gl_context * ctx,
 #define fbo_incomplete(fb, error_id, ...) do {                                          \
       static GLuint msg_id = 0;                                               \
       if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) {    \
-         _mesa_gl_debug(ctx, &msg_id,                                         \
-                        MESA_DEBUG_SOURCE_API,                                \
-                        MESA_DEBUG_TYPE_OTHER,                                \
-                        MESA_DEBUG_SEVERITY_MEDIUM,                           \
-                        __VA_ARGS__);                                         \
+         _mesa_gl_debugf(ctx, &msg_id,                                        \
+                         MESA_DEBUG_SOURCE_API,                               \
+                         MESA_DEBUG_TYPE_OTHER,                               \
+                         MESA_DEBUG_SEVERITY_MEDIUM,                          \
+                         __VA_ARGS__);                                        \
       }                                                                       \
       DBG(__VA_ARGS__);                                                       \
       fb->_Status = error_id;                                                 \
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 8838f977bb6..c0201357869 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -2396,10 +2396,10 @@ shader_debug_log_mesa(void *data, const char *fmt, ...)
 
    va_start(args, fmt);
    GLuint msg_id = 0;
-   _mesa_gl_vdebug(&brw->ctx, &msg_id,
-                   MESA_DEBUG_SOURCE_SHADER_COMPILER,
-                   MESA_DEBUG_TYPE_OTHER,
-                   MESA_DEBUG_SEVERITY_NOTIFICATION, fmt, args);
+   _mesa_gl_vdebugf(&brw->ctx, &msg_id,
+                    MESA_DEBUG_SOURCE_SHADER_COMPILER,
+                    MESA_DEBUG_TYPE_OTHER,
+                    MESA_DEBUG_SEVERITY_NOTIFICATION, fmt, args);
    va_end(args);
 }
 
@@ -2420,10 +2420,10 @@ shader_perf_log_mesa(void *data, const char *fmt, ...)
 
    if (brw->perf_debug) {
       GLuint msg_id = 0;
-      _mesa_gl_vdebug(&brw->ctx, &msg_id,
-                      MESA_DEBUG_SOURCE_SHADER_COMPILER,
-                      MESA_DEBUG_TYPE_PERFORMANCE,
-                      MESA_DEBUG_SEVERITY_MEDIUM, fmt, args);
+      _mesa_gl_vdebugf(&brw->ctx, &msg_id,
+                       MESA_DEBUG_SOURCE_SHADER_COMPILER,
+                       MESA_DEBUG_TYPE_PERFORMANCE,
+                       MESA_DEBUG_SEVERITY_MEDIUM, fmt, args);
    }
    va_end(args);
 }
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 534326858bb..c22f1986e7d 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -73,11 +73,11 @@ buffer_usage_warning(struct gl_context *ctx, GLuint *id, const char *fmt, ...)
    va_list args;
 
    va_start(args, fmt);
-   _mesa_gl_vdebug(ctx, id,
-                   MESA_DEBUG_SOURCE_API,
-                   MESA_DEBUG_TYPE_PERFORMANCE,
-                   MESA_DEBUG_SEVERITY_MEDIUM,
-                   fmt, args);
+   _mesa_gl_vdebugf(ctx, id,
+                    MESA_DEBUG_SOURCE_API,
+                    MESA_DEBUG_TYPE_PERFORMANCE,
+                    MESA_DEBUG_SEVERITY_MEDIUM,
+                    fmt, args);
    va_end(args);
 }
 
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index 30560ba047e..fad8cb59cae 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -217,13 +217,13 @@ should_output(struct gl_context *ctx, GLenum error, const char *fmtString)
 
 
 void
-_mesa_gl_vdebug(struct gl_context *ctx,
-                GLuint *id,
-                enum mesa_debug_source source,
-                enum mesa_debug_type type,
-                enum mesa_debug_severity severity,
-                const char *fmtString,
-                va_list args)
+_mesa_gl_vdebugf(struct gl_context *ctx,
+                 GLuint *id,
+                 enum mesa_debug_source source,
+                 enum mesa_debug_type type,
+                 enum mesa_debug_severity severity,
+                 const char *fmtString,
+                 va_list args)
 {
    char s[MAX_DEBUG_MESSAGE_LENGTH];
    int len;
@@ -240,16 +240,16 @@ _mesa_gl_vdebug(struct gl_context *ctx,
 
 
 void
-_mesa_gl_debug(struct gl_context *ctx,
-               GLuint *id,
-               enum mesa_debug_source source,
-               enum mesa_debug_type type,
-               enum mesa_debug_severity severity,
-               const char *fmtString, ...)
+_mesa_gl_debugf(struct gl_context *ctx,
+                GLuint *id,
+                enum mesa_debug_source source,
+                enum mesa_debug_type type,
+                enum mesa_debug_severity severity,
+                const char *fmtString, ...)
 {
    va_list args;
    va_start(args, fmtString);
-   _mesa_gl_vdebug(ctx, id, source, type, severity, fmtString, args);
+   _mesa_gl_vdebugf(ctx, id, source, type, severity, fmtString, args);
    va_end(args);
 }
 
diff --git a/src/mesa/main/errors.h b/src/mesa/main/errors.h
index 5911da2956f..3e2d56e7741 100644
--- a/src/mesa/main/errors.h
+++ b/src/mesa/main/errors.h
@@ -74,30 +74,30 @@ _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
                    const char *msg);
 
 extern void
-_mesa_gl_vdebug(struct gl_context *ctx,
+_mesa_gl_vdebugf(struct gl_context *ctx,
+                 GLuint *id,
+                 enum mesa_debug_source source,
+                 enum mesa_debug_type type,
+                 enum mesa_debug_severity severity,
+                 const char *fmtString,
+                 va_list args);
+
+extern void
+_mesa_gl_debugf(struct gl_context *ctx,
                 GLuint *id,
                 enum mesa_debug_source source,
                 enum mesa_debug_type type,
                 enum mesa_debug_severity severity,
-                const char *fmtString,
-                va_list args);
-
-extern void
-_mesa_gl_debug(struct gl_context *ctx,
-               GLuint *id,
-               enum mesa_debug_source source,
-               enum mesa_debug_type type,
-               enum mesa_debug_severity severity,
-               const char *fmtString, ...) PRINTFLIKE(6, 7);
+                const char *fmtString, ...) PRINTFLIKE(6, 7);
 
 #define _mesa_perf_debug(ctx, sev, ...) do {                              \
    static GLuint msg_id = 0;                                              \
    if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) {   \
-      _mesa_gl_debug(ctx, &msg_id,                                        \
-                     MESA_DEBUG_SOURCE_API,                               \
-                     MESA_DEBUG_TYPE_PERFORMANCE,                         \
-                     sev,                                                 \
-                     __VA_ARGS__);                                        \
+      _mesa_gl_debugf(ctx, &msg_id,                                       \
+                      MESA_DEBUG_SOURCE_API,                              \
+                      MESA_DEBUG_TYPE_PERFORMANCE,                        \
+                      sev,                                                \
+                      __VA_ARGS__);                                       \
    }                                                                      \
 } while (0)
 
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 68e0daf3423..a5b829c9ad2 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -674,11 +674,11 @@ fbo_incomplete(struct gl_context *ctx, const char *msg, int index)
 {
    static GLuint msg_id;
 
-   _mesa_gl_debug(ctx, &msg_id,
-                  MESA_DEBUG_SOURCE_API,
-                  MESA_DEBUG_TYPE_OTHER,
-                  MESA_DEBUG_SEVERITY_MEDIUM,
-                  "FBO incomplete: %s [%d]\n", msg, index);
+   _mesa_gl_debugf(ctx, &msg_id,
+                   MESA_DEBUG_SOURCE_API,
+                   MESA_DEBUG_TYPE_OTHER,
+                   MESA_DEBUG_SEVERITY_MEDIUM,
+                   "FBO incomplete: %s [%d]\n", msg, index);
 
    if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) {
       _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index b4ca14d7257..1fe1205fb52 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -1019,14 +1019,14 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
 
       static GLuint msg_id = 0;
 
-      _mesa_gl_debug(ctx, &msg_id,
-                     MESA_DEBUG_SOURCE_API,
-                     MESA_DEBUG_TYPE_PORTABILITY,
-                     MESA_DEBUG_SEVERITY_MEDIUM,
-                     "glValidateProgramPipeline: pipeline %u does not meet "
-                     "strict OpenGL ES 3.1 requirements and may not be "
-                     "portable across desktop hardware\n",
-                     pipe->Name);
+      _mesa_gl_debugf(ctx, &msg_id,
+                      MESA_DEBUG_SOURCE_API,
+                      MESA_DEBUG_TYPE_PORTABILITY,
+                      MESA_DEBUG_SEVERITY_MEDIUM,
+                      "glValidateProgramPipeline: pipeline %u does not meet "
+                      "strict OpenGL ES 3.1 requirements and may not be "
+                      "portable across desktop hardware\n",
+                      pipe->Name);
    }
 
    pipe->Validated = GL_TRUE;
diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c
index d6cb5cd57d8..27d50a17e5e 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -161,7 +161,7 @@ st_debug_message(void *data,
    default:
       unreachable("invalid debug type");
    }
-   _mesa_gl_vdebug(st->ctx, id, source, type, severity, fmt, args);
+   _mesa_gl_vdebugf(st->ctx, id, source, type, severity, fmt, args);
 }
 
 void
-- 
2.19.2



More information about the mesa-dev mailing list