util: Rename pipe_debug_callback to util_debug_callback

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:22:26 +08:00 committed by Marge Bot
parent 523675e995
commit 2ca6ef22f7
80 changed files with 140 additions and 140 deletions

View File

@ -403,7 +403,7 @@ Buffer mapping conclusions
* Buffer valid range tracking doesn't need to be fancy, "number of bytes * Buffer valid range tracking doesn't need to be fancy, "number of bytes
valid starting from 0" is sufficient for all examples found. valid starting from 0" is sufficient for all examples found.
* Use the ``pipe_debug_callback`` to report stalls on buffer mapping to ease * Use the ``util_debug_callback`` to report stalls on buffer mapping to ease
debug. debug.
* Buffer binding points are not useful for tuning buffer placement (See all the * Buffer binding points are not useful for tuning buffer placement (See all the

View File

@ -1951,7 +1951,7 @@ trace_context_set_context_param(struct pipe_context *_context,
} }
static void static void
trace_context_set_debug_callback(struct pipe_context *_context, const struct pipe_debug_callback *cb) trace_context_set_debug_callback(struct pipe_context *_context, const struct util_debug_callback *cb)
{ {
struct trace_context *tr_context = trace_context(_context); struct trace_context *tr_context = trace_context(_context);
struct pipe_context *context = tr_context->pipe; struct pipe_context *context = tr_context->pipe;

View File

@ -97,7 +97,7 @@ u_async_debug_cleanup(struct util_async_debug_callback *adbg)
void void
_u_async_debug_drain(struct util_async_debug_callback *adbg, _u_async_debug_drain(struct util_async_debug_callback *adbg,
struct pipe_debug_callback *dst) struct util_debug_callback *dst)
{ {
simple_mtx_lock(&adbg->lock); simple_mtx_lock(&adbg->lock);
for (unsigned i = 0; i < adbg->count; ++i) { for (unsigned i = 0; i < adbg->count; ++i) {

View File

@ -25,7 +25,7 @@
/** /**
* \file u_async_debug.h * \file u_async_debug.h
* Provides a helper implementation of pipe_debug_callback which allows debug * Provides a helper implementation of util_debug_callback which allows debug
* messages from non-application threads to be passed back to the application * messages from non-application threads to be passed back to the application
* thread. * thread.
*/ */
@ -48,7 +48,7 @@ struct util_debug_message {
}; };
struct util_async_debug_callback { struct util_async_debug_callback {
struct pipe_debug_callback base; struct util_debug_callback base;
simple_mtx_t lock; simple_mtx_t lock;
unsigned count; unsigned count;
@ -63,11 +63,11 @@ u_async_debug_cleanup(struct util_async_debug_callback *adbg);
void void
_u_async_debug_drain(struct util_async_debug_callback *adbg, _u_async_debug_drain(struct util_async_debug_callback *adbg,
struct pipe_debug_callback *dst); struct util_debug_callback *dst);
static inline void static inline void
u_async_debug_drain(struct util_async_debug_callback *adbg, u_async_debug_drain(struct util_async_debug_callback *adbg,
struct pipe_debug_callback *dst) struct util_debug_callback *dst)
{ {
/* Read the count without taking the lock to avoid atomics in the fast path. /* Read the count without taking the lock to avoid atomics in the fast path.
* We'll re-read the count after taking the lock. */ * We'll re-read the count after taking the lock. */

View File

@ -2769,7 +2769,7 @@ tc_dump_debug_state(struct pipe_context *_pipe, FILE *stream,
static void static void
tc_set_debug_callback(struct pipe_context *_pipe, tc_set_debug_callback(struct pipe_context *_pipe,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct threaded_context *tc = threaded_context(_pipe); struct threaded_context *tc = threaded_context(_pipe);
struct pipe_context *pipe = tc->pipe; struct pipe_context *pipe = tc->pipe;

View File

@ -83,7 +83,7 @@ struct crocus_growing_bo {
struct crocus_batch { struct crocus_batch {
struct crocus_context *ice; struct crocus_context *ice;
struct crocus_screen *screen; struct crocus_screen *screen;
struct pipe_debug_callback *dbg; struct util_debug_callback *dbg;
struct pipe_device_reset_callback *reset; struct pipe_device_reset_callback *reset;
/** What batch is this? (e.g. CROCUS_BATCH_RENDER/COMPUTE) */ /** What batch is this? (e.g. CROCUS_BATCH_RENDER/COMPUTE) */

View File

@ -740,7 +740,7 @@ __crocus_bo_unreference(struct crocus_bo *bo)
} }
static void static void
bo_wait_with_stall_warning(struct pipe_debug_callback *dbg, bo_wait_with_stall_warning(struct util_debug_callback *dbg,
struct crocus_bo *bo, struct crocus_bo *bo,
const char *action) const char *action)
{ {
@ -777,7 +777,7 @@ print_flags(unsigned flags)
} }
static void * static void *
crocus_bo_gem_mmap_legacy(struct pipe_debug_callback *dbg, crocus_bo_gem_mmap_legacy(struct util_debug_callback *dbg,
struct crocus_bo *bo, bool wc) struct crocus_bo *bo, bool wc)
{ {
struct crocus_bufmgr *bufmgr = bo->bufmgr; struct crocus_bufmgr *bufmgr = bo->bufmgr;
@ -800,7 +800,7 @@ crocus_bo_gem_mmap_legacy(struct pipe_debug_callback *dbg,
} }
static void * static void *
crocus_bo_gem_mmap_offset(struct pipe_debug_callback *dbg, struct crocus_bo *bo, crocus_bo_gem_mmap_offset(struct util_debug_callback *dbg, struct crocus_bo *bo,
bool wc) bool wc)
{ {
struct crocus_bufmgr *bufmgr = bo->bufmgr; struct crocus_bufmgr *bufmgr = bo->bufmgr;
@ -831,7 +831,7 @@ crocus_bo_gem_mmap_offset(struct pipe_debug_callback *dbg, struct crocus_bo *bo,
} }
static void * static void *
crocus_bo_gem_mmap(struct pipe_debug_callback *dbg, struct crocus_bo *bo, bool wc) crocus_bo_gem_mmap(struct util_debug_callback *dbg, struct crocus_bo *bo, bool wc)
{ {
struct crocus_bufmgr *bufmgr = bo->bufmgr; struct crocus_bufmgr *bufmgr = bo->bufmgr;
@ -842,7 +842,7 @@ crocus_bo_gem_mmap(struct pipe_debug_callback *dbg, struct crocus_bo *bo, bool w
} }
static void * static void *
crocus_bo_map_cpu(struct pipe_debug_callback *dbg, crocus_bo_map_cpu(struct util_debug_callback *dbg,
struct crocus_bo *bo, unsigned flags) struct crocus_bo *bo, unsigned flags)
{ {
/* We disallow CPU maps for writing to non-coherent buffers, as the /* We disallow CPU maps for writing to non-coherent buffers, as the
@ -900,7 +900,7 @@ crocus_bo_map_cpu(struct pipe_debug_callback *dbg,
} }
static void * static void *
crocus_bo_map_wc(struct pipe_debug_callback *dbg, crocus_bo_map_wc(struct util_debug_callback *dbg,
struct crocus_bo *bo, unsigned flags) struct crocus_bo *bo, unsigned flags)
{ {
if (!bo->map_wc) { if (!bo->map_wc) {
@ -953,7 +953,7 @@ crocus_bo_map_wc(struct pipe_debug_callback *dbg,
* tracking is handled on the buffer exchange instead. * tracking is handled on the buffer exchange instead.
*/ */
static void * static void *
crocus_bo_map_gtt(struct pipe_debug_callback *dbg, crocus_bo_map_gtt(struct util_debug_callback *dbg,
struct crocus_bo *bo, unsigned flags) struct crocus_bo *bo, unsigned flags)
{ {
struct crocus_bufmgr *bufmgr = bo->bufmgr; struct crocus_bufmgr *bufmgr = bo->bufmgr;
@ -1048,7 +1048,7 @@ can_map_cpu(struct crocus_bo *bo, unsigned flags)
} }
void * void *
crocus_bo_map(struct pipe_debug_callback *dbg, crocus_bo_map(struct util_debug_callback *dbg,
struct crocus_bo *bo, unsigned flags) struct crocus_bo *bo, unsigned flags)
{ {
if (bo->tiling_mode != I915_TILING_NONE && !(flags & MAP_RAW)) if (bo->tiling_mode != I915_TILING_NONE && !(flags & MAP_RAW))

View File

@ -35,7 +35,7 @@
struct crocus_batch; struct crocus_batch;
struct intel_device_info; struct intel_device_info;
struct pipe_debug_callback; struct util_debug_callback;
#define CROCUS_BINDER_SIZE (64 * 1024) #define CROCUS_BINDER_SIZE (64 * 1024)
#define CROCUS_MAX_BINDERS 100 #define CROCUS_MAX_BINDERS 100
@ -238,7 +238,7 @@ static inline void crocus_bo_unreference(struct crocus_bo *bo)
* This function will block waiting for any existing execution on the * This function will block waiting for any existing execution on the
* buffer to complete, first. The resulting mapping is returned. * buffer to complete, first. The resulting mapping is returned.
*/ */
MUST_CHECK void *crocus_bo_map(struct pipe_debug_callback *dbg, MUST_CHECK void *crocus_bo_map(struct util_debug_callback *dbg,
struct crocus_bo *bo, unsigned flags); struct crocus_bo *bo, unsigned flags);
/** /**

View File

@ -40,7 +40,7 @@
*/ */
static void static void
crocus_set_debug_callback(struct pipe_context *ctx, crocus_set_debug_callback(struct pipe_context *ctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct crocus_context *ice = (struct crocus_context *)ctx; struct crocus_context *ice = (struct crocus_context *)ctx;

View File

@ -442,7 +442,7 @@ struct crocus_context {
struct threaded_context *thrctx; struct threaded_context *thrctx;
/** A debug callback for KHR_debug output. */ /** A debug callback for KHR_debug output. */
struct pipe_debug_callback dbg; struct util_debug_callback dbg;
/** A device reset status callback for notifying that the GPU is hosed. */ /** A device reset status callback for notifying that the GPU is hosed. */
struct pipe_device_reset_callback reset; struct pipe_device_reset_callback reset;

View File

@ -261,7 +261,7 @@ struct crocus_surface {
*/ */
struct crocus_transfer { struct crocus_transfer {
struct threaded_transfer base; struct threaded_transfer base;
struct pipe_debug_callback *dbg; struct util_debug_callback *dbg;
void *buffer; void *buffer;
void *ptr; void *ptr;

View File

@ -680,7 +680,7 @@ crocus_get_default_l3_config(const struct intel_device_info *devinfo,
static void static void
crocus_shader_debug_log(void *data, unsigned *id, const char *fmt, ...) crocus_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
{ {
struct pipe_debug_callback *dbg = data; struct util_debug_callback *dbg = data;
va_list args; va_list args;
if (!dbg->debug_message) if (!dbg->debug_message)
@ -694,7 +694,7 @@ crocus_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
static void static void
crocus_shader_perf_log(void *data, unsigned *id, const char *fmt, ...) crocus_shader_perf_log(void *data, unsigned *id, const char *fmt, ...)
{ {
struct pipe_debug_callback *dbg = data; struct util_debug_callback *dbg = data;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);

View File

@ -613,7 +613,7 @@ etna_context_force_flush(struct etna_cmd_stream *stream, void *priv)
static void static void
etna_set_debug_callback(struct pipe_context *pctx, etna_set_debug_callback(struct pipe_context *pctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct etna_context *ctx = etna_context(pctx); struct etna_context *ctx = etna_context(pctx);

View File

@ -185,7 +185,7 @@ struct etna_context {
uint64_t rs_operations; uint64_t rs_operations;
} stats; } stats;
struct pipe_debug_callback debug; struct util_debug_callback debug;
int in_fence_fd; int in_fence_fd;
/* list of accumulated HW queries */ /* list of accumulated HW queries */

View File

@ -375,7 +375,7 @@ etna_shader_stage(struct etna_shader_variant *shader)
} }
static void static void
dump_shader_info(struct etna_shader_variant *v, struct pipe_debug_callback *debug) dump_shader_info(struct etna_shader_variant *v, struct util_debug_callback *debug)
{ {
if (!unlikely(etna_mesa_debug & ETNA_DBG_SHADERDB)) if (!unlikely(etna_mesa_debug & ETNA_DBG_SHADERDB))
return; return;
@ -430,7 +430,7 @@ fail:
struct etna_shader_variant * struct etna_shader_variant *
etna_shader_variant(struct etna_shader *shader, struct etna_shader_key key, etna_shader_variant(struct etna_shader *shader, struct etna_shader_key key,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
struct etna_shader_variant *v; struct etna_shader_variant *v;

View File

@ -95,7 +95,7 @@ etna_shader_update_vertex(struct etna_context *ctx);
struct etna_shader_variant * struct etna_shader_variant *
etna_shader_variant(struct etna_shader *shader, struct etna_shader_key key, etna_shader_variant(struct etna_shader *shader, struct etna_shader_key key,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
void void
etna_shader_init(struct pipe_context *pctx); etna_shader_init(struct pipe_context *pctx);

View File

@ -43,7 +43,7 @@ void fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring,
/* grouped together emit-state for prog/vertex/state emit: */ /* grouped together emit-state for prog/vertex/state emit: */
struct fd3_emit { struct fd3_emit {
struct pipe_debug_callback *debug; struct util_debug_callback *debug;
const struct fd_vertex_state *vtx; const struct fd_vertex_state *vtx;
const struct fd3_program_state *prog; const struct fd3_program_state *prog;
const struct pipe_draw_info *info; const struct pipe_draw_info *info;

View File

@ -41,7 +41,7 @@ void fd4_emit_gmem_restore_tex(struct fd_ringbuffer *ring, unsigned nr_bufs,
/* grouped together emit-state for prog/vertex/state emit: */ /* grouped together emit-state for prog/vertex/state emit: */
struct fd4_emit { struct fd4_emit {
struct pipe_debug_callback *debug; struct util_debug_callback *debug;
const struct fd_vertex_state *vtx; const struct fd_vertex_state *vtx;
const struct fd4_program_state *prog; const struct fd4_program_state *prog;
const struct pipe_draw_info *info; const struct pipe_draw_info *info;

View File

@ -41,7 +41,7 @@ struct fd_ringbuffer;
/* grouped together emit-state for prog/vertex/state emit: */ /* grouped together emit-state for prog/vertex/state emit: */
struct fd5_emit { struct fd5_emit {
struct pipe_debug_callback *debug; struct util_debug_callback *debug;
const struct fd_vertex_state *vtx; const struct fd_vertex_state *vtx;
const struct fd5_program_state *prog; const struct fd5_program_state *prog;
const struct pipe_draw_info *info; const struct pipe_draw_info *info;

View File

@ -402,7 +402,7 @@ fd_context_destroy(struct pipe_context *pctx)
static void static void
fd_set_debug_callback(struct pipe_context *pctx, fd_set_debug_callback(struct pipe_context *pctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct fd_context *ctx = fd_context(pctx); struct fd_context *ctx = fd_context(pctx);

View File

@ -436,7 +436,7 @@ struct fd_context {
*/ */
struct ir3_cache *shader_cache; struct ir3_cache *shader_cache;
struct pipe_debug_callback debug; struct util_debug_callback debug;
struct u_trace_context trace_context dt; struct u_trace_context trace_context dt;

View File

@ -120,7 +120,7 @@ extern bool fd_binning_enabled;
do { \ do { \
if (FD_DBG(PERF)) \ if (FD_DBG(PERF)) \
mesa_logw(__VA_ARGS__); \ mesa_logw(__VA_ARGS__); \
struct pipe_debug_callback *__d = (debug); \ struct util_debug_callback *__d = (debug); \
if (__d) \ if (__d) \
util_debug_message(__d, type, __VA_ARGS__); \ util_debug_message(__d, type, __VA_ARGS__); \
} while (0) } while (0)

View File

@ -87,7 +87,7 @@ ir3_cache_destroy(struct ir3_cache *cache)
struct ir3_program_state * struct ir3_program_state *
ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key, ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
uint32_t hash = key_hash(key); uint32_t hash = key_hash(key);
struct hash_entry *entry = struct hash_entry *entry =

View File

@ -77,7 +77,7 @@ void ir3_cache_destroy(struct ir3_cache *cache);
*/ */
struct ir3_program_state *ir3_cache_lookup(struct ir3_cache *cache, struct ir3_program_state *ir3_cache_lookup(struct ir3_cache *cache,
const struct ir3_cache_key *key, const struct ir3_cache_key *key,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
/* call when an API level state object is destroyed, to invalidate /* call when an API level state object is destroyed, to invalidate
* cache entries which reference that state object. * cache entries which reference that state object.

View File

@ -75,7 +75,7 @@ initial_variants_synchronous(struct fd_context *ctx)
static void static void
dump_shader_info(struct ir3_shader_variant *v, dump_shader_info(struct ir3_shader_variant *v,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
if (!FD_DBG(SHADERDB)) if (!FD_DBG(SHADERDB))
return; return;
@ -119,7 +119,7 @@ upload_shader_variant(struct ir3_shader_variant *v)
struct ir3_shader_variant * struct ir3_shader_variant *
ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key, ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
bool binning_pass, struct pipe_debug_callback *debug) bool binning_pass, struct util_debug_callback *debug)
{ {
struct ir3_shader_variant *v; struct ir3_shader_variant *v;
bool created = false; bool created = false;
@ -176,7 +176,7 @@ copy_stream_out(struct ir3_stream_output_info *i,
static void static void
create_initial_variants(struct ir3_shader_state *hwcso, create_initial_variants(struct ir3_shader_state *hwcso,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
struct ir3_shader *shader = hwcso->shader; struct ir3_shader *shader = hwcso->shader;
struct ir3_compiler *compiler = shader->compiler; struct ir3_compiler *compiler = shader->compiler;
@ -246,7 +246,7 @@ static void
create_initial_variants_async(void *job, void *gdata, int thread_index) create_initial_variants_async(void *job, void *gdata, int thread_index)
{ {
struct ir3_shader_state *hwcso = job; struct ir3_shader_state *hwcso = job;
struct pipe_debug_callback debug = {}; struct util_debug_callback debug = {};
create_initial_variants(hwcso, &debug); create_initial_variants(hwcso, &debug);
} }
@ -256,7 +256,7 @@ create_initial_compute_variants_async(void *job, void *gdata, int thread_index)
{ {
struct ir3_shader_state *hwcso = job; struct ir3_shader_state *hwcso = job;
struct ir3_shader *shader = hwcso->shader; struct ir3_shader *shader = hwcso->shader;
struct pipe_debug_callback debug = {}; struct util_debug_callback debug = {};
static struct ir3_shader_key key; /* static is implicitly zeroed */ static struct ir3_shader_key key; /* static is implicitly zeroed */
ir3_shader_variant(shader, key, false, &debug); ir3_shader_variant(shader, key, false, &debug);

View File

@ -41,7 +41,7 @@ struct ir3_shader_state;
struct ir3_shader_variant * struct ir3_shader_variant *
ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key, ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
bool binning_pass, struct pipe_debug_callback *debug); bool binning_pass, struct util_debug_callback *debug);
void *ir3_shader_compute_state_create(struct pipe_context *pctx, void *ir3_shader_compute_state_create(struct pipe_context *pctx,
const struct pipe_compute_state *cso); const struct pipe_compute_state *cso);

View File

@ -167,7 +167,7 @@ i915_destroy(struct pipe_context *pipe)
static void static void
i915_set_debug_callback(struct pipe_context *pipe, i915_set_debug_callback(struct pipe_context *pipe,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct i915_context *i915 = i915_context(pipe); struct i915_context *i915 = i915_context(pipe);

View File

@ -310,7 +310,7 @@ struct i915_context {
/** blitter/hw-clear */ /** blitter/hw-clear */
struct blitter_context *blitter; struct blitter_context *blitter;
struct pipe_debug_callback debug; struct util_debug_callback debug;
}; };
/* A flag for each frontend state object: /* A flag for each frontend state object:

View File

@ -63,7 +63,7 @@ enum iris_batch_name {
struct iris_batch { struct iris_batch {
struct iris_context *ice; struct iris_context *ice;
struct iris_screen *screen; struct iris_screen *screen;
struct pipe_debug_callback *dbg; struct util_debug_callback *dbg;
struct pipe_device_reset_callback *reset; struct pipe_device_reset_callback *reset;
/** What batch is this? (e.g. IRIS_BATCH_RENDER/COMPUTE) */ /** What batch is this? (e.g. IRIS_BATCH_RENDER/COMPUTE) */

View File

@ -1488,7 +1488,7 @@ iris_bo_unreference(struct iris_bo *bo)
} }
static void static void
bo_wait_with_stall_warning(struct pipe_debug_callback *dbg, bo_wait_with_stall_warning(struct util_debug_callback *dbg,
struct iris_bo *bo, struct iris_bo *bo,
const char *action) const char *action)
{ {
@ -1525,7 +1525,7 @@ print_flags(unsigned flags)
} }
static void * static void *
iris_bo_gem_mmap_legacy(struct pipe_debug_callback *dbg, struct iris_bo *bo) iris_bo_gem_mmap_legacy(struct util_debug_callback *dbg, struct iris_bo *bo)
{ {
struct iris_bufmgr *bufmgr = bo->bufmgr; struct iris_bufmgr *bufmgr = bo->bufmgr;
@ -1552,7 +1552,7 @@ iris_bo_gem_mmap_legacy(struct pipe_debug_callback *dbg, struct iris_bo *bo)
} }
static void * static void *
iris_bo_gem_mmap_offset(struct pipe_debug_callback *dbg, struct iris_bo *bo) iris_bo_gem_mmap_offset(struct util_debug_callback *dbg, struct iris_bo *bo)
{ {
struct iris_bufmgr *bufmgr = bo->bufmgr; struct iris_bufmgr *bufmgr = bo->bufmgr;
@ -1612,7 +1612,7 @@ iris_bo_gem_mmap_offset(struct pipe_debug_callback *dbg, struct iris_bo *bo)
} }
void * void *
iris_bo_map(struct pipe_debug_callback *dbg, iris_bo_map(struct util_debug_callback *dbg,
struct iris_bo *bo, unsigned flags) struct iris_bo *bo, unsigned flags)
{ {
struct iris_bufmgr *bufmgr = bo->bufmgr; struct iris_bufmgr *bufmgr = bo->bufmgr;

View File

@ -38,7 +38,7 @@
#include "pipebuffer/pb_slab.h" #include "pipebuffer/pb_slab.h"
struct intel_device_info; struct intel_device_info;
struct pipe_debug_callback; struct util_debug_callback;
struct isl_surf; struct isl_surf;
struct iris_syncobj; struct iris_syncobj;
@ -331,7 +331,7 @@ void iris_bo_unreference(struct iris_bo *bo);
* This function will block waiting for any existing execution on the * This function will block waiting for any existing execution on the
* buffer to complete, first. The resulting mapping is returned. * buffer to complete, first. The resulting mapping is returned.
*/ */
MUST_CHECK void *iris_bo_map(struct pipe_debug_callback *dbg, MUST_CHECK void *iris_bo_map(struct util_debug_callback *dbg,
struct iris_bo *bo, unsigned flags); struct iris_bo *bo, unsigned flags);
/** /**

View File

@ -42,7 +42,7 @@
*/ */
static void static void
iris_set_debug_callback(struct pipe_context *ctx, iris_set_debug_callback(struct pipe_context *ctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct iris_context *ice = (struct iris_context *)ctx; struct iris_context *ice = (struct iris_context *)ctx;
struct iris_screen *screen = (struct iris_screen *)ctx->screen; struct iris_screen *screen = (struct iris_screen *)ctx->screen;

View File

@ -582,7 +582,7 @@ struct iris_context {
struct threaded_context *thrctx; struct threaded_context *thrctx;
/** A debug callback for KHR_debug output. */ /** A debug callback for KHR_debug output. */
struct pipe_debug_callback dbg; struct util_debug_callback dbg;
/** A device reset status callback for notifying that the GPU is hosed. */ /** A device reset status callback for notifying that the GPU is hosed. */
struct pipe_device_reset_callback reset; struct pipe_device_reset_callback reset;

View File

@ -58,7 +58,7 @@
struct iris_threaded_compile_job { struct iris_threaded_compile_job {
struct iris_screen *screen; struct iris_screen *screen;
struct u_upload_mgr *uploader; struct u_upload_mgr *uploader;
struct pipe_debug_callback *dbg; struct util_debug_callback *dbg;
struct iris_uncompiled_shader *ish; struct iris_uncompiled_shader *ish;
struct iris_compiled_shader *shader; struct iris_compiled_shader *shader;
}; };
@ -1105,7 +1105,7 @@ iris_setup_binding_table(const struct intel_device_info *devinfo,
static void static void
iris_debug_recompile(struct iris_screen *screen, iris_debug_recompile(struct iris_screen *screen,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
const struct brw_base_prog_key *key) const struct brw_base_prog_key *key)
{ {
@ -1267,7 +1267,7 @@ iris_threaded_compile_job_delete(void *_job, UNUSED void *_gdata,
static void static void
iris_schedule_compile(struct iris_screen *screen, iris_schedule_compile(struct iris_screen *screen,
struct util_queue_fence *ready_fence, struct util_queue_fence *ready_fence,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_threaded_compile_job *job, struct iris_threaded_compile_job *job,
util_queue_execute_func execute) util_queue_execute_func execute)
@ -1299,7 +1299,7 @@ iris_schedule_compile(struct iris_screen *screen,
static void static void
iris_compile_vs(struct iris_screen *screen, iris_compile_vs(struct iris_screen *screen,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader) struct iris_compiled_shader *shader)
{ {
@ -1479,7 +1479,7 @@ static void
iris_compile_tcs(struct iris_screen *screen, iris_compile_tcs(struct iris_screen *screen,
struct hash_table *passthrough_ht, struct hash_table *passthrough_ht,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader) struct iris_compiled_shader *shader)
{ {
@ -1668,7 +1668,7 @@ iris_update_compiled_tcs(struct iris_context *ice)
static void static void
iris_compile_tes(struct iris_screen *screen, iris_compile_tes(struct iris_screen *screen,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader) struct iris_compiled_shader *shader)
{ {
@ -1807,7 +1807,7 @@ iris_update_compiled_tes(struct iris_context *ice)
static void static void
iris_compile_gs(struct iris_screen *screen, iris_compile_gs(struct iris_screen *screen,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader) struct iris_compiled_shader *shader)
{ {
@ -1941,7 +1941,7 @@ iris_update_compiled_gs(struct iris_context *ice)
static void static void
iris_compile_fs(struct iris_screen *screen, iris_compile_fs(struct iris_screen *screen,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader, struct iris_compiled_shader *shader,
struct brw_vue_map *vue_map) struct brw_vue_map *vue_map)
@ -2234,7 +2234,7 @@ iris_update_compiled_shaders(struct iris_context *ice)
static void static void
iris_compile_cs(struct iris_screen *screen, iris_compile_cs(struct iris_screen *screen,
struct u_upload_mgr *uploader, struct u_upload_mgr *uploader,
struct pipe_debug_callback *dbg, struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish, struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader) struct iris_compiled_shader *shader)
{ {
@ -2545,7 +2545,7 @@ iris_compile_shader(void *_job, UNUSED void *_gdata, UNUSED int thread_index)
struct iris_screen *screen = job->screen; struct iris_screen *screen = job->screen;
struct u_upload_mgr *uploader = job->uploader; struct u_upload_mgr *uploader = job->uploader;
struct pipe_debug_callback *dbg = job->dbg; struct util_debug_callback *dbg = job->dbg;
struct iris_uncompiled_shader *ish = job->ish; struct iris_uncompiled_shader *ish = job->ish;
struct iris_compiled_shader *shader = job->shader; struct iris_compiled_shader *shader = job->shader;

View File

@ -272,7 +272,7 @@ struct iris_surface {
*/ */
struct iris_transfer { struct iris_transfer {
struct threaded_transfer base; struct threaded_transfer base;
struct pipe_debug_callback *dbg; struct util_debug_callback *dbg;
void *buffer; void *buffer;
void *ptr; void *ptr;

View File

@ -688,7 +688,7 @@ iris_get_default_l3_config(const struct intel_device_info *devinfo,
static void static void
iris_shader_debug_log(void *data, unsigned *id, const char *fmt, ...) iris_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
{ {
struct pipe_debug_callback *dbg = data; struct util_debug_callback *dbg = data;
va_list args; va_list args;
if (!dbg->debug_message) if (!dbg->debug_message)
@ -702,7 +702,7 @@ iris_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
static void static void
iris_shader_perf_log(void *data, unsigned *id, const char *fmt, ...) iris_shader_perf_log(void *data, unsigned *id, const char *fmt, ...)
{ {
struct pipe_debug_callback *dbg = data; struct util_debug_callback *dbg = data;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);

View File

@ -424,7 +424,7 @@ static int gpir_glsl_type_size(enum glsl_base_type type)
} }
static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp, static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
const struct shader_info *info = &nir->info; const struct shader_info *info = &nir->info;
char *shaderdb; char *shaderdb;
@ -445,7 +445,7 @@ static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp,
} }
bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir, bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
nir_function_impl *func = nir_shader_get_entrypoint(nir); nir_function_impl *func = nir_shader_get_entrypoint(nir);
gpir_compiler *comp = gpir_compiler_create(prog, func->reg_alloc, func->ssa_alloc); gpir_compiler *comp = gpir_compiler_create(prog, func->reg_alloc, func->ssa_alloc);

View File

@ -54,13 +54,13 @@ struct lima_fs_compiled_shader;
/* gpir interface */ /* gpir interface */
bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir, bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
/* ppir interface */ /* ppir interface */
bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir, bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir,
struct ra_regs *ra, struct ra_regs *ra,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
struct ra_regs *ppir_regalloc_init(void *mem_ctx); struct ra_regs *ppir_regalloc_init(void *mem_ctx);
void lima_nir_lower_uniform_to_scalar(nir_shader *shader); void lima_nir_lower_uniform_to_scalar(nir_shader *shader);

View File

@ -860,7 +860,7 @@ static void ppir_add_ordering_deps(ppir_compiler *comp)
} }
static void ppir_print_shader_db(struct nir_shader *nir, ppir_compiler *comp, static void ppir_print_shader_db(struct nir_shader *nir, ppir_compiler *comp,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
const struct shader_info *info = &nir->info; const struct shader_info *info = &nir->info;
char *shaderdb; char *shaderdb;
@ -906,7 +906,7 @@ static void ppir_add_write_after_read_deps(ppir_compiler *comp)
bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir, bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir,
struct ra_regs *ra, struct ra_regs *ra,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
nir_function_impl *func = nir_shader_get_entrypoint(nir); nir_function_impl *func = nir_shader_get_entrypoint(nir);
ppir_compiler *comp = ppir_compiler_create(prog, func->reg_alloc, func->ssa_alloc); ppir_compiler *comp = ppir_compiler_create(prog, func->reg_alloc, func->ssa_alloc);

View File

@ -189,7 +189,7 @@ plb_pp_stream_compare(const void *key1, const void *key2)
static void static void
lima_set_debug_callback(struct pipe_context *pctx, lima_set_debug_callback(struct pipe_context *pctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct lima_context *ctx = lima_context(pctx); struct lima_context *ctx = lima_context(pctx);

View File

@ -275,7 +275,7 @@ struct lima_context {
int id; int id;
struct pipe_debug_callback debug; struct util_debug_callback debug;
unsigned index_offset; unsigned index_offset;
struct lima_resource *index_res; struct lima_resource *index_res;

View File

@ -15,7 +15,7 @@ struct nouveau_context {
struct nouveau_client *client; struct nouveau_client *client;
struct nouveau_pushbuf *pushbuf; struct nouveau_pushbuf *pushbuf;
struct pipe_debug_callback debug; struct util_debug_callback debug;
bool vbo_dirty; bool vbo_dirty;

View File

@ -204,7 +204,7 @@ nouveau_fence_kick(struct nouveau_fence *fence)
} }
bool bool
nouveau_fence_wait(struct nouveau_fence *fence, struct pipe_debug_callback *debug) nouveau_fence_wait(struct nouveau_fence *fence, struct util_debug_callback *debug)
{ {
struct nouveau_screen *screen = fence->screen; struct nouveau_screen *screen = fence->screen;
uint32_t spins = 0; uint32_t spins = 0;

View File

@ -11,7 +11,7 @@
#define NOUVEAU_FENCE_STATE_FLUSHED 3 #define NOUVEAU_FENCE_STATE_FLUSHED 3
#define NOUVEAU_FENCE_STATE_SIGNALLED 4 #define NOUVEAU_FENCE_STATE_SIGNALLED 4
struct pipe_debug_callback; struct util_debug_callback;
struct nouveau_fence_work { struct nouveau_fence_work {
struct list_head list; struct list_head list;
@ -37,7 +37,7 @@ void nouveau_fence_cleanup(struct nouveau_screen *);
bool nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *); bool nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *);
void nouveau_fence_update(struct nouveau_screen *, bool flushed); void nouveau_fence_update(struct nouveau_screen *, bool flushed);
void nouveau_fence_next(struct nouveau_screen *); void nouveau_fence_next(struct nouveau_screen *);
bool nouveau_fence_wait(struct nouveau_fence *, struct pipe_debug_callback *); bool nouveau_fence_wait(struct nouveau_fence *, struct util_debug_callback *);
bool nouveau_fence_signalled(struct nouveau_fence *); bool nouveau_fence_signalled(struct nouveau_fence *);
void nouveau_fence_unref_bo(void *data); /* generic unref bo callback */ void nouveau_fence_unref_bo(void *data); /* generic unref bo callback */

View File

@ -383,7 +383,7 @@ nouveau_screen_fini(struct nouveau_screen *screen)
static void static void
nouveau_set_debug_callback(struct pipe_context *pipe, nouveau_set_debug_callback(struct pipe_context *pipe,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct nouveau_context *context = nouveau_context(pipe); struct nouveau_context *context = nouveau_context(pipe);

View File

@ -323,7 +323,7 @@ nv50_program_create_strmout_state(const struct nv50_ir_prog_info_out *info,
bool bool
nv50_program_translate(struct nv50_program *prog, uint16_t chipset, nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
struct nv50_ir_prog_info *info; struct nv50_ir_prog_info *info;
struct nv50_ir_prog_info_out info_out = {}; struct nv50_ir_prog_info_out info_out = {};

View File

@ -123,7 +123,7 @@ struct nv50_program {
}; };
bool nv50_program_translate(struct nv50_program *, uint16_t chipset, bool nv50_program_translate(struct nv50_program *, uint16_t chipset,
struct pipe_debug_callback *); struct util_debug_callback *);
bool nv50_program_upload_code(struct nv50_context *, struct nv50_program *); bool nv50_program_upload_code(struct nv50_context *, struct nv50_program *);
void nv50_program_destroy(struct nv50_context *, struct nv50_program *); void nv50_program_destroy(struct nv50_context *, struct nv50_program *);

View File

@ -324,7 +324,7 @@ extern struct draw_stage *nvc0_draw_render_stage(struct nvc0_context *);
/* nvc0_program.c */ /* nvc0_program.c */
bool nvc0_program_translate(struct nvc0_program *, uint16_t chipset, bool nvc0_program_translate(struct nvc0_program *, uint16_t chipset,
struct disk_cache *, struct disk_cache *,
struct pipe_debug_callback *); struct util_debug_callback *);
bool nvc0_program_upload(struct nvc0_context *, struct nvc0_program *); bool nvc0_program_upload(struct nvc0_context *, struct nvc0_program *);
void nvc0_program_destroy(struct nvc0_context *, struct nvc0_program *); void nvc0_program_destroy(struct nvc0_context *, struct nvc0_program *);
void nvc0_program_library_upload(struct nvc0_context *); void nvc0_program_library_upload(struct nvc0_context *);

View File

@ -572,7 +572,7 @@ nvc0_program_dump(struct nvc0_program *prog)
bool bool
nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset, nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
struct disk_cache *disk_shader_cache, struct disk_cache *disk_shader_cache,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
struct blob blob; struct blob blob;
size_t cache_size; size_t cache_size;

View File

@ -43,7 +43,7 @@ struct radeon_compiler {
struct memory_pool Pool; struct memory_pool Pool;
struct rc_program Program; struct rc_program Program;
const struct rc_regalloc_state *regalloc_state; const struct rc_regalloc_state *regalloc_state;
struct pipe_debug_callback *debug; struct util_debug_callback *debug;
enum rc_program_type type; enum rc_program_type type;
unsigned Debug:2; unsigned Debug:2;
unsigned Error:1; unsigned Error:1;

View File

@ -370,7 +370,7 @@ static void r300_init_states(struct pipe_context *pipe)
static void static void
r300_set_debug_callback(struct pipe_context *context, r300_set_debug_callback(struct pipe_context *context,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct r300_context *r300 = r300_context(context); struct r300_context *r300 = r300_context(context);

View File

@ -547,7 +547,7 @@ struct r300_context {
/* Occlusion query. */ /* Occlusion query. */
struct r300_atom query_start; struct r300_atom query_start;
struct pipe_debug_callback debug; struct util_debug_callback debug;
/* The pointers to the first and the last atom. */ /* The pointers to the first and the last atom. */
struct r300_atom *first_dirty, *last_dirty; struct r300_atom *first_dirty, *last_dirty;

View File

@ -492,7 +492,7 @@ static enum pipe_reset_status r600_get_reset_status(struct pipe_context *ctx)
} }
static void r600_set_debug_callback(struct pipe_context *ctx, static void r600_set_debug_callback(struct pipe_context *ctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct r600_common_context *rctx = (struct r600_common_context *)ctx; struct r600_common_context *rctx = (struct r600_common_context *)ctx;

View File

@ -565,7 +565,7 @@ struct r600_common_context {
float sample_locations_8x[8][2]; float sample_locations_8x[8][2];
float sample_locations_16x[16][2]; float sample_locations_16x[16][2];
struct pipe_debug_callback debug; struct util_debug_callback debug;
struct pipe_device_reset_callback device_reset_callback; struct pipe_device_reset_callback device_reset_callback;
struct u_log_context *log; struct u_log_context *log;

View File

@ -113,7 +113,7 @@ static void si_create_compute_state_async(void *job, void *gdata, int thread_ind
struct si_shader_selector *sel = &program->sel; struct si_shader_selector *sel = &program->sel;
struct si_shader *shader = &program->shader; struct si_shader *shader = &program->shader;
struct ac_llvm_compiler *compiler; struct ac_llvm_compiler *compiler;
struct pipe_debug_callback *debug = &sel->compiler_ctx_state.debug; struct util_debug_callback *debug = &sel->compiler_ctx_state.debug;
struct si_screen *sscreen = sel->screen; struct si_screen *sscreen = sel->screen;
assert(!debug->debug_message || debug->async); assert(!debug->debug_message || debug->async);

View File

@ -404,7 +404,7 @@ static void si_emit_string_marker(struct pipe_context *ctx, const char *string,
u_log_printf(sctx->log, "\nString marker: %*s\n", len, string); u_log_printf(sctx->log, "\nString marker: %*s\n", len, string);
} }
static void si_set_debug_callback(struct pipe_context *ctx, const struct pipe_debug_callback *cb) static void si_set_debug_callback(struct pipe_context *ctx, const struct util_debug_callback *cb)
{ {
struct si_context *sctx = (struct si_context *)ctx; struct si_context *sctx = (struct si_context *)ctx;
struct si_screen *screen = sctx->screen; struct si_screen *screen = sctx->screen;

View File

@ -978,7 +978,7 @@ struct si_context {
void *cs_dcc_retile[32]; void *cs_dcc_retile[32];
void *cs_fmask_expand[3][2]; /* [log2(samples)-1][is_array] */ void *cs_fmask_expand[3][2]; /* [log2(samples)-1][is_array] */
struct si_screen *screen; struct si_screen *screen;
struct pipe_debug_callback debug; struct util_debug_callback debug;
struct ac_llvm_compiler compiler; /* only non-threaded compilation */ struct ac_llvm_compiler compiler; /* only non-threaded compilation */
struct si_shader_ctx_state fixed_func_tcs_shader; struct si_shader_ctx_state fixed_func_tcs_shader;
/* Offset 0: EOP flush number; Offset 4: GDS prim restart counter */ /* Offset 0: EOP flush number; Offset 4: GDS prim restart counter */

View File

@ -912,7 +912,7 @@ bool si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader
static void si_shader_dump_disassembly(struct si_screen *screen, static void si_shader_dump_disassembly(struct si_screen *screen,
const struct si_shader_binary *binary, const struct si_shader_binary *binary,
gl_shader_stage stage, unsigned wave_size, gl_shader_stage stage, unsigned wave_size,
struct pipe_debug_callback *debug, const char *name, struct util_debug_callback *debug, const char *name,
FILE *file) FILE *file)
{ {
struct ac_rtld_binary rtld_binary; struct ac_rtld_binary rtld_binary;
@ -1025,7 +1025,7 @@ static void si_calculate_max_simd_waves(struct si_shader *shader)
} }
void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shader *shader, void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shader *shader,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
const struct ac_shader_config *conf = &shader->config; const struct ac_shader_config *conf = &shader->config;
static const char *stages[] = {"VS", "TCS", "TES", "GS", "PS", "CS"}; static const char *stages[] = {"VS", "TCS", "TES", "GS", "PS", "CS"};
@ -1116,7 +1116,7 @@ const char *si_get_shader_name(const struct si_shader *shader)
} }
void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader, void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
struct pipe_debug_callback *debug, FILE *file, bool check_debug_option) struct util_debug_callback *debug, FILE *file, bool check_debug_option)
{ {
gl_shader_stage stage = shader->selector->info.stage; gl_shader_stage stage = shader->selector->info.stage;
@ -1498,7 +1498,7 @@ void si_update_shader_binary_info(struct si_shader *shader, nir_shader *nir)
} }
bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
struct si_shader_selector *sel = shader->selector; struct si_shader_selector *sel = shader->selector;
bool free_nir; bool free_nir;
@ -1636,7 +1636,7 @@ bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compi
static struct si_shader_part * static struct si_shader_part *
si_get_shader_part(struct si_screen *sscreen, struct si_shader_part **list, si_get_shader_part(struct si_screen *sscreen, struct si_shader_part **list,
gl_shader_stage stage, bool prolog, union si_shader_part_key *key, gl_shader_stage stage, bool prolog, union si_shader_part_key *key,
struct ac_llvm_compiler *compiler, struct pipe_debug_callback *debug, struct ac_llvm_compiler *compiler, struct util_debug_callback *debug,
void (*build)(struct si_shader_context *, union si_shader_part_key *), void (*build)(struct si_shader_context *, union si_shader_part_key *),
const char *name) const char *name)
{ {
@ -1716,7 +1716,7 @@ out:
} }
static bool si_get_vs_prolog(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, static bool si_get_vs_prolog(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug, struct si_shader *shader, struct util_debug_callback *debug,
struct si_shader *main_part, const struct si_vs_prolog_bits *key) struct si_shader *main_part, const struct si_vs_prolog_bits *key)
{ {
struct si_shader_selector *vs = main_part->selector; struct si_shader_selector *vs = main_part->selector;
@ -1740,7 +1740,7 @@ static bool si_get_vs_prolog(struct si_screen *sscreen, struct ac_llvm_compiler
* Select and compile (or reuse) vertex shader parts (prolog & epilog). * Select and compile (or reuse) vertex shader parts (prolog & epilog).
*/ */
static bool si_shader_select_vs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, static bool si_shader_select_vs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
return si_get_vs_prolog(sscreen, compiler, shader, debug, shader, &shader->key.ge.part.vs.prolog); return si_get_vs_prolog(sscreen, compiler, shader, debug, shader, &shader->key.ge.part.vs.prolog);
} }
@ -1749,7 +1749,7 @@ static bool si_shader_select_vs_parts(struct si_screen *sscreen, struct ac_llvm_
* Select and compile (or reuse) TCS parts (epilog). * Select and compile (or reuse) TCS parts (epilog).
*/ */
static bool si_shader_select_tcs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, static bool si_shader_select_tcs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
if (sscreen->info.chip_class >= GFX9) { if (sscreen->info.chip_class >= GFX9) {
struct si_shader *ls_main_part = shader->key.ge.part.tcs.ls->main_shader_part_ls; struct si_shader *ls_main_part = shader->key.ge.part.tcs.ls->main_shader_part_ls;
@ -1777,7 +1777,7 @@ static bool si_shader_select_tcs_parts(struct si_screen *sscreen, struct ac_llvm
* Select and compile (or reuse) GS parts (prolog). * Select and compile (or reuse) GS parts (prolog).
*/ */
static bool si_shader_select_gs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, static bool si_shader_select_gs_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
if (sscreen->info.chip_class >= GFX9) { if (sscreen->info.chip_class >= GFX9) {
struct si_shader *es_main_part; struct si_shader *es_main_part;
@ -1960,7 +1960,7 @@ void si_get_ps_epilog_key(struct si_shader *shader, union si_shader_part_key *ke
* Select and compile (or reuse) pixel shader parts (prolog & epilog). * Select and compile (or reuse) pixel shader parts (prolog & epilog).
*/ */
static bool si_shader_select_ps_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, static bool si_shader_select_ps_parts(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
union si_shader_part_key prolog_key; union si_shader_part_key prolog_key;
union si_shader_part_key epilog_key; union si_shader_part_key epilog_key;
@ -2072,7 +2072,7 @@ void si_fix_resource_usage(struct si_screen *sscreen, struct si_shader *shader)
} }
bool si_create_shader_variant(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_create_shader_variant(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug) struct si_shader *shader, struct util_debug_callback *debug)
{ {
struct si_shader_selector *sel = shader->selector; struct si_shader_selector *sel = shader->selector;
struct si_shader *mainp = *si_get_main_shader_part(sel, &shader->key); struct si_shader *mainp = *si_get_main_shader_part(sel, &shader->key);

View File

@ -324,7 +324,7 @@ struct si_compiler_ctx_state {
struct ac_llvm_compiler *compiler; struct ac_llvm_compiler *compiler;
/* Used if thread_index == -1 or if debug.async is true. */ /* Used if thread_index == -1 or if debug.async is true. */
struct pipe_debug_callback debug; struct util_debug_callback debug;
/* Used for creating the log string for gallium/ddebug. */ /* Used for creating the log string for gallium/ddebug. */
bool is_debug_context; bool is_debug_context;
@ -936,18 +936,18 @@ struct si_shader_part {
/* si_shader.c */ /* si_shader.c */
void si_update_shader_binary_info(struct si_shader *shader, nir_shader *nir); void si_update_shader_binary_info(struct si_shader *shader, nir_shader *nir);
bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug); struct si_shader *shader, struct util_debug_callback *debug);
bool si_create_shader_variant(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_create_shader_variant(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug); struct si_shader *shader, struct util_debug_callback *debug);
void si_shader_destroy(struct si_shader *shader); void si_shader_destroy(struct si_shader *shader);
unsigned si_shader_io_get_unique_index_patch(unsigned semantic); unsigned si_shader_io_get_unique_index_patch(unsigned semantic);
unsigned si_shader_io_get_unique_index(unsigned semantic, bool is_varying); unsigned si_shader_io_get_unique_index(unsigned semantic, bool is_varying);
bool si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader, bool si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader,
uint64_t scratch_va); uint64_t scratch_va);
void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader, void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
struct pipe_debug_callback *debug, FILE *f, bool check_debug_option); struct util_debug_callback *debug, FILE *f, bool check_debug_option);
void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shader *shader, void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shader *shader,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
void si_multiwave_lds_size_workaround(struct si_screen *sscreen, unsigned *lds_size); void si_multiwave_lds_size_workaround(struct si_screen *sscreen, unsigned *lds_size);
const char *si_get_shader_name(const struct si_shader *shader); const char *si_get_shader_name(const struct si_shader *shader);
void si_shader_binary_clean(struct si_shader_binary *binary); void si_shader_binary_clean(struct si_shader_binary *binary);
@ -959,7 +959,7 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen, struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
struct ac_llvm_compiler *compiler, struct ac_llvm_compiler *compiler,
struct si_shader_selector *gs_selector, struct si_shader_selector *gs_selector,
struct pipe_debug_callback *debug); struct util_debug_callback *debug);
/* si_shader_nir.c */ /* si_shader_nir.c */
void si_nir_opts(struct si_screen *sscreen, struct nir_shader *nir, bool first); void si_nir_opts(struct si_screen *sscreen, struct nir_shader *nir, bool first);

View File

@ -28,7 +28,7 @@
#include "ac_shader_abi.h" #include "ac_shader_abi.h"
#include "si_shader.h" #include "si_shader.h"
struct pipe_debug_callback; struct util_debug_callback;
struct si_shader_output_values { struct si_shader_output_values {
LLVMValueRef values[4]; LLVMValueRef values[4];
@ -196,7 +196,7 @@ bool gfx10_ngg_calculate_subgroup_info(struct si_shader *shader);
/* si_shader_llvm.c */ /* si_shader_llvm.c */
bool si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary, bool si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary,
struct ac_shader_config *conf, struct ac_llvm_compiler *compiler, struct ac_shader_config *conf, struct ac_llvm_compiler *compiler,
struct ac_llvm_context *ac, struct pipe_debug_callback *debug, struct ac_llvm_context *ac, struct util_debug_callback *debug,
gl_shader_stage stage, const char *name, bool less_optimized); gl_shader_stage stage, const char *name, bool less_optimized);
void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscreen, void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscreen,
struct ac_llvm_compiler *compiler, unsigned wave_size); struct ac_llvm_compiler *compiler, unsigned wave_size);
@ -226,7 +226,7 @@ void si_build_wrapper_function(struct si_shader_context *ctx, LLVMValueRef *part
bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shader, bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shader,
struct nir_shader *nir, bool free_nir, bool ngg_cull_shader); struct nir_shader *nir, bool free_nir, bool ngg_cull_shader);
bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug, struct si_shader *shader, struct util_debug_callback *debug,
struct nir_shader *nir, bool free_nir); struct nir_shader *nir, bool free_nir);
/* si_shader_llvm_gs.c */ /* si_shader_llvm_gs.c */

View File

@ -32,7 +32,7 @@
#include "util/u_memory.h" #include "util/u_memory.h"
struct si_llvm_diagnostics { struct si_llvm_diagnostics {
struct pipe_debug_callback *debug; struct util_debug_callback *debug;
unsigned retval; unsigned retval;
}; };
@ -70,7 +70,7 @@ static void si_diagnostic_handler(LLVMDiagnosticInfoRef di, void *context)
bool si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary, bool si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary,
struct ac_shader_config *conf, struct ac_llvm_compiler *compiler, struct ac_shader_config *conf, struct ac_llvm_compiler *compiler,
struct ac_llvm_context *ac, struct pipe_debug_callback *debug, struct ac_llvm_context *ac, struct util_debug_callback *debug,
gl_shader_stage stage, const char *name, bool less_optimized) gl_shader_stage stage, const char *name, bool less_optimized)
{ {
unsigned count = p_atomic_inc_return(&sscreen->num_compilations); unsigned count = p_atomic_inc_return(&sscreen->num_compilations);
@ -1087,7 +1087,7 @@ static void si_optimize_vs_outputs(struct si_shader_context *ctx)
} }
bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct pipe_debug_callback *debug, struct si_shader *shader, struct util_debug_callback *debug,
struct nir_shader *nir, bool free_nir) struct nir_shader *nir, bool free_nir)
{ {
struct si_shader_selector *sel = shader->selector; struct si_shader_selector *sel = shader->selector;

View File

@ -422,7 +422,7 @@ void si_preload_gs_rings(struct si_shader_context *ctx)
struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen, struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
struct ac_llvm_compiler *compiler, struct ac_llvm_compiler *compiler,
struct si_shader_selector *gs_selector, struct si_shader_selector *gs_selector,
struct pipe_debug_callback *debug) struct util_debug_callback *debug)
{ {
struct si_shader_context ctx; struct si_shader_context ctx;
struct si_shader *shader; struct si_shader *shader;

View File

@ -2375,7 +2375,7 @@ static void si_build_shader_variant(struct si_shader *shader, int thread_index,
struct si_shader_selector *sel = shader->selector; struct si_shader_selector *sel = shader->selector;
struct si_screen *sscreen = sel->screen; struct si_screen *sscreen = sel->screen;
struct ac_llvm_compiler *compiler; struct ac_llvm_compiler *compiler;
struct pipe_debug_callback *debug = &shader->compiler_ctx_state.debug; struct util_debug_callback *debug = &shader->compiler_ctx_state.debug;
if (thread_index >= 0) { if (thread_index >= 0) {
if (low_priority) { if (low_priority) {
@ -2825,7 +2825,7 @@ static void si_init_shader_selector_async(void *job, void *gdata, int thread_ind
struct si_shader_selector *sel = (struct si_shader_selector *)job; struct si_shader_selector *sel = (struct si_shader_selector *)job;
struct si_screen *sscreen = sel->screen; struct si_screen *sscreen = sel->screen;
struct ac_llvm_compiler *compiler; struct ac_llvm_compiler *compiler;
struct pipe_debug_callback *debug = &sel->compiler_ctx_state.debug; struct util_debug_callback *debug = &sel->compiler_ctx_state.debug;
assert(!debug->debug_message || debug->async); assert(!debug->debug_message || debug->async);
assert(thread_index >= 0); assert(thread_index >= 0);

View File

@ -181,7 +181,7 @@ softpipe_render_condition(struct pipe_context *pipe,
static void static void
softpipe_set_debug_callback(struct pipe_context *pipe, softpipe_set_debug_callback(struct pipe_context *pipe,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct softpipe_context *softpipe = softpipe_context(pipe); struct softpipe_context *softpipe = softpipe_context(pipe);

View File

@ -189,7 +189,7 @@ struct softpipe_context {
*/ */
struct softpipe_tex_tile_cache *tex_cache[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS]; struct softpipe_tex_tile_cache *tex_cache[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct pipe_debug_callback debug; struct util_debug_callback debug;
}; };

View File

@ -591,7 +591,7 @@ struct svga_context
boolean force_hw_line_stipple; boolean force_hw_line_stipple;
/** To report perf/conformance/etc issues to the gallium frontend */ /** To report perf/conformance/etc issues to the gallium frontend */
struct pipe_debug_callback callback; struct util_debug_callback callback;
} debug; } debug;
struct { struct {

View File

@ -225,7 +225,7 @@ svga_set_viewport_states(struct pipe_context *pipe,
*/ */
static void static void
svga_set_debug_callback(struct pipe_context *pipe, svga_set_debug_callback(struct pipe_context *pipe,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct svga_context *svga = svga_context(pipe); struct svga_context *svga = svga_context(pipe);

View File

@ -479,7 +479,7 @@ struct svga_shader_emitter_v10
bool register_overflow; /**< Set if we exceed a VGPU10 register limit */ bool register_overflow; /**< Set if we exceed a VGPU10 register limit */
/* For util_debug_message */ /* For util_debug_message */
struct pipe_debug_callback svga_debug_callback; struct util_debug_callback svga_debug_callback;
/* current loop depth in shader */ /* current loop depth in shader */
unsigned current_loop_depth; unsigned current_loop_depth;

View File

@ -49,7 +49,7 @@ struct svga_winsys_screen;
struct svga_winsys_buffer; struct svga_winsys_buffer;
struct pipe_screen; struct pipe_screen;
struct pipe_context; struct pipe_context;
struct pipe_debug_callback; struct util_debug_callback;
struct pipe_fence_handle; struct pipe_fence_handle;
struct pipe_resource; struct pipe_resource;
struct svga_region; struct svga_region;
@ -477,7 +477,7 @@ struct svga_winsys_context
unsigned flags); unsigned flags);
/** To report perf/conformance/etc issues to the gallium frontend */ /** To report perf/conformance/etc issues to the gallium frontend */
struct pipe_debug_callback *debug_callback; struct util_debug_callback *debug_callback;
/** The more recent command issued to command buffer */ /** The more recent command issued to command buffer */
SVGAFifo3dCmdId last_command; SVGAFifo3dCmdId last_command;

View File

@ -602,7 +602,7 @@ tegra_set_tess_state(struct pipe_context *pcontext,
static void static void
tegra_set_debug_callback(struct pipe_context *pcontext, tegra_set_debug_callback(struct pipe_context *pcontext,
const struct pipe_debug_callback *callback) const struct util_debug_callback *callback)
{ {
struct tegra_context *context = to_tegra_context(pcontext); struct tegra_context *context = to_tegra_context(pcontext);

View File

@ -88,7 +88,7 @@ v3d_memory_barrier(struct pipe_context *pctx, unsigned int flags)
static void static void
v3d_set_debug_callback(struct pipe_context *pctx, v3d_set_debug_callback(struct pipe_context *pctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct v3d_context *v3d = v3d_context(pctx); struct v3d_context *v3d = v3d_context(pctx);

View File

@ -600,7 +600,7 @@ struct v3d_context {
struct v3d_bo *current_oq; struct v3d_bo *current_oq;
struct pipe_resource *prim_counts; struct pipe_resource *prim_counts;
uint32_t prim_counts_offset; uint32_t prim_counts_offset;
struct pipe_debug_callback debug; struct util_debug_callback debug;
struct v3d_perfmon_state *active_perfmon; struct v3d_perfmon_state *active_perfmon;
struct v3d_perfmon_state *last_perfmon; struct v3d_perfmon_state *last_perfmon;
/** @} */ /** @} */

View File

@ -85,7 +85,7 @@ vc4_texture_barrier(struct pipe_context *pctx, unsigned flags)
static void static void
vc4_set_debug_callback(struct pipe_context *pctx, vc4_set_debug_callback(struct pipe_context *pctx,
const struct pipe_debug_callback *cb) const struct util_debug_callback *cb)
{ {
struct vc4_context *vc4 = vc4_context(pctx); struct vc4_context *vc4 = vc4_context(pctx);

View File

@ -381,7 +381,7 @@ struct vc4_context {
struct pipe_viewport_state viewport; struct pipe_viewport_state viewport;
struct vc4_constbuf_stateobj constbuf[PIPE_SHADER_TYPES]; struct vc4_constbuf_stateobj constbuf[PIPE_SHADER_TYPES];
struct vc4_vertexbuf_stateobj vertexbuf; struct vc4_vertexbuf_stateobj vertexbuf;
struct pipe_debug_callback debug; struct util_debug_callback debug;
struct vc4_hwperfmon *perfmon; struct vc4_hwperfmon *perfmon;
/** @} */ /** @} */

View File

@ -50,7 +50,7 @@ command_queue::command_queue(clover::context &ctx, clover::device &dev,
throw error(CL_INVALID_DEVICE); throw error(CL_INVALID_DEVICE);
if (ctx.notify) { if (ctx.notify) {
struct pipe_debug_callback cb; struct util_debug_callback cb;
memset(&cb, 0, sizeof(cb)); memset(&cb, 0, sizeof(cb));
cb.debug_message = &debug_notify_callback; cb.debug_message = &debug_notify_callback;
cb.data = this; cb.data = this;
@ -76,7 +76,7 @@ command_queue::command_queue(clover::context &ctx, clover::device &dev,
throw error(CL_INVALID_DEVICE); throw error(CL_INVALID_DEVICE);
if (ctx.notify) { if (ctx.notify) {
struct pipe_debug_callback cb; struct util_debug_callback cb;
memset(&cb, 0, sizeof(cb)); memset(&cb, 0, sizeof(cb));
cb.debug_message = &debug_notify_callback; cb.debug_message = &debug_notify_callback;
cb.data = this; cb.data = this;

View File

@ -45,7 +45,7 @@ struct pipe_blit_info;
struct pipe_box; struct pipe_box;
struct pipe_clip_state; struct pipe_clip_state;
struct pipe_constant_buffer; struct pipe_constant_buffer;
struct pipe_debug_callback; struct util_debug_callback;
struct pipe_depth_stencil_alpha_state; struct pipe_depth_stencil_alpha_state;
struct pipe_device_reset_callback; struct pipe_device_reset_callback;
struct pipe_draw_info; struct pipe_draw_info;
@ -521,7 +521,7 @@ struct pipe_context {
* set, otherwise a copy of the data should be made. * set, otherwise a copy of the data should be made.
*/ */
void (*set_debug_callback)(struct pipe_context *, void (*set_debug_callback)(struct pipe_context *,
const struct pipe_debug_callback *); const struct util_debug_callback *);
/** /**
* Bind an array of shader buffers that will be used by a shader. * Bind an array of shader buffers that will be used by a shader.

View File

@ -1004,7 +1004,7 @@ struct pipe_compute_state
* Structure that contains a callback for debug messages from the driver back * Structure that contains a callback for debug messages from the driver back
* to the gallium frontend. * to the gallium frontend.
*/ */
struct pipe_debug_callback struct util_debug_callback
{ {
/** /**
* When set to \c true, the callback may be called asynchronously from a * When set to \c true, the callback may be called asynchronously from a

View File

@ -682,7 +682,7 @@ debug_pop_group(struct gl_debug_state *debug)
/** /**
* Installed as pipe_debug_callback when GL_DEBUG_OUTPUT is enabled. * Installed as util_debug_callback when GL_DEBUG_OUTPUT is enabled.
*/ */
static void static void
_debug_message(void *data, _debug_message(void *data,
@ -747,7 +747,7 @@ _mesa_update_debug_callback(struct gl_context *ctx)
return; return;
if (_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT)) { if (_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT)) {
struct pipe_debug_callback cb; struct util_debug_callback cb;
memset(&cb, 0, sizeof(cb)); memset(&cb, 0, sizeof(cb));
cb.async = !_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT_SYNCHRONOUS); cb.async = !_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT_SYNCHRONOUS);
cb.debug_message = _debug_message; cb.debug_message = _debug_message;

View File

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

View File

@ -275,11 +275,11 @@ void _debug_assert_fail(const char *expr,
} \ } \
} while (0) } while (0)
struct pipe_debug_callback; struct util_debug_callback;
void void
_util_debug_message( _util_debug_message(
struct pipe_debug_callback *cb, struct util_debug_callback *cb,
unsigned *id, unsigned *id,
enum pipe_debug_type type, enum pipe_debug_type type,
const char *fmt, ...) _util_printf_format(4, 5); const char *fmt, ...) _util_printf_format(4, 5);