diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index 33756149ca3..ee2cc02ced1 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -41,6 +41,7 @@ #include "util/hash_table.h" #include "util/list.h" +#include "util/log.h" #include "util/simple_mtx.h" #include "util/u_debug.h" #include "util/u_atomic.h" @@ -176,17 +177,17 @@ struct fd_bo *fd_bo_new_ring(struct fd_device *dev, uint32_t size); bool fd_dbg(void); #define INFO_MSG(fmt, ...) \ - do { if (fd_dbg()) debug_printf("[I] "fmt " (%s:%d)\n", \ - ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0) + do { if (fd_dbg()) mesa_logi("%s:%d: "fmt, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) #define DEBUG_MSG(fmt, ...) \ - do if (enable_debug) { debug_printf("[D] "fmt " (%s:%d)\n", \ - ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0) + do if (enable_debug) { mesa_logd("%s:%d: "fmt, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) #define WARN_MSG(fmt, ...) \ - do { debug_printf("[W] "fmt " (%s:%d)\n", \ - ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0) + do { mesa_logw("%s:%d: "fmt, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) #define ERROR_MSG(fmt, ...) \ - do { debug_printf("[E] " fmt " (%s:%d)\n", \ - ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0) + do { mesa_loge("%s:%d: " fmt, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) #define U642VOID(x) ((void *)(unsigned long)(x)) #define VOID2U64(x) ((uint64_t)(unsigned long)(x)) diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index c8d066088b4..23221e22005 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -84,7 +84,7 @@ static uint32_t reg(struct ir3_register *reg, struct ir3_info *info, reg_t val = { .dummy32 = 0 }; if (reg->flags & ~valid_flags) { - debug_printf("INVALID FLAGS: %x vs %x\n", + mesa_logd("INVALID FLAGS: %x vs %x", reg->flags, valid_flags); } diff --git a/src/freedreno/ir3/ir3_compiler.h b/src/freedreno/ir3/ir3_compiler.h index 0c9a2a4bc75..65bf48f0eb3 100644 --- a/src/freedreno/ir3/ir3_compiler.h +++ b/src/freedreno/ir3/ir3_compiler.h @@ -28,6 +28,7 @@ #define IR3_COMPILER_H_ #include "util/disk_cache.h" +#include "util/log.h" #include "ir3.h" diff --git a/src/freedreno/ir3/ir3_context.h b/src/freedreno/ir3/ir3_context.h index 8cf2922f02c..b26159eb764 100644 --- a/src/freedreno/ir3/ir3_context.h +++ b/src/freedreno/ir3/ir3_context.h @@ -35,7 +35,7 @@ #define COND(bool, val) ((bool) ? (val) : 0) #define DBG(fmt, ...) \ - do { debug_printf("%s:%d: "fmt "\n", \ + do { mesa_logd("%s:%d: "fmt, \ __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) /** diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index bc5cb510b19..4cbe5f56e7d 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -172,14 +172,14 @@ compile_variant(struct ir3_shader_variant *v) { int ret = ir3_compile_shader_nir(v->shader->compiler, v); if (ret) { - _debug_printf("compile failed! (%s:%s)", v->shader->nir->info.name, + mesa_loge("compile failed! (%s:%s)", v->shader->nir->info.name, v->shader->nir->info.label); return false; } assemble_variant(v); if (!v->bin) { - _debug_printf("assemble failed! (%s:%s)", v->shader->nir->info.name, + mesa_loge("assemble failed! (%s:%s)", v->shader->nir->info.name, v->shader->nir->info.label); return false; } diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_query.c b/src/gallium/drivers/freedreno/a2xx/fd2_query.c index 5d04486bdd6..f56390a6738 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_query.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_query.c @@ -186,7 +186,7 @@ fd2_create_batch_query(struct pipe_context *pctx, /* verify valid query_type, ie. is it actually a perfcntr? */ if ((query_types[i] < FD_QUERY_FIRST_PERFCNTR) || (idx >= screen->num_perfcntr_queries)) { - debug_printf("invalid batch query query_type: %u\n", query_types[i]); + mesa_loge("invalid batch query query_type: %u", query_types[i]); goto error; } @@ -211,7 +211,7 @@ fd2_create_batch_query(struct pipe_context *pctx, if (counters_per_group[entry->gid] >= screen->perfcntr_groups[entry->gid].num_counters) { - debug_printf("too many counters for group %u\n", entry->gid); + mesa_loge("too many counters for group %u", entry->gid); goto error; } diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_query.c b/src/gallium/drivers/freedreno/a5xx/fd5_query.c index 05a05225317..2830e7bace7 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_query.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_query.c @@ -398,7 +398,7 @@ fd5_create_batch_query(struct pipe_context *pctx, /* verify valid query_type, ie. is it actually a perfcntr? */ if ((query_types[i] < FD_QUERY_FIRST_PERFCNTR) || (idx >= screen->num_perfcntr_queries)) { - debug_printf("invalid batch query query_type: %u\n", query_types[i]); + mesa_loge("invalid batch query query_type: %u", query_types[i]); goto error; } @@ -423,7 +423,7 @@ fd5_create_batch_query(struct pipe_context *pctx, if (counters_per_group[entry->gid] >= screen->perfcntr_groups[entry->gid].num_counters) { - debug_printf("too many counters for group %u\n", entry->gid); + mesa_loge("too many counters for group %u\n", entry->gid); goto error; } diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c index 47fe1307ef1..5aac4d5438b 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c @@ -334,7 +334,7 @@ update_vsc_pipe(struct fd_batch *batch) * frame: */ fd6_ctx->vsc_draw_strm_pitch = align(batch->draw_strm_bits/8, 0x4000); - debug_printf("pre-resize VSC_DRAW_STRM_PITCH to: 0x%x\n", + mesa_logd("pre-resize VSC_DRAW_STRM_PITCH to: 0x%x", fd6_ctx->vsc_draw_strm_pitch); } @@ -343,7 +343,7 @@ update_vsc_pipe(struct fd_batch *batch) fd_bo_del(fd6_ctx->vsc_prim_strm); fd6_ctx->vsc_prim_strm = NULL; fd6_ctx->vsc_prim_strm_pitch = align(batch->prim_strm_bits/8, 0x4000); - debug_printf("pre-resize VSC_PRIM_STRM_PITCH to: 0x%x\n", + mesa_logd("pre-resize VSC_PRIM_STRM_PITCH to: 0x%x", fd6_ctx->vsc_prim_strm_pitch); } @@ -464,7 +464,7 @@ check_vsc_overflow(struct fd_context *ctx) fd6_ctx->vsc_draw_strm = NULL; fd6_ctx->vsc_draw_strm_pitch *= 2; - debug_printf("resized VSC_DRAW_STRM_PITCH to: 0x%x\n", + mesa_logd("resized VSC_DRAW_STRM_PITCH to: 0x%x", fd6_ctx->vsc_draw_strm_pitch); } else if (buffer == 0x3) { @@ -479,7 +479,7 @@ check_vsc_overflow(struct fd_context *ctx) fd6_ctx->vsc_prim_strm = NULL; fd6_ctx->vsc_prim_strm_pitch *= 2; - debug_printf("resized VSC_PRIM_STRM_PITCH to: 0x%x\n", + mesa_logd("resized VSC_PRIM_STRM_PITCH to: 0x%x", fd6_ctx->vsc_prim_strm_pitch); } else { @@ -489,7 +489,7 @@ check_vsc_overflow(struct fd_context *ctx) * but maybe we should pre-emptively realloc vsc_data/vsc_data2 * and hope for different memory placement? */ - DBG("invalid vsc_overflow value: 0x%08x", vsc_overflow); + mesa_loge("invalid vsc_overflow value: 0x%08x", vsc_overflow); } } diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_query.c b/src/gallium/drivers/freedreno/a6xx/fd6_query.c index a23b02f4e0b..2e13fa61ce3 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_query.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_query.c @@ -591,7 +591,7 @@ fd6_create_batch_query(struct pipe_context *pctx, /* verify valid query_type, ie. is it actually a perfcntr? */ if ((query_types[i] < FD_QUERY_FIRST_PERFCNTR) || (idx >= screen->num_perfcntr_queries)) { - debug_printf("invalid batch query query_type: %u\n", query_types[i]); + mesa_loge("invalid batch query query_type: %u", query_types[i]); goto error; } @@ -616,7 +616,7 @@ fd6_create_batch_query(struct pipe_context *pctx, if (counters_per_group[entry->gid] >= screen->perfcntr_groups[entry->gid].num_counters) { - debug_printf("too many counters for group %u\n", entry->gid); + mesa_loge("too many counters for group %u", entry->gid); goto error; } diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index 23404197bf1..6e492e7461f 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -236,7 +236,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) /* emulate unsupported primitives: */ if (!fd_supported_prim(ctx, info->mode)) { if (ctx->streamout.num_targets > 0) - debug_error("stream-out with emulated prims"); + mesa_loge("stream-out with emulated prims"); util_primconvert_save_rasterizer_state(ctx->primconvert, ctx->rasterizer); util_primconvert_draw_vbo(ctx->primconvert, info); return; diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index c5be17bf710..6d0c1e906b7 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -496,7 +496,7 @@ fd_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capf param) case PIPE_CAPF_CONSERVATIVE_RASTER_DILATE_GRANULARITY: return 0.0f; } - debug_printf("unknown paramf %d\n", param); + mesa_loge("unknown paramf %d", param); return 0; } @@ -523,7 +523,7 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, break; return 0; default: - DBG("unknown shader type %d", shader); + mesa_loge("unknown shader type %d", shader); return 0; } @@ -636,7 +636,7 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, } return 0; } - debug_printf("unknown shader param %d\n", param); + mesa_loge("unknown shader param %d", param); return 0; } @@ -988,7 +988,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro) fd6_screen_init(pscreen); break; default: - debug_printf("unsupported GPU: a%03d\n", screen->gpu_id); + mesa_loge("unsupported GPU: a%03d", screen->gpu_id); goto fail; } diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index d17d80dc816..0407ce00efe 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -32,6 +32,7 @@ #include "pipe/p_format.h" #include "pipe/p_state.h" +#include "util/log.h" #include "util/u_debug.h" #include "util/u_math.h" #include "util/half_float.h" @@ -96,7 +97,7 @@ extern bool fd_binning_enabled; #define DBG(fmt, ...) \ do { if (fd_mesa_debug & FD_DBG_MSGS) \ - debug_printf("%s:%d: "fmt "\n", \ + mesa_logd("%s:%d: "fmt, \ __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) /* for conditionally setting boolean flag(s): */