remove debug

This commit is contained in:
Keith Whitwell 2006-01-28 17:52:50 +00:00
parent 43824acb4e
commit b57e79ff14
13 changed files with 56 additions and 55 deletions

View file

@ -158,4 +158,7 @@ void bmFlushDrawCache( struct bufmgr *bm );
void bm_fake_NotifyContendedLockTake( struct bufmgr * );
#define DBG(...) do { if (0) _mesa_printf(__VA_ARGS__); } while(0)
#endif

View file

@ -84,6 +84,7 @@ struct bm_buffer_list {
static struct block *alloc_from_pool( struct bufmgr *bm,
unsigned pool_nr,
unsigned size,
@ -94,11 +95,11 @@ static struct block *alloc_from_pool( struct bufmgr *bm,
if (!block)
return NULL;
_mesa_printf("alloc_from_pool %d sz 0x%x\n", pool_nr, size);
DBG("alloc_from_pool %d sz 0x%x\n", pool_nr, size);
block->mem = mmAllocMem(pool->heap, size, align, 0);
if (!block->mem) {
_mesa_printf("\t- failed\n");
DBG("\t- failed\n");
free(block);
return NULL;
}
@ -108,7 +109,7 @@ static struct block *alloc_from_pool( struct bufmgr *bm,
block->mem_type = pool->flags & BM_MEM_MASK;
block->virtual = pool->virtual + block->mem->ofs;
_mesa_printf("\t- offset 0x%x\n", block->mem->ofs);
DBG("\t- offset 0x%x\n", block->mem->ofs);
return block;
}
@ -119,7 +120,7 @@ static struct block *alloc_local( unsigned size )
if (!block)
return NULL;
_mesa_printf("alloc_local 0x%x\n", size);
DBG("alloc_local 0x%x\n", size);
block->mem_type = BM_MEM_LOCAL;
block->virtual = malloc(size);
@ -229,7 +230,7 @@ static int move_buffers( struct bufmgr *bm,
struct block *newMem[BM_LIST_MAX];
GLint i;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
memset(newMem, 0, sizeof(newMem));
@ -240,7 +241,7 @@ static int move_buffers( struct bufmgr *bm,
if (flags & BM_NO_UPLOAD)
goto cleanup;
_mesa_printf("try to move buffer %d size 0x%x to pools 0x%x\n",
DBG("try to move buffer %d size 0x%x to pools 0x%x\n",
buffers[i]->id, buffers[i]->size, flags & BM_MEM_MASK);
newMem[i] = alloc_block(bm,
@ -262,6 +263,7 @@ static int move_buffers( struct bufmgr *bm,
* mechanisms in final version. Memcpy (or sse_memcpy) is
* probably pretty good for local->agp uploads.
*/
_mesa_printf("* %d\n", buffers[i]->size);
memcpy(newMem[i]->virtual,
buffers[i]->block->virtual,
buffers[i]->size);
@ -277,7 +279,7 @@ static int move_buffers( struct bufmgr *bm,
if (nr && (flags & (BM_MEM_AGP|BM_MEM_VRAM)))
bmFlushReadCaches(bm);
_mesa_printf("%s - success\n", __FUNCTION__);
DBG("%s - success\n", __FUNCTION__);
return 1;
cleanup:
@ -288,7 +290,7 @@ static int move_buffers( struct bufmgr *bm,
free_block(bm, newMem[i]);
}
_mesa_printf("%s - fail\n", __FUNCTION__);
DBG("%s - fail\n", __FUNCTION__);
return 0;
}
@ -298,7 +300,7 @@ static unsigned evict_lru( struct bufmgr *bm,
{
int i;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
if (flags & BM_NO_EVICT)
return 0;
@ -413,7 +415,7 @@ int bmInitPool( struct bufmgr *bm,
i = bm->nr_pools++;
_mesa_printf("bmInitPool %d low_offset %x sz %x\n",
DBG("bmInitPool %d low_offset %x sz %x\n",
i, low_offset, size);
bm->pool[i].heap = mmInit( low_offset, size );
@ -516,7 +518,7 @@ void bmBufferData(struct bufmgr *bm,
{
struct buffer *buf = (struct buffer *)_mesa_HashLookup( bm->hash, buffer );
_mesa_printf("bmBufferData %d sz 0x%x data: %p\n", buffer, size, data);
DBG("bmBufferData %d sz 0x%x data: %p\n", buffer, size, data);
if (buf->block) {
if ((buf->block->mem_type != BM_MEM_LOCAL && !bmTestFence(bm, buf->block->fence)) ||
@ -545,7 +547,7 @@ void bmBufferSubData(struct bufmgr *bm,
{
struct buffer *buf = (struct buffer *)_mesa_HashLookup( bm->hash, buffer );
_mesa_printf("bmBufferSubdata %d offset 0x%x sz 0x%x\n", buffer, offset, size);
DBG("bmBufferSubdata %d offset 0x%x sz 0x%x\n", buffer, offset, size);
if (buf->block == 0)
bmAllocMem(bm, buf);
@ -566,7 +568,7 @@ void *bmMapBuffer( struct bufmgr *bm,
{
struct buffer *buf = (struct buffer *)_mesa_HashLookup( bm->hash, buffer );
_mesa_printf("bmMapBuffer %d\n", buffer);
DBG("bmMapBuffer %d\n", buffer);
if (buf->mapped)
return NULL;
@ -588,7 +590,7 @@ void bmUnmapBuffer( struct bufmgr *bm, unsigned buffer )
{
struct buffer *buf = (struct buffer *)_mesa_HashLookup( bm->hash, buffer );
_mesa_printf("bmUnmapBuffer %d\n", buffer);
DBG("bmUnmapBuffer %d\n", buffer);
buf->mapped = 0;
}
@ -617,7 +619,7 @@ void bm_fake_SetFixedBufferParams( struct bufmgr *bm
struct bm_buffer_list *bmNewBufferList( void )
{
struct bm_buffer_list *list = calloc(sizeof(*list), 1);
_mesa_printf("bmNewBufferList\n");
DBG("bmNewBufferList\n");
return list;
}
@ -634,7 +636,7 @@ void bmAddBuffer( struct bm_buffer_list *list,
list->elem[list->nr].memtype_return = memtype_return;
list->elem[list->nr].offset_return = offset_return;
_mesa_printf("bmAddBuffer nr %d buf %d\n",
DBG("bmAddBuffer nr %d buf %d\n",
list->nr, buffer);
list->nr++;
@ -662,7 +664,7 @@ int bmValidateBufferList( struct bufmgr *bm,
struct buffer *bufs[BM_LIST_MAX];
unsigned i;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
if (list->nr > BM_LIST_MAX)
return 0;
@ -683,7 +685,7 @@ int bmValidateBufferList( struct bufmgr *bm,
for (i = 0; i < list->nr; i++) {
_mesa_printf("%d: buf %d ofs 0x%x\n",
DBG("%d: buf %d ofs 0x%x\n",
i, bufs[i]->id, bufs[i]->block->mem->ofs);
list->elem[i].offset_return[0] = bufs[i]->block->mem->ofs;
@ -707,7 +709,7 @@ int bmValidateBufferList( struct bufmgr *bm,
void bmFenceBufferList( struct bufmgr *bm, struct bm_buffer_list *list )
{
_mesa_printf("%s (%d bufs)\n", __FUNCTION__, list->nr);
DBG("%s (%d bufs)\n", __FUNCTION__, list->nr);
if (list->nr) {
unsigned i;

View file

@ -150,7 +150,7 @@ GLboolean i915_miptree_layout( struct intel_mipmap_tree *mt )
break;
}
}
_mesa_printf("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
mt->pitch,
mt->total_height,
mt->cpp,
@ -329,7 +329,7 @@ GLboolean i945_miptree_layout( struct intel_mipmap_tree *mt )
break;
}
}
_mesa_printf("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
mt->pitch,
mt->total_height,
mt->cpp,

View file

@ -274,7 +274,6 @@ static void i915_emit_state( intelContextPtr intel )
if (dirty & I915_UPLOAD_TEX(i)) {
/* Emit zero texture offset, will fixup before firing */
intel_add_texoffset_fixup(intel, i, (GLuint *)batch_ptr);
_mesa_printf("MS2: %x\n", *(GLuint *)batch_ptr);
batch_ptr += 4;
OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]);
OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]);

View file

@ -181,11 +181,12 @@ void intelEmitCopyBlitLocked( intelContextPtr intel,
BATCH_LOCALS;
_mesa_printf("%s src:0x%x/%d %d,%d dst:0x%x/%d %d,%d sz:%dx%d\n",
__FUNCTION__,
src_offset, src_pitch, src_x, src_y,
dst_offset, dst_pitch, dst_x, dst_y,
w,h);
if (0)
_mesa_printf("%s src:0x%x/%d %d,%d dst:0x%x/%d %d,%d sz:%dx%d\n",
__FUNCTION__,
src_offset, src_pitch, src_x, src_y,
dst_offset, dst_pitch, dst_x, dst_y,
w,h);
src_pitch *= cpp;
dst_pitch *= cpp;

View file

@ -60,7 +60,7 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
GLboolean ok;
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
_mesa_printf("%s target %s format %s level %d..%d\n", __FUNCTION__,
DBG("%s target %s format %s level %d..%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
_mesa_lookup_enum_by_nr(internal_format),
first_level,
@ -132,7 +132,7 @@ GLboolean intel_miptree_match_image( struct intel_mipmap_tree *mt,
GLuint face,
GLuint level )
{
_mesa_printf("%s %d %d/%d %d/%d\n", __FUNCTION__,
DBG("%s %d %d/%d %d/%d\n", __FUNCTION__,
image->Border,
image->InternalFormat, mt->internal_format,
image->IsCompressed, mt->compressed);
@ -146,7 +146,7 @@ GLboolean intel_miptree_match_image( struct intel_mipmap_tree *mt,
image->IsCompressed != mt->compressed)
return GL_FALSE;
_mesa_printf("%s: %d/%d %d/%d %d/%d\n", __FUNCTION__,
DBG("%s: %d/%d %d/%d %d/%d\n", __FUNCTION__,
image->Width, mt->offset[face][level].width,
image->Height, mt->offset[face][level].height,
image->Depth, mt->offset[face][level].depth);
@ -161,7 +161,7 @@ GLboolean intel_miptree_match_image( struct intel_mipmap_tree *mt,
return GL_FALSE;
_mesa_printf("%s: success\n", __FUNCTION__);
DBG("%s: success\n", __FUNCTION__);
return GL_TRUE;
}
@ -183,7 +183,7 @@ GLubyte *intel_miptree_image_map(struct intel_context *intel,
GLuint level,
GLuint *stride)
{
_mesa_printf("%s \n", __FUNCTION__);
DBG("%s \n", __FUNCTION__);
if (stride)
*stride = mt->pitch * mt->cpp;
@ -195,7 +195,7 @@ GLubyte *intel_miptree_image_map(struct intel_context *intel,
void intel_miptree_image_unmap(struct intel_context *intel,
struct intel_mipmap_tree *mt)
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
intel_region_unmap(intel, mt->region);
}
@ -211,7 +211,7 @@ void intel_miptree_image_data(struct intel_context *intel,
GLuint level,
void *src, GLuint src_pitch )
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
intel_region_data(intel,
dst->region,
dst->offset[face][level].x,
@ -230,7 +230,7 @@ void intel_miptree_image_copy( struct intel_context *intel,
GLuint face, GLuint level,
struct intel_mipmap_tree *src )
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
assert(src->offset[face][level].width ==
dst->offset[face][level].width);

View file

@ -48,7 +48,7 @@
*/
GLubyte *intel_region_map(struct intel_context *intel, struct intel_region *region)
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
if (!region->map_refcount++) {
region->map = bmMapBuffer(intel->bm, region->buffer, 0);
}
@ -59,7 +59,7 @@ GLubyte *intel_region_map(struct intel_context *intel, struct intel_region *regi
void intel_region_unmap(struct intel_context *intel,
struct intel_region *region)
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
if (!--region->map_refcount) {
bmUnmapBuffer(intel->bm, region->buffer);
}
@ -72,7 +72,7 @@ struct intel_region *intel_region_alloc( struct intel_context *intel,
{
struct intel_region *region = calloc(sizeof(*region), 1);
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
region->cpp = cpp;
region->pitch = pitch;
@ -114,7 +114,7 @@ struct intel_region *intel_region_create_static( struct intel_context *intel,
GLuint size = cpp * pitch * height;
GLint pool;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
region->cpp = cpp;
region->pitch = pitch;
@ -246,7 +246,7 @@ void intel_region_data(struct intel_context *intel,
GLuint srcx, GLuint srcy,
GLuint width, GLuint height)
{
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
LOCK_HARDWARE(intel);
@ -279,7 +279,7 @@ void intel_region_copy( struct intel_context *intel,
unsigned src_offset;
struct bm_buffer_list *list = bmNewBufferList();
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
assert(src->cpp == dst->cpp);
@ -330,7 +330,7 @@ void intel_region_fill( struct intel_context *intel,
unsigned dst_offset;
struct bm_buffer_list *list = bmNewBufferList();
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
LOCK_HARDWARE(intel);
bmAddBuffer(list, dst->buffer, BM_WRITE, NULL, &dst_offset);

View file

@ -29,7 +29,7 @@
#define INTEL_REGIONS_H
#include "mtypes.h"
#include "bufmgr.h" /* for DBG! */
struct intel_context;
/* A layer on top of the bufmgr buffers that adds a few useful things:

View file

@ -90,7 +90,7 @@ static GLboolean do_copy_texsubimage( struct intel_context *intel,
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
struct bm_buffer_list *list = bmNewBufferList();
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
intelImage->face,
intelImage->level);
GLuint dst_offset = 0;
@ -179,11 +179,6 @@ void intelCopyTexImage1D( GLcontext *ctx, GLenum target, GLint level,
GL_RGBA, CHAN_TYPE, NULL,
&ctx->DefaultPacking, texObj, texImage);
if (!texImage)
goto fail;
if (!do_copy_texsubimage(intel_context(ctx),
intel_texture_image(texImage),
internalFormat,

View file

@ -65,7 +65,7 @@ static void guess_and_alloc_mipmap_tree( struct intel_context *intel,
GLuint l2width, l2height, l2depth;
GLuint i;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
if (intelImage->base.Border)
return;
@ -124,7 +124,7 @@ static void guess_and_alloc_mipmap_tree( struct intel_context *intel,
intelImage->base.TexFormat->TexelBytes,
intelImage->base.IsCompressed );
_mesa_printf("%s - success\n", __FUNCTION__);
DBG("%s - success\n", __FUNCTION__);
}
@ -165,7 +165,7 @@ static void intelTexImage(GLcontext *ctx,
GLint texelBytes, sizeInBytes;
GLuint dstRowStride;
_mesa_printf("%s target %s level %d %dx%d border %d\n", __FUNCTION__,
DBG("%s target %s level %d %dx%d border %d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
level,
width, height, border);

View file

@ -51,7 +51,7 @@ static void intelTexSubimage (GLcontext *ctx,
GLuint dstImageStride = 0;
GLuint dstRowStride;
_mesa_printf("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
level,
xoffset, yoffset,

View file

@ -250,7 +250,7 @@ GLboolean intel_validate_buffers( struct intel_context *intel )
GLboolean ok = GL_TRUE;
GLuint i;
_mesa_printf("%s\n", __FUNCTION__);
DBG("%s\n", __FUNCTION__);
assert(intel->locked);
assert (!intel->buffer_list);

View file

@ -102,7 +102,8 @@ void intelStartInlinePrimitive( intelContextPtr intel, GLuint prim )
{
BATCH_LOCALS;
fprintf(stderr, "%s %x\n", __FUNCTION__, prim);
if (0)
fprintf(stderr, "%s %x\n", __FUNCTION__, prim);
/* Finish any in-progress primitive: