util: Rename pipe_debug_message to util_debug_message

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
This commit is contained in:
Yonggang Luo 2022-03-31 04:21:45 +08:00 committed by Marge Bot
parent 240cd8088c
commit 523675e995
34 changed files with 44 additions and 44 deletions

View File

@ -103,7 +103,7 @@ _u_async_debug_drain(struct util_async_debug_callback *adbg,
for (unsigned i = 0; i < adbg->count; ++i) {
const struct util_debug_message *msg = &adbg->messages[i];
_pipe_debug_message(dst, msg->id, msg->type, "%s", msg->msg);
_util_debug_message(dst, msg->id, msg->type, "%s", msg->msg);
free(msg->msg);
}

View File

@ -757,7 +757,7 @@ struct crocus_context {
if (INTEL_DEBUG(DEBUG_PERF)) \
dbg_printf(__VA_ARGS__); \
if (unlikely(dbg)) \
pipe_debug_message(dbg, PERF_INFO, __VA_ARGS__); \
util_debug_message(dbg, PERF_INFO, __VA_ARGS__); \
} while(0)

View File

@ -380,7 +380,7 @@ dump_shader_info(struct etna_shader_variant *v, struct pipe_debug_callback *debu
if (!unlikely(etna_mesa_debug & ETNA_DBG_SHADERDB))
return;
pipe_debug_message(debug, SHADER_INFO,
util_debug_message(debug, SHADER_INFO,
"%s shader: %u instructions, %u temps, "
"%u immediates, %u loops",
etna_shader_stage(v),

View File

@ -122,7 +122,7 @@ extern bool fd_binning_enabled;
mesa_logw(__VA_ARGS__); \
struct pipe_debug_callback *__d = (debug); \
if (__d) \
pipe_debug_message(__d, type, __VA_ARGS__); \
util_debug_message(__d, type, __VA_ARGS__); \
} while (0)
#define perf_debug_ctx(ctx, ...) \

View File

@ -61,7 +61,7 @@ struct ir3_shader_state {
/**
* Should initial variants be compiled synchronously?
*
* The only case where pipe_debug_message() is used in the initial-variants
* The only case where util_debug_message() is used in the initial-variants
* path is with FD_MESA_DEBUG=shaderdb. So if either debug is disabled (ie.
* debug.debug_message==NULL), or shaderdb stats are not enabled, we can
* compile the initial shader variant asynchronously.
@ -80,7 +80,7 @@ dump_shader_info(struct ir3_shader_variant *v,
if (!FD_DBG(SHADERDB))
return;
pipe_debug_message(
util_debug_message(
debug, SHADER_INFO,
"%s shader: %u inst, %u nops, %u non-nops, %u mov, %u cov, "
"%u dwords, %u last-baryf, %u half, %u full, %u constlen, "

View File

@ -1042,7 +1042,7 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
memcpy(&ifs->program[decl_size], p->program,
program_size * sizeof(uint32_t));
pipe_debug_message(
util_debug_message(
&i915->debug, SHADER_INFO,
"%s shader: %d inst, %d tex, %d tex_indirect, %d temps, %d const",
_mesa_shader_stage_to_abbrev(MESA_SHADER_FRAGMENT), (int)program_size,

View File

@ -836,7 +836,7 @@ struct iris_context {
if (INTEL_DEBUG(DEBUG_PERF)) \
dbg_printf(__VA_ARGS__); \
if (unlikely(dbg)) \
pipe_debug_message(dbg, PERF_INFO, __VA_ARGS__); \
util_debug_message(dbg, PERF_INFO, __VA_ARGS__); \
} while(0)
struct pipe_context *

View File

@ -328,7 +328,7 @@ iris_fence_await(struct pipe_context *ctx,
* actually flushed and the seqno finally passes.
*/
if (fence->unflushed_ctx) {
pipe_debug_message(&ice->dbg, CONFORMANCE, "%s",
util_debug_message(&ice->dbg, CONFORMANCE, "%s",
"glWaitSync on unflushed fence from another context "
"is unlikely to work without kernel 5.8+\n");
}

View File

@ -440,7 +440,7 @@ static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp,
if (lima_debug & LIMA_DEBUG_SHADERDB)
fprintf(stderr, "SHADER-DB: %s\n", shaderdb);
pipe_debug_message(debug, SHADER_INFO, "%s", shaderdb);
util_debug_message(debug, SHADER_INFO, "%s", shaderdb);
free(shaderdb);
}

View File

@ -876,7 +876,7 @@ static void ppir_print_shader_db(struct nir_shader *nir, ppir_compiler *comp,
if (lima_debug & LIMA_DEBUG_SHADERDB)
fprintf(stderr, "SHADER-DB: %s\n", shaderdb);
pipe_debug_message(debug, SHADER_INFO, "%s", shaderdb);
util_debug_message(debug, SHADER_INFO, "%s", shaderdb);
free(shaderdb);
}

View File

@ -219,7 +219,7 @@ nouveau_fence_wait(struct nouveau_fence *fence, struct pipe_debug_callback *debu
do {
if (fence->state == NOUVEAU_FENCE_STATE_SIGNALLED) {
if (debug && debug->debug_message)
pipe_debug_message(debug, PERF_INFO,
util_debug_message(debug, PERF_INFO,
"stalled %.3f ms waiting for fence",
(os_time_get_nano() - start) / 1000000.f);
return true;

View File

@ -452,7 +452,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
prog->so = nv50_program_create_strmout_state(&info_out,
&prog->pipe.stream_output);
pipe_debug_message(debug, SHADER_INFO,
util_debug_message(debug, SHADER_INFO,
"type: %d, local: %d, shared: %d, gpr: %d, inst: %d, bytes: %d",
prog->type, info_out.bin.tlsSpace, info_out.bin.smemSize,
prog->max_gpr, info_out.bin.instructions,

View File

@ -1706,7 +1706,7 @@ nv50_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
if (info->src.box.width == 0 || info->src.box.height == 0 ||
info->dst.box.width == 0 || info->dst.box.height == 0) {
pipe_debug_message(&nv50->base.debug, ERROR,
util_debug_message(&nv50->base.debug, ERROR,
"Blit with zero-size src or dst box");
return;
}

View File

@ -93,7 +93,7 @@ nv50_vertex_state_create(struct pipe_context *pipe,
}
so->element[i].state = nv50_vertex_format[fmt].vtx;
so->need_conversion = true;
pipe_debug_message(&nouveau_context(pipe)->debug, FALLBACK,
util_debug_message(&nouveau_context(pipe)->debug, FALLBACK,
"Converting vertex element %d, no hw format %s",
i, util_format_name(ve->src_format));
}

View File

@ -751,7 +751,7 @@ nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
prog->tfb = nvc0_program_create_tfb_state(&info_out,
&prog->pipe.stream_output);
pipe_debug_message(debug, SHADER_INFO,
util_debug_message(debug, SHADER_INFO,
"type: %d, local: %d, shared: %d, gpr: %d, inst: %d, bytes: %d, cached: %zd",
prog->type, info_out.bin.tlsSpace, info_out.bin.smemSize,
prog->num_gprs, info_out.bin.instructions,

View File

@ -1611,7 +1611,7 @@ nvc0_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
if (info->src.box.width == 0 || info->src.box.height == 0 ||
info->dst.box.width == 0 || info->dst.box.height == 0) {
pipe_debug_message(&nvc0->base.debug, ERROR,
util_debug_message(&nvc0->base.debug, ERROR,
"Blit with zero-size src or dst box");
return;
}

View File

@ -96,7 +96,7 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
}
so->element[i].state = nvc0_vertex_format[fmt].vtx;
so->need_conversion = true;
pipe_debug_message(&nouveau_context(pipe)->debug, FALLBACK,
util_debug_message(&nouveau_context(pipe)->debug, FALLBACK,
"Converting vertex element %d, no hw format %s",
i, util_format_name(ve->src_format));
}

View File

@ -417,7 +417,7 @@ static void print_stats(struct radeon_compiler * c)
* only the FS has, becasue shader-db's report.py wants all shaders to
* have the same set.
*/
pipe_debug_message(c->debug, SHADER_INFO, "%s shader: %u inst, %u vinst, %u sinst, %u predicate, %u flowcontrol, %u loops, %u tex, %u presub, %u omod, %u temps, %u consts, %u lits",
util_debug_message(c->debug, SHADER_INFO, "%s shader: %u inst, %u vinst, %u sinst, %u predicate, %u flowcontrol, %u loops, %u tex, %u presub, %u omod, %u temps, %u consts, %u lits",
c->type == RC_VERTEX_PROGRAM ? "VS" : "FS",
s.num_insts, s.num_rgb_insts, s.num_alpha_insts, s.num_pred_insts,
s.num_fc_insts, s.num_loops, s.num_tex_insts, s.num_presub_ops,

View File

@ -382,7 +382,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
goto error;
}
pipe_debug_message(&rctx->b.debug, SHADER_INFO, "%s shader: %d dw, %d gprs, %d loops, %d cf, %d stack",
util_debug_message(&rctx->b.debug, SHADER_INFO, "%s shader: %d dw, %d gprs, %d loops, %d cf, %d stack",
_mesa_shader_stage_to_abbrev(tgsi_processor_to_shader_stage(processor)),
shader->shader.bc.ndw,
shader->shader.bc.ngpr,

View File

@ -941,7 +941,7 @@ static void si_shader_dump_disassembly(struct si_screen *screen,
* overhead, but on the plus side it simplifies
* parsing of resulting logs.
*/
pipe_debug_message(debug, SHADER_INFO, "Shader Disassembly Begin");
util_debug_message(debug, SHADER_INFO, "Shader Disassembly Begin");
uint64_t line = 0;
while (line < nbytes) {
@ -951,13 +951,13 @@ static void si_shader_dump_disassembly(struct si_screen *screen,
count = nl - (disasm + line);
if (count) {
pipe_debug_message(debug, SHADER_INFO, "%.*s", count, disasm + line);
util_debug_message(debug, SHADER_INFO, "%.*s", count, disasm + line);
}
line += count + 1;
}
pipe_debug_message(debug, SHADER_INFO, "Shader Disassembly End");
util_debug_message(debug, SHADER_INFO, "Shader Disassembly End");
}
if (file) {
@ -1034,7 +1034,7 @@ void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shad
si_shader_dump_disassembly(screen, &shader->binary, shader->selector->info.stage,
shader->wave_size, debug, "main", NULL);
pipe_debug_message(debug, SHADER_INFO,
util_debug_message(debug, SHADER_INFO,
"Shader Stats: SGPRS: %d VGPRS: %d Code Size: %d "
"LDS: %d Scratch: %d Max Waves: %d Spilled SGPRs: %d "
"Spilled VGPRs: %d PrivMem VGPRs: %d DivergentLoop: %d, InlineUniforms: %d, "

View File

@ -57,7 +57,7 @@ static void si_diagnostic_handler(LLVMDiagnosticInfoRef di, void *context)
char *description = LLVMGetDiagInfoDescription(di);
pipe_debug_message(diag->debug, SHADER_INFO, "LLVM diagnostic (%s): %s", severity_str,
util_debug_message(diag->debug, SHADER_INFO, "LLVM diagnostic (%s): %s", severity_str,
description);
if (severity == LLVMDSError) {
@ -105,7 +105,7 @@ bool si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary,
diag.retval = 1;
if (diag.retval != 0) {
pipe_debug_message(debug, SHADER_INFO, "LLVM compilation failed");
util_debug_message(debug, SHADER_INFO, "LLVM compilation failed");
return false;
}
}

View File

@ -113,7 +113,7 @@ softpipe_shader_db(struct pipe_context *pipe, const struct tgsi_token *tokens)
struct tgsi_shader_info info;
tgsi_scan_shader(tokens, &info);
pipe_debug_message(&softpipe->debug, SHADER_INFO, "%s shader: %d inst, %d loops, %d temps, %d const, %d imm",
util_debug_message(&softpipe->debug, SHADER_INFO, "%s shader: %d inst, %d loops, %d temps, %d const, %d imm",
_mesa_shader_stage_to_abbrev(tgsi_processor_to_shader_stage(info.processor)),
info.num_instructions,
info.opcode_count[TGSI_OPCODE_BGNLOOP],

View File

@ -291,7 +291,7 @@ svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl,
gen_nr,
gen_size, gen_func, &gen_buf);
if (ret == PIPE_OK) {
pipe_debug_message(&svga->debug.callback, PERF_INFO,
util_debug_message(&svga->debug.callback, PERF_INFO,
"generating temporary index buffer for drawing %s",
u_prim_name(prim));

View File

@ -278,11 +278,11 @@ emulate_logicop(struct svga_context *svga,
blend->rt[buffer].blendeq_alpha = blend->rt[buffer].blendeq;
if (logicop_func == PIPE_LOGICOP_XOR) {
pipe_debug_message(&svga->debug.callback, CONFORMANCE,
util_debug_message(&svga->debug.callback, CONFORMANCE,
"XOR logicop mode has limited support");
}
else if (logicop_func != PIPE_LOGICOP_COPY) {
pipe_debug_message(&svga->debug.callback, CONFORMANCE,
util_debug_message(&svga->debug.callback, CONFORMANCE,
"general logicops are not supported");
}
}

View File

@ -165,14 +165,14 @@ svga_create_depth_stencil_state(struct pipe_context *pipe,
ds->stencil_writemask = templ->stencil[1].writemask & 0xff;
if (templ->stencil[1].valuemask != templ->stencil[0].valuemask) {
pipe_debug_message(&svga->debug.callback, CONFORMANCE,
util_debug_message(&svga->debug.callback, CONFORMANCE,
"two-sided stencil mask not supported "
"(front=0x%x, back=0x%x)",
templ->stencil[0].valuemask,
templ->stencil[1].valuemask);
}
if (templ->stencil[1].writemask != templ->stencil[0].writemask) {
pipe_debug_message(&svga->debug.callback, CONFORMANCE,
util_debug_message(&svga->debug.callback, CONFORMANCE,
"two-sided stencil writemask not supported "
"(front=0x%x, back=0x%x)",
templ->stencil[0].writemask,

View File

@ -318,7 +318,7 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
if (!svga_update_state_retry(svga, SVGA_STATE_HW_DRAW)) {
static const char *msg = "State update failed, skipping draw call";
debug_printf("%s\n", msg);
pipe_debug_message(&svga->debug.callback, INFO, "%s", msg);
util_debug_message(&svga->debug.callback, INFO, "%s", msg);
goto done;
}
svga_hwtnl_set_fillmode(svga->hwtnl, svga->curr.rast->hw_fillmode);

View File

@ -411,7 +411,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe,
}
if (templ->poly_smooth) {
pipe_debug_message(&svga->debug.callback, CONFORMANCE,
util_debug_message(&svga->debug.callback, CONFORMANCE,
"GL_POLYGON_SMOOTH not supported");
}

View File

@ -136,7 +136,7 @@ update_need_pipeline(struct svga_context *svga, uint64_t dirty)
if (svga->state.sw.need_pipeline) {
assert(reason);
pipe_debug_message(&svga->debug.callback, FALLBACK,
util_debug_message(&svga->debug.callback, FALLBACK,
"Using semi-fallback for %s", reason);
}

View File

@ -478,7 +478,7 @@ struct svga_shader_emitter_v10
bool register_overflow; /**< Set if we exceed a VGPU10 register limit */
/* For pipe_debug_message */
/* For util_debug_message */
struct pipe_debug_callback svga_debug_callback;
/* current loop depth in shader */
@ -10609,7 +10609,7 @@ emit_barrier(struct svga_shader_emitter_v10 *emit,
* in shader, don't do anything for this opcode and continue rest
* of shader translation
*/
pipe_debug_message(&emit->svga_debug_callback, INFO,
util_debug_message(&emit->svga_debug_callback, INFO,
"barrier instruction is not supported in tessellation control shader\n");
return TRUE;
}

View File

@ -635,7 +635,7 @@ struct v3d_blend_state {
if (unlikely(V3D_DEBUG & V3D_DEBUG_PERF)) \
fprintf(stderr, __VA_ARGS__); \
if (unlikely(v3d->debug.debug_message)) \
pipe_debug_message(&v3d->debug, PERF_INFO, __VA_ARGS__); \
util_debug_message(&v3d->debug, PERF_INFO, __VA_ARGS__); \
} while (0)
static inline struct v3d_context *

View File

@ -348,7 +348,7 @@ v3d_shader_debug_output(const char *message, void *data)
{
struct v3d_context *v3d = data;
pipe_debug_message(&v3d->debug, SHADER_INFO, "%s", message);
util_debug_message(&v3d->debug, SHADER_INFO, "%s", message);
}
static void *

View File

@ -429,7 +429,7 @@ struct vc4_depth_stencil_alpha_state {
if (unlikely(vc4_debug & VC4_DEBUG_PERF)) \
fprintf(stderr, __VA_ARGS__); \
if (unlikely(vc4->debug.debug_message)) \
pipe_debug_message(&vc4->debug, PERF_INFO, __VA_ARGS__); \
util_debug_message(&vc4->debug, PERF_INFO, __VA_ARGS__); \
} while (0)
static inline struct vc4_context *

View File

@ -66,7 +66,7 @@ _debug_vprintf(const char *format, va_list ap)
void
_pipe_debug_message(struct pipe_debug_callback *cb,
_util_debug_message(struct pipe_debug_callback *cb,
unsigned *id,
enum pipe_debug_type type,
const char *fmt, ...)

View File

@ -266,10 +266,10 @@ void _debug_assert_fail(const char *expr,
/**
* Output a debug log message to the debug info callback.
*/
#define pipe_debug_message(cb, type, fmt, ...) do { \
#define util_debug_message(cb, type, fmt, ...) do { \
static unsigned id = 0; \
if ((cb) && (cb)->debug_message) { \
_pipe_debug_message(cb, &id, \
_util_debug_message(cb, &id, \
PIPE_DEBUG_TYPE_ ## type, \
fmt, ##__VA_ARGS__); \
} \
@ -278,7 +278,7 @@ void _debug_assert_fail(const char *expr,
struct pipe_debug_callback;
void
_pipe_debug_message(
_util_debug_message(
struct pipe_debug_callback *cb,
unsigned *id,
enum pipe_debug_type type,