gallium: Use p_debug.h instead of non-portable stdio.h/assert.h functions.

This commit is contained in:
José Fonseca
2008-02-06 14:37:49 +09:00
parent 78bce9c2dc
commit 9791d7f64c
47 changed files with 176 additions and 182 deletions

View File

@@ -30,6 +30,8 @@
* Keith Whitwell <keith@tungstengraphics.com>
*/
#include "pipe/p_debug.h"
#include "draw_private.h"
#include "draw_context.h"
@@ -60,7 +62,7 @@ static void draw_prim_queue_flush( struct draw_context *draw )
unsigned i;
if (0)
fprintf(stdout,"Flushing with %d prims, %d verts\n",
debug_printf("Flushing with %d prims, %d verts\n",
draw->pq.queue_nr, draw->vs.queue_nr);
assert (draw->pq.queue_nr != 0);
@@ -120,7 +122,7 @@ static void draw_prim_queue_flush( struct draw_context *draw )
void draw_do_flush( struct draw_context *draw, unsigned flags )
{
if (0)
fprintf(stdout,"Flushing with %d verts, %d prims\n",
debug_printf("Flushing with %d verts, %d prims\n",
draw->vs.queue_nr,
draw->pq.queue_nr );
@@ -157,11 +159,11 @@ static struct prim_header *get_queued_prim( struct draw_context *draw,
unsigned nr_verts )
{
if (!draw_vertex_cache_check_space( draw, nr_verts )) {
// fprintf(stderr, "v");
// debug_printf("v");
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE );
}
else if (draw->pq.queue_nr == PRIM_QUEUE_LENGTH) {
// fprintf(stderr, "p");
// debug_printf("p");
draw_do_flush( draw, DRAW_FLUSH_PRIM_QUEUE );
}
@@ -283,7 +285,7 @@ draw_prim( struct draw_context *draw,
boolean unfilled = (draw->rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
draw->rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL);
// _mesa_printf("%s (%d) %d/%d\n", __FUNCTION__, draw->prim, start, count );
// debug_printf("%s (%d) %d/%d\n", __FUNCTION__, draw->prim, start, count );
switch (prim) {
case PIPE_PRIM_POINTS:

View File

@@ -34,8 +34,7 @@
*/
#include <assert.h>
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "draw_vbuf.h"
@@ -125,55 +124,55 @@ dump_emitted_vertex(const struct vertex_info *vinfo, const uint8_t *data)
j = vinfo->src_index[i];
switch (vinfo->emit[i]) {
case EMIT_OMIT:
fprintf(stderr, "EMIT_OMIT:");
debug_printf("EMIT_OMIT:");
break;
case EMIT_ALL:
assert(i == 0);
assert(j == 0);
fprintf(stderr, "EMIT_ALL:\t");
debug_printf("EMIT_ALL:\t");
for(k = 0; k < vinfo->size*4; ++k)
fprintf(stderr, "%02x ", *data++);
debug_printf("%02x ", *data++);
break;
case EMIT_1F:
fprintf(stderr, "EMIT_1F:\t");
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
debug_printf("EMIT_1F:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_1F_PSIZE:
fprintf(stderr, "EMIT_1F_PSIZE:\t");
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
debug_printf("EMIT_1F_PSIZE:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_2F:
fprintf(stderr, "EMIT_2F:\t");
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
debug_printf("EMIT_2F:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_3F:
fprintf(stderr, "EMIT_3F:\t");
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
debug_printf("EMIT_3F:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
data += sizeof(float);
break;
case EMIT_4F:
fprintf(stderr, "EMIT_4F:\t");
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
debug_printf("EMIT_4F:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_4UB:
fprintf(stderr, "EMIT_4UB:\t");
fprintf(stderr, "%u ", *data++);
fprintf(stderr, "%u ", *data++);
fprintf(stderr, "%u ", *data++);
fprintf(stderr, "%u ", *data++);
debug_printf("EMIT_4UB:\t");
debug_printf("%u ", *data++);
debug_printf("%u ", *data++);
debug_printf("%u ", *data++);
debug_printf("%u ", *data++);
break;
default:
assert(0);
}
fprintf(stderr, "\n");
debug_printf("\n");
}
fprintf(stderr, "\n");
debug_printf("\n");
}
#endif
@@ -190,7 +189,7 @@ emit_vertex( struct vbuf_stage *vbuf,
struct vertex_header *vertex )
{
#if 0
fprintf(stderr, "emit vertex %d to %p\n",
debug_printf("emit vertex %d to %p\n",
vbuf->nr_vertices, vbuf->vertex_ptr);
#endif
@@ -198,7 +197,7 @@ emit_vertex( struct vbuf_stage *vbuf,
if(vertex->vertex_id < vbuf->nr_vertices)
return;
else
fprintf(stderr, "Bad vertex id 0x%04x (>= 0x%04x)\n",
debug_printf("Bad vertex id 0x%04x (>= 0x%04x)\n",
vertex->vertex_id, vbuf->nr_vertices);
return;
}
@@ -269,9 +268,9 @@ emit_vertex( struct vbuf_stage *vbuf,
static float data[256];
draw_vf_emit_vertex(vbuf->vf, vertex, data);
if(memcmp((uint8_t *)vbuf->vertex_ptr - vbuf->vertex_size, data, vbuf->vertex_size)) {
fprintf(stderr, "With VF:\n");
debug_printf("With VF:\n");
dump_emitted_vertex(vbuf->vinfo, (uint8_t *)data);
fprintf(stderr, "Without VF:\n");
debug_printf("Without VF:\n");
dump_emitted_vertex(vbuf->vinfo, (uint8_t *)vbuf->vertex_ptr - vbuf->vertex_size);
assert(0);
}

View File

@@ -162,7 +162,7 @@ static fetch_func get_fetch_func( enum pipe_format format )
{
char tmp[80];
pf_sprint_name(tmp, format);
_mesa_printf("%s: %s\n", __FUNCTION__, tmp);
debug_printf("%s: %s\n", __FUNCTION__, tmp);
}
#endif
@@ -332,7 +332,7 @@ static void fetch_xyz_rgb( struct draw_context *draw,
assert(count <= 4);
// _mesa_printf("%s\n", __FUNCTION__);
// debug_printf("%s\n", __FUNCTION__);
/* loop over vertex attributes (vertex shader inputs)
*/
@@ -421,7 +421,7 @@ static void generic_vertex_fetch( struct draw_context *draw,
assert(count <= 4);
// _mesa_printf("%s %d\n", __FUNCTION__, count);
// debug_printf("%s %d\n", __FUNCTION__, count);
/* loop over vertex attributes (vertex shader inputs)
*/
@@ -467,7 +467,7 @@ void draw_update_vertex_fetch( struct draw_context *draw )
{
unsigned nr_attrs, i;
// _mesa_printf("%s\n", __FUNCTION__);
// debug_printf("%s\n", __FUNCTION__);
/* this may happend during context init */
if (!draw->vertex_shader)

View File

@@ -166,7 +166,7 @@ run_vertex_program(struct draw_context *draw,
vOut[j]->data[0][3] = w;
#if DBG_VS
printf("output[%d]win: %f %f %f %f\n", j,
debug_printf("output[%d]win: %f %f %f %f\n", j,
vOut[j]->data[0][0],
vOut[j]->data[0][1],
vOut[j]->data[0][2],
@@ -181,7 +181,7 @@ run_vertex_program(struct draw_context *draw,
vOut[j]->data[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
vOut[j]->data[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
#if DBG_VS
printf("output[%d][%d]: %f %f %f %f\n", j, slot,
debug_printf("output[%d][%d]: %f %f %f %f\n", j, slot,
vOut[j]->data[slot][0],
vOut[j]->data[slot][1],
vOut[j]->data[slot][2],
@@ -207,7 +207,7 @@ draw_vertex_shader_queue_flush(struct draw_context *draw)
*/
draw_update_vertex_fetch( draw );
// fprintf(stderr, " q(%d) ", draw->vs.queue_nr );
// debug_printf( " q(%d) ", draw->vs.queue_nr );
#ifdef MESA_LLVM
if (draw->vertex_shader->llvm_prog) {
draw_vertex_shader_queue_flush_llvm(draw);

View File

@@ -152,7 +152,7 @@ void draw_vertex_shader_queue_flush_llvm(struct draw_context *draw)
z = vOut->clip[2] = dests[0][2];
w = vOut->clip[3] = dests[0][3];
#if DBG
printf("output %d: %f %f %f %f\n", 0, x, y, z, w);
debug_printf("output %d: %f %f %f %f\n", 0, x, y, z, w);
#endif
vOut->clipmask = compute_clipmask(vOut->clip, draw->plane, draw->nr_planes);
@@ -179,7 +179,7 @@ void draw_vertex_shader_queue_flush_llvm(struct draw_context *draw)
vOut->data[slot][3] = dests[slot][3];
#if DBG
printf("output %d: %f %f %f %f\n", slot,
debug_printf("output %d: %f %f %f %f\n", slot,
vOut->data[slot][0],
vOut->data[slot][1],
vOut->data[slot][2],

View File

@@ -168,7 +168,7 @@ draw_vf_set_vertex_attributes( struct draw_vertex_fetch *vf,
const unsigned format = map[i].format;
if (format == DRAW_EMIT_PAD) {
#if (DRAW_VF_DBG)
_mesa_printf("%d: pad %d, offset %d\n", i,
debug_printf("%d: pad %d, offset %d\n", i,
map[i].offset, offset);
#endif
@@ -186,7 +186,7 @@ draw_vf_set_vertex_attributes( struct draw_vertex_fetch *vf,
memcpy(vf->attr[j].data, &map[i].data, vf->attr[j].vertattrsize);
#if (DRAW_VF_DBG)
_mesa_printf("%d: %s, offset %d\n", i,
debug_printf("%d: %s, offset %d\n", i,
draw_vf_format_info[format].name,
vf->attr[j].vertoffset);
#endif

View File

@@ -27,9 +27,8 @@
*/
#include <assert.h>
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "draw_vf.h"

View File

@@ -453,7 +453,7 @@ static boolean build_vertex_emit( struct x86_program *p )
update_src_ptr(p, srcECX, vfESI, a);
}
else {
fprintf(stderr, "Can't emit 1ub %x %x %d\n",
debug_printf("Can't emit 1ub %x %x %d\n",
a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
return FALSE;
}
@@ -499,7 +499,7 @@ static boolean build_vertex_emit( struct x86_program *p )
j++; /* NOTE: two attrs consumed */
}
else {
fprintf(stderr, "Can't emit 3ub\n");
debug_printf("Can't emit 3ub\n");
}
return FALSE; /* add this later */
break;
@@ -532,7 +532,7 @@ static boolean build_vertex_emit( struct x86_program *p )
update_src_ptr(p, srcECX, vfESI, a);
break;
default:
fprintf(stderr, "unknown a[%d].format %d\n", j, a->format);
debug_printf("unknown a[%d].format %d\n", j, a->format);
return FALSE; /* catch any new opcodes */
}

View File

@@ -100,7 +100,7 @@ negate(int reg, int x, int y, int z, int w)
static void
i915_use_passthrough_shader(struct i915_context *i915)
{
fprintf(stderr, "**** Using i915 pass-through fragment shader\n");
debug_printf("**** Using i915 pass-through fragment shader\n");
i915->current.program = (uint *) MALLOC(sizeof(passthrough));
if (i915->current.program) {
@@ -119,12 +119,12 @@ i915_program_error(struct i915_fp_compile *p, const char *msg, ...)
va_list args;
char buffer[1024];
fprintf(stderr, "i915_program_error: ");
debug_printf("i915_program_error: ");
va_start( args, msg );
vsprintf( buffer, msg, args );
va_end( args );
fprintf(stderr, buffer);
fprintf(stderr, "\n");
debug_printf(buffer);
debug_printf("\n");
p->error = 1;
}
@@ -169,7 +169,7 @@ src_vector(struct i915_fp_compile *p,
switch (sem_name) {
case TGSI_SEMANTIC_POSITION:
fprintf(stderr, "SKIP SEM POS\n");
debug_printf("SKIP SEM POS\n");
/*
assert(p->wpos_tex != -1);
src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL);
@@ -913,7 +913,7 @@ i915_translate_instructions(struct i915_fp_compile *p,
ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
/*printf("FS Input DECL [%u] sem %u\n", ind, sem);*/
/*debug_printf("FS Input DECL [%u] sem %u\n", ind, sem);*/
p->input_semantic_name[ind] = sem;
p->input_semantic_index[ind] = semi;
}
@@ -924,7 +924,7 @@ i915_translate_instructions(struct i915_fp_compile *p,
ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
/*printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
/*debug_printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
p->output_semantic_name[ind] = sem;
p->output_semantic_index[ind] = semi;
}

View File

@@ -38,9 +38,8 @@
*/
#include <assert.h>
#include "pipe/draw/draw_vbuf.h"
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"

View File

@@ -87,7 +87,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
}
break;
case TGSI_SEMANTIC_FOG:
fprintf(stderr, "i915 fogcoord not implemented yet\n");
debug_printf("i915 fogcoord not implemented yet\n");
draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_PERSPECTIVE, src++);
break;
default:

View File

@@ -107,7 +107,7 @@ i915_emit_hardware_state(struct i915_context *i915 )
) * 3/2; /* plus 50% margin */
#if 0
fprintf (stderr, "i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs);
debug_printf("i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs);
#endif
if(!BEGIN_BATCH(dwords, relocs)) {

View File

@@ -97,7 +97,7 @@ static void upload_S2S4(struct i915_context *i915)
LIS2 = i915->current.vertex_info.hwfmt[1];
LIS4 = i915->current.vertex_info.hwfmt[0];
/*
printf("LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4);
debug_printf("LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4);
*/
assert(LIS4); /* should never be zero? */
}

View File

@@ -169,7 +169,7 @@ translate_texture_format(enum pipe_format pipeFormat)
case PIPE_FORMAT_S8Z24_UNORM:
return (MAPSURF_32BIT | MT_32BIT_xL824);
default:
fprintf(stderr, "i915: translate_texture_format() bad image format %x\n",
debug_printf("i915: translate_texture_format() bad image format %x\n",
pipeFormat);
assert(0);
return 0;

View File

@@ -58,7 +58,7 @@ static int brw_translate_compare_func(int func)
return BRW_COMPAREFUNCTION_ALWAYS;
}
fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
debug_printf("Unknown value in %s: %x\n", __FUNCTION__, func);
return BRW_COMPAREFUNCTION_ALWAYS;
}

View File

@@ -273,10 +273,10 @@ static void upload_constant_buffer(struct brw_context *brw)
if (1) {
for (i = 0; i < sz; i+=4)
_mesa_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
debug_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
buf[i+0], buf[i+1], buf[i+2], buf[i+3]);
_mesa_printf("last_buf %p buf %p sz %d/%d cmp %d\n",
debug_printf("last_buf %p buf %p sz %d/%d cmp %d\n",
brw->curbe.last_buf, buf,
bufsz, brw->curbe.last_bufsz,
brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1);
@@ -299,7 +299,7 @@ static void upload_constant_buffer(struct brw_context *brw)
bufsz,
1 << 6,
&brw->curbe.gs_offset)) {
_mesa_printf("out of GS memory for curbe\n");
debug_printf("out of GS memory for curbe\n");
assert(0);
return;
}

View File

@@ -30,6 +30,8 @@
*/
#include "pipe/p_debug.h"
#include "brw_eu.h"
void brw_print_reg( struct brw_reg hwreg )
@@ -52,7 +54,7 @@ void brw_print_reg( struct brw_reg hwreg )
"f"
};
_mesa_printf("%s%s",
debug_printf("%s%s",
hwreg.abs ? "abs/" : "",
hwreg.negate ? "-" : "");
@@ -63,17 +65,17 @@ void brw_print_reg( struct brw_reg hwreg )
hwreg.width == BRW_WIDTH_8 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
_mesa_printf("vec%d", hwreg.nr);
debug_printf("vec%d", hwreg.nr);
}
else if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
hwreg.vstride == BRW_VERTICAL_STRIDE_0 &&
hwreg.width == BRW_WIDTH_1 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
_mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
debug_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
}
else {
_mesa_printf("%s%d.%d<%d;%d,%d>:%s",
debug_printf("%s%d.%d<%d;%d,%d>:%s",
file[hwreg.file],
hwreg.nr,
hwreg.subnr / type_sz(hwreg.type),

View File

@@ -953,7 +953,7 @@ void brw_SAMPLE(struct brw_compile *p,
boolean need_stall = 0;
if(writemask == 0) {
/* _mesa_printf("%s: zero writemask??\n", __FUNCTION__); */
/* debug_printf("%s: zero writemask??\n", __FUNCTION__); */
return;
}
@@ -985,7 +985,7 @@ void brw_SAMPLE(struct brw_compile *p,
if (newmask != writemask) {
need_stall = 1;
/* _mesa_printf("need stall %x %x\n", newmask , writemask); */
/* debug_printf("need stall %x %x\n", newmask , writemask); */
}
else {
struct brw_reg m1 = brw_message_reg(msg_reg_nr);

View File

@@ -175,7 +175,7 @@ static void upload_sf_prog( struct brw_context *brw )
//int semantic = parse.FullToken.FullDeclaration.Semantic.SemanticName;
//int semantic_index = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
fprintf(stderr, "fs input %d..%d interp mode %d\n", first, last, interp_mode);
debug_printf("fs input %d..%d interp mode %d\n", first, last, interp_mode);
switch (interp_mode) {
case TGSI_INTERPOLATE_CONSTANT:
@@ -213,9 +213,9 @@ static void upload_sf_prog( struct brw_context *brw )
key.linear_mask |= 1;
key.const_mask <<= 1;
fprintf(stderr, "key.persp_mask: %x\n", key.persp_mask);
fprintf(stderr, "key.linear_mask: %x\n", key.linear_mask);
fprintf(stderr, "key.const_mask: %x\n", key.const_mask);
debug_printf("key.persp_mask: %x\n", key.persp_mask);
debug_printf("key.linear_mask: %x\n", key.linear_mask);
debug_printf("key.const_mask: %x\n", key.const_mask);
// key.do_point_sprite = brw->attribs.Point->PointSprite;

View File

@@ -137,8 +137,8 @@ static boolean calculate_masks( struct brw_sf_compile *c,
unsigned persp_mask = c->key.persp_mask;
unsigned linear_mask = c->key.linear_mask;
fprintf(stderr, "persp_mask: %x\n", persp_mask);
fprintf(stderr, "linear_mask: %x\n", linear_mask);
debug_printf("persp_mask: %x\n", persp_mask);
debug_printf("linear_mask: %x\n", linear_mask);
*pc_persp = 0;
*pc_linear = 0;
@@ -162,9 +162,9 @@ static boolean calculate_masks( struct brw_sf_compile *c,
*pc_linear |= 0xf0;
}
fprintf(stderr, "pc: %x\n", *pc);
fprintf(stderr, "pc_persp: %x\n", *pc_persp);
fprintf(stderr, "pc_linear: %x\n", *pc_linear);
debug_printf("pc: %x\n", *pc);
debug_printf("pc_persp: %x\n", *pc_persp);
debug_printf("pc_linear: %x\n", *pc_linear);
return is_last_attr;
@@ -177,7 +177,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c )
struct brw_compile *p = &c->func;
unsigned i;
fprintf(stderr, "%s START ==============\n", __FUNCTION__);
debug_printf("%s START ==============\n", __FUNCTION__);
c->nr_verts = 3;
alloc_regs(c);
@@ -250,7 +250,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c )
}
}
fprintf(stderr, "%s DONE ==============\n", __FUNCTION__);
debug_printf("%s DONE ==============\n", __FUNCTION__);
}

View File

@@ -225,7 +225,7 @@ static void brw_bind_vs_state(struct pipe_context *pipe, void *vs)
brw->attribs.VertexProgram = (struct brw_vertex_program *)vs;
brw->state.dirty.brw |= BRW_NEW_VS;
printf("YYYYYYYYYYYYY BINDING VERTEX SHADER\n");
debug_printf("YYYYYYYYYYYYY BINDING VERTEX SHADER\n");
}
static void brw_delete_vs_state(struct pipe_context *pipe, void *shader)

View File

@@ -149,7 +149,7 @@ unsigned brw_upload_cache( struct brw_cache *cache,
if (!brw_pool_alloc(cache->pool, data_size, 1 << 6, &offset)) {
/* Should not be possible:
*/
printf("brw_pool_alloc failed\n");
debug_printf("brw_pool_alloc failed\n");
exit(1);
}
@@ -177,7 +177,7 @@ unsigned brw_upload_cache( struct brw_cache *cache,
}
if (BRW_DEBUG & DEBUG_STATE)
printf("upload %s: %d bytes to pool buffer %p offset %x\n",
debug_printf("upload %s: %d bytes to pool buffer %p offset %x\n",
cache->name,
data_size,
(void*)cache->pool->buffer,
@@ -416,7 +416,7 @@ void brw_clear_all_caches( struct brw_context *brw )
int i;
if (BRW_DEBUG & DEBUG_STATE)
fprintf(stderr, "%s\n", __FUNCTION__);
debug_printf("%s\n", __FUNCTION__);
for (i = 0; i < BRW_MAX_CACHE; i++)
clear_cache(&brw->cache[i]);

View File

@@ -58,7 +58,7 @@ boolean brw_pool_alloc( struct brw_mem_pool *pool,
size = align(size, 4);
if (pool->offset + fixup + size >= pool->size) {
printf("%s failed\n", __FUNCTION__);
debug_printf("%s failed\n", __FUNCTION__);
assert(0);
exit(0);
}
@@ -74,7 +74,7 @@ static
void brw_invalidate_pool( struct brw_mem_pool *pool )
{
if (BRW_DEBUG & DEBUG_STATE)
printf("\n\n\n %s \n\n\n", __FUNCTION__);
debug_printf("\n\n\n %s \n\n\n", __FUNCTION__);
pool->offset = 0;

View File

@@ -120,18 +120,18 @@ static void recalculate_urb_fence( struct brw_context *brw )
* entries and the values for minimum nr of entries
* provided above.
*/
fprintf(stderr, "couldn't calculate URB layout!\n");
debug_printf("couldn't calculate URB layout!\n");
exit(1);
}
if (BRW_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
printf("URB CONSTRAINED\n");
debug_printf("URB CONSTRAINED\n");
}
else
brw->urb.constrained = 0;
if (BRW_DEBUG & DEBUG_URB)
printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
debug_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
brw->urb.vs_start,
brw->urb.gs_start,
brw->urb.clip_start,

View File

@@ -1228,7 +1228,7 @@ static void process_instruction(struct brw_vs_compile *c,
case TGSI_OPCODE_ENDSUB:
break;
default:
printf("Unsupport opcode %d in vertex shader\n", inst->Instruction.Opcode);
debug_printf("Unsupport opcode %d in vertex shader\n", inst->Instruction.Opcode);
break;
}

View File

@@ -57,7 +57,7 @@ static void do_wm_prog( struct brw_context *brw,
c->pixel_w = brw_null_reg();
fprintf(stderr, "XXXXXXXX FP\n");
debug_printf("XXXXXXXX FP\n");
brw_wm_glsl_emit(c);

View File

@@ -982,7 +982,7 @@ static void brw_wm_emit_instruction( struct brw_wm_compile *c,
break;
default:
_mesa_printf("unsupported IR in fragment shader %d\n",
debug_printf("unsupported IR in fragment shader %d\n",
inst->Instruction.Opcode);
}
#if 0

View File

@@ -71,7 +71,7 @@ static int intel_translate_shadow_compare_func(unsigned func)
return COMPAREFUNC_NEVER;
}
fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
debug_printf("Unknown value in %s: %x\n", __FUNCTION__, func);
return COMPAREFUNC_NEVER;
}

View File

@@ -28,10 +28,9 @@
#ifndef P_COMPILER_H
#define P_COMPILER_H
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) && !defined(__WIN32__)

View File

@@ -28,7 +28,10 @@
#ifndef PIPE_FORMAT_H
#define PIPE_FORMAT_H
#include <stdio.h> // for sprintf
#include "p_compiler.h"
#include "p_debug.h"
/**
* The PIPE_FORMAT is a 32-bit wide bitfield that encodes all the information

View File

@@ -381,10 +381,6 @@ static INLINE int align(int value, int alignment)
return (value + alignment - 1) & ~(alignment - 1);
}
/* Convenient...
*/
extern void _mesa_printf(const char *str, ...);
/* util/p_util.c
*/

View File

@@ -44,10 +44,8 @@
#define PB_BUFFER_H_
#include <assert.h>
#include <stdlib.h>
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"

View File

@@ -34,12 +34,10 @@
*/
#include <assert.h>
#include <stdlib.h>
#include "linked_list.h"
#include "p_compiler.h"
#include "p_debug.h"
#include "p_winsys.h"
#include "p_thread.h"
#include "p_util.h"

View File

@@ -51,7 +51,7 @@
#define PB_BUFFER_FENCED_H_
#include <assert.h>
#include "pipe/p_debug.h"
struct pipe_winsys;

View File

@@ -34,9 +34,7 @@
*/
#include <assert.h>
#include <stdlib.h>
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pb_buffer.h"

View File

@@ -34,9 +34,7 @@
*/
#include <assert.h>
#include <stdlib.h>
#include "p_debug.h"
#include "p_util.h"
#include "pb_buffer.h"

View File

@@ -34,11 +34,10 @@
*/
#include <assert.h>
#include "linked_list.h"
#include "p_defines.h"
#include "p_debug.h"
#include "p_thread.h"
#include "p_util.h"
#include "pb_buffer.h"
@@ -69,28 +68,28 @@ struct mem_block
static void
mmDumpMemInfo(const struct mem_block *heap)
{
fprintf(stderr, "Memory heap %p:\n", (void *)heap);
debug_printf("Memory heap %p:\n", (void *)heap);
if (heap == 0) {
fprintf(stderr, " heap == 0\n");
debug_printf(" heap == 0\n");
} else {
const struct mem_block *p;
for(p = heap->next; p != heap; p = p->next) {
fprintf(stderr, " Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
debug_printf(" Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
fprintf(stderr, "\nFree list:\n");
debug_printf("\nFree list:\n");
for(p = heap->next_free; p != heap; p = p->next_free) {
fprintf(stderr, " FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
debug_printf(" FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
}
fprintf(stderr, "End of memory blocks\n");
debug_printf("End of memory blocks\n");
}
#endif
@@ -308,11 +307,11 @@ mmFreeMem(struct mem_block *b)
return 0;
if (b->free) {
fprintf(stderr, "block already free\n");
debug_printf("block already free\n");
return -1;
}
if (b->reserved) {
fprintf(stderr, "block is reserved\n");
debug_printf("block is reserved\n");
return -1;
}
@@ -479,7 +478,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
mm_buf->block = mmAllocMem(mm->heap, size, mm->align2, 0);
if(!mm_buf->block) {
fprintf(stderr, "warning: heap full\n");
debug_printf("warning: heap full\n");
#if 0
mmDumpMemInfo(mm->heap);
#endif

View File

@@ -35,12 +35,10 @@
*/
#include <assert.h>
#include <stdlib.h>
#include "linked_list.h"
#include "p_compiler.h"
#include "p_debug.h"
#include "p_thread.h"
#include "p_defines.h"
#include "p_util.h"
@@ -178,7 +176,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
if (pool->numFree == 0) {
_glthread_UNLOCK_MUTEX(pool->mutex);
fprintf(stderr, "warning: out of fixed size buffer objects\n");
debug_printf("warning: out of fixed size buffer objects\n");
return NULL;
}
@@ -186,7 +184,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
if (item == &pool->free) {
_glthread_UNLOCK_MUTEX(pool->mutex);
fprintf(stderr, "error: fixed size buffer pool corruption\n");
debug_printf("error: fixed size buffer pool corruption\n");
return NULL;
}

View File

@@ -251,9 +251,9 @@ static void print_vertex(const struct setup_stage *setup,
const struct vertex_header *v)
{
int i;
fprintf(stderr, "Vertex: (%p)\n", v);
debug_printf("Vertex: (%p)\n", v);
for (i = 0; i < setup->quad.nr_attrs; i++) {
fprintf(stderr, " %d: %f %f %f %f\n", i,
debug_printf(" %d: %f %f %f %f\n", i,
v->data[i][0], v->data[i][1], v->data[i][2], v->data[i][3]);
}
}
@@ -267,7 +267,7 @@ static boolean setup_sort_vertices( struct setup_stage *setup,
const struct vertex_header *v2 = prim->v[2];
#if DEBUG_VERTS
fprintf(stderr, "Triangle:\n");
debug_printf("Triangle:\n");
print_vertex(setup, v0);
print_vertex(setup, v1);
print_vertex(setup, v2);
@@ -345,7 +345,7 @@ static boolean setup_sort_vertices( struct setup_stage *setup,
setup->oneoverarea = 1.0f / area;
/*
_mesa_printf("%s one-over-area %f area %f det %f\n",
debug_printf("%s one-over-area %f area %f det %f\n",
__FUNCTION__, setup->oneoverarea, area, prim->det );
*/
}
@@ -419,7 +419,7 @@ static void tri_linear_coeff( struct setup_stage *setup,
dady * (setup->vmin->data[0][1] - 0.5f)));
/*
_mesa_printf("attr[%d].%c: %f dx:%f dy:%f\n",
debug_printf("attr[%d].%c: %f dx:%f dy:%f\n",
slot, "xyzw"[i],
setup->coef[slot].a0[i],
setup->coef[slot].dadx[i],
@@ -453,7 +453,7 @@ static void tri_persp_coeff( struct setup_stage *setup,
float dady = b * setup->oneoverarea;
/*
printf("tri persp %d,%d: %f %f %f\n", vertSlot, i,
debug_printf("tri persp %d,%d: %f %f %f\n", vertSlot, i,
setup->vmin->data[vertSlot][i],
setup->vmid->data[vertSlot][i],
setup->vmax->data[vertSlot][i]
@@ -619,7 +619,7 @@ static void subtriangle( struct setup_stage *setup,
finish_y -= sy;
/*
_mesa_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
debug_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
*/
for (y = start_y; y < finish_y; y++) {
@@ -671,7 +671,7 @@ static void setup_tri( struct draw_stage *stage,
struct setup_stage *setup = setup_stage( stage );
/*
_mesa_printf("%s\n", __FUNCTION__ );
debug_printf("%s\n", __FUNCTION__ );
*/
setup_sort_vertices( setup, prim );
@@ -1124,7 +1124,7 @@ setup_point(struct draw_stage *stage, struct prim_header *prim)
int ix, iy;
/*
printf("(%f, %f) -> X:%d..%d Y:%d..%d\n", x, y, xmin, xmax,ymin,ymax);
debug_printf("(%f, %f) -> X:%d..%d Y:%d..%d\n", x, y, xmin, xmax,ymin,ymax);
*/
for (iy = iymin; iy <= iymax; iy += 2) {
uint rowMask = 0xf;

View File

@@ -223,13 +223,13 @@ shade_quad_llvm(struct quad_stage *qs,
inputs[2][0][1] = fy + 1.0f;
inputs[3][0][1] = fy + 1.0f;
#if DLLVM
printf("MASK = %d\n", quad->mask);
debug_printf("MASK = %d\n", quad->mask);
#endif
gallivm_prog_inputs_interpolate(llvm, inputs, quad->coef);
#if DLLVM
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 2; ++j) {
printf("IN(%d,%d) [%f %f %f %f]\n", i, j,
debug_printf("IN(%d,%d) [%f %f %f %f]\n", i, j,
inputs[i][j][0], inputs[i][j][1], inputs[i][j][2], inputs[i][j][3]);
}
}
@@ -240,7 +240,7 @@ shade_quad_llvm(struct quad_stage *qs,
softpipe->mapped_constants[PIPE_SHADER_FRAGMENT],
qss->samplers);
#if DLLVM
printf("OUT LLVM = 1[%f %f %f %f], 2[%f %f %f %f]\n",
debug_printf("OUT LLVM = 1[%f %f %f %f], 2[%f %f %f %f]\n",
dests[0][0][0], dests[0][0][1], dests[0][0][2], dests[0][0][3],
dests[0][1][0], dests[0][1][1], dests[0][1][2], dests[0][1][3]);
#endif
@@ -260,7 +260,7 @@ shade_quad_llvm(struct quad_stage *qs,
}
#if DLLVM
for (int i = 0; i < QUAD_SIZE; ++i) {
printf("QLLVM%d(%d) [%f, %f, %f, %f]\n", i, qss->colorOutSlot,
debug_printf("QLLVM%d(%d) [%f, %f, %f, %f]\n", i, qss->colorOutSlot,
quad->outputs.color[0][i],
quad->outputs.color[1][i],
quad->outputs.color[2][i],
@@ -284,7 +284,7 @@ shade_quad_llvm(struct quad_stage *qs,
}
}
#if DLLVM
printf("D [%f, %f, %f, %f] mask = %d\n",
debug_printf("D [%f, %f, %f, %f] mask = %d\n",
quad->outputs.depth[0],
quad->outputs.depth[1],
quad->outputs.depth[2],

View File

@@ -341,7 +341,7 @@ sp_tile_cache_flush_clear(struct pipe_context *pipe,
}
}
#if 0
printf("num cleared: %u\n", numCleared);
debug_printf("num cleared: %u\n", numCleared);
#endif
}
@@ -384,7 +384,7 @@ sp_flush_tile_cache(struct softpipe_context *softpipe,
#endif
#if 0
printf("flushed tiles in use: %d\n", inuse);
debug_printf("flushed tiles in use: %d\n", inuse);
#endif
}

View File

@@ -143,7 +143,7 @@ tgsi_exec_prepare( struct tgsi_exec_machine *mach )
k = tgsi_parse_init( &parse, mach->Tokens );
if (k != TGSI_PARSE_OK) {
fprintf(stderr, "Problem parsing!\n");
debug_printf("Problem parsing!\n");
return;
}
@@ -249,7 +249,7 @@ tgsi_exec_machine_init(
k = tgsi_parse_init (&parse, mach->Tokens);
if (k != TGSI_PARSE_OK) {
fprintf( stderr, "Problem parsing!\n" );
debug_printf( "Problem parsing!\n" );
return;
}
@@ -1236,7 +1236,7 @@ exec_tex(struct tgsi_exec_machine *mach,
uint chan_index;
float lodBias;
/* printf("Sampler %u unit %u\n", sampler, unit); */
/* debug_printf("Sampler %u unit %u\n", sampler, unit); */
switch (inst->InstructionExtTexture.Texture) {
case TGSI_TEXTURE_1D:

View File

@@ -48,28 +48,28 @@ _print_reg(
case file_REG32:
switch( reg.idx ) {
case reg_AX:
printf( "EAX" );
debug_printf( "EAX" );
break;
case reg_CX:
printf( "ECX" );
debug_printf( "ECX" );
break;
case reg_DX:
printf( "EDX" );
debug_printf( "EDX" );
break;
case reg_BX:
printf( "EBX" );
debug_printf( "EBX" );
break;
case reg_SP:
printf( "ESP" );
debug_printf( "ESP" );
break;
case reg_BP:
printf( "EBP" );
debug_printf( "EBP" );
break;
case reg_SI:
printf( "ESI" );
debug_printf( "ESI" );
break;
case reg_DI:
printf( "EDI" );
debug_printf( "EDI" );
break;
}
break;
@@ -77,7 +77,7 @@ _print_reg(
assert( 0 );
break;
case file_XMM:
printf( "XMM%u", reg.idx );
debug_printf( "XMM%u", reg.idx );
break;
case file_x87:
assert( 0 );
@@ -92,35 +92,35 @@ _fill(
unsigned count = 10 - strlen( op );
while( count-- ) {
printf( " " );
debug_printf( " " );
}
}
#define DUMP_START() printf( "\nsse-dump start ----------------" )
#define DUMP_END() printf( "\nsse-dump end ----------------\n" )
#define DUMP( OP ) printf( "\n%s", OP )
#define DUMP_START() debug_printf( "\nsse-dump start ----------------" )
#define DUMP_END() debug_printf( "\nsse-dump end ----------------\n" )
#define DUMP( OP ) debug_printf( "\n%s", OP )
#define DUMP_I( OP, I ) do {\
printf( "\n%s", OP );\
debug_printf( "\n%s", OP );\
_fill( OP );\
printf( "%u", I ); } while( 0 )
debug_printf( "%u", I ); } while( 0 )
#define DUMP_R( OP, R0 ) do {\
printf( "\n%s", OP );\
debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 ); } while( 0 )
#define DUMP_RR( OP, R0, R1 ) do {\
printf( "\n%s", OP );\
debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 );\
printf( ", " );\
debug_printf( ", " );\
_print_reg( R1 ); } while( 0 )
#define DUMP_RRI( OP, R0, R1, I ) do {\
printf( "\n%s", OP );\
debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 );\
printf( ", " );\
debug_printf( ", " );\
_print_reg( R1 );\
printf( ", " );\
printf( "%u", I ); } while( 0 )
debug_printf( ", " );\
debug_printf( "%u", I ); } while( 0 )
#else

View File

@@ -1,3 +1,4 @@
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_build.h"

View File

@@ -25,6 +25,9 @@
*
**************************************************************************/
#include <stdio.h>
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_dump.h"

View File

@@ -25,6 +25,7 @@
*
**************************************************************************/
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_parse.h"

View File

@@ -1,3 +1,4 @@
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_parse.h"