summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c3
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c11
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel_copy.c7
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel_draw.c37
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel_read.c32
-rw-r--r--src/mesa/drivers/dri/i915/intel_tex_image.c12
6 files changed, 62 insertions, 40 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 897b372ba2..10a362950e 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -485,7 +485,8 @@ void intelDestroyContext(__DRIcontextPrivate *driContextPriv)
/* This share group is about to go away, free our private
* texture object data.
*/
- fprintf(stderr, "do something to free texture heaps\n");
+ if (INTEL_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "do something to free texture heaps\n");
}
/* free the Mesa context */
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index 83c65951b9..9b2d7d9d2e 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -100,11 +100,12 @@ GLboolean intel_check_blit_format( struct intel_region *region,
format == GL_BGR ) {
return GL_TRUE;
}
-
- fprintf(stderr, "%s: bad format for blit (cpp %d, type %s format %s)\n",
- __FUNCTION__, region->cpp,
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(format));
+
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: bad format for blit (cpp %d, type %s format %s)\n",
+ __FUNCTION__, region->cpp,
+ _mesa_lookup_enum_by_nr(type),
+ _mesa_lookup_enum_by_nr(format));
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_copy.c b/src/mesa/drivers/dri/i915/intel_pixel_copy.c
index 75cf4bdfe6..d68b8608d8 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_copy.c
@@ -116,7 +116,8 @@ static GLboolean do_texture_copypixels( GLcontext *ctx,
if (intel_intersect_cliprects(&tmp, &src, &dst)) {
- _mesa_printf("%s: regions overlap\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: regions overlap\n", __FUNCTION__);
return GL_FALSE;
}
}
@@ -339,7 +340,9 @@ void intelCopyPixels( GLcontext *ctx,
if (do_texture_copypixels( ctx, srcx, srcy, width, height, destx, desty, type))
return;
- _mesa_printf("fallback to _swrast_CopyPixels\n");
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("fallback to _swrast_CopyPixels\n");
+
_swrast_CopyPixels( ctx, srcx, srcy, width, height, destx, desty, type);
}
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_draw.c b/src/mesa/drivers/dri/i915/intel_pixel_draw.c
index 8e8ba8744b..3d38c529ce 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_draw.c
@@ -74,7 +74,6 @@ static GLboolean do_texture_drawpixels( GLcontext *ctx,
if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
- _mesa_printf("%s - _mesa_validate_pbo_access\n", __FUNCTION__);
return GL_TRUE;
}
}
@@ -96,7 +95,8 @@ static GLboolean do_texture_drawpixels( GLcontext *ctx,
* possible.
*/
if (!intel_check_meta_tex_fragment_ops(ctx)) {
- _mesa_printf("%s - bad GL fragment state for metaops texture\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad GL fragment state for metaops texture\n", __FUNCTION__);
return GL_FALSE;
}
@@ -163,7 +163,8 @@ static GLboolean do_texture_drawpixels( GLcontext *ctx,
}
- _mesa_printf("draw %d,%d %dx%d\n", dstx,dsty,width,height);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("draw %d,%d %dx%d\n", dstx,dsty,width,height);
/* Must use the regular cliprect mechanism in order to get the
* drawing origin set correctly. Otherwise scissor state is in
@@ -183,7 +184,6 @@ static GLboolean do_texture_drawpixels( GLcontext *ctx,
intel_batchbuffer_flush(intel->batch);
}
UNLOCK_HARDWARE( intel );
- _mesa_printf("%s - DONE\n", __FUNCTION__);
return GL_TRUE;
}
@@ -225,7 +225,8 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
if (!dest) {
- _mesa_printf("%s - no dest\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - no dest\n", __FUNCTION__);
return GL_FALSE;
}
@@ -235,30 +236,32 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
- _mesa_printf("%s - _mesa_validate_pbo_access\n", __FUNCTION__);
-
return GL_TRUE;
}
}
else {
/* PBO only for now:
*/
- _mesa_printf("%s - not PBO\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - not PBO\n", __FUNCTION__);
return GL_FALSE;
}
if (!intel_check_blit_format(dest, format, type)) {
- _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
return GL_FALSE;
}
if (!intel_check_meta_tex_fragment_ops(ctx)) {
- _mesa_printf("%s - bad GL fragment state for meta tex\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad GL fragment state for meta tex\n", __FUNCTION__);
return GL_FALSE;
}
if (ctx->Pixel.ZoomX != 1.0F) {
- _mesa_printf("%s - bad PixelZoomX for blit\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomX for blit\n", __FUNCTION__);
return GL_FALSE;
}
@@ -269,7 +272,8 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
rowLength = width;
if (ctx->Pixel.ZoomY == -1.0F) {
- _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
return GL_FALSE; /* later */
y -= height;
}
@@ -277,7 +281,8 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
rowLength = -rowLength;
}
else {
- _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__);
return GL_FALSE;
}
@@ -326,7 +331,8 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
if (intel->driDrawable->numClipRects)
bmFinishFence(intel->bm, fence);
- _mesa_printf("%s - DONE\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - DONE\n", __FUNCTION__);
return GL_TRUE;
}
@@ -350,7 +356,8 @@ void intelDrawPixels( GLcontext *ctx,
return;
- _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels );
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c b/src/mesa/drivers/dri/i915/intel_pixel_read.c
index e19679b1f0..027b31115e 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -93,7 +93,8 @@ do_texture_readpixels( GLcontext *ctx,
pack->SwapBytes ||
pack->LsbFirst ||
!pack->Invert) {
- fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
return GL_FALSE;
}
@@ -103,10 +104,11 @@ do_texture_readpixels( GLcontext *ctx,
dest_region,
type, format))
{
- fprintf(stderr, "%s: couldn't set dest %s/%s\n",
- __FUNCTION__,
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(format));
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: couldn't set dest %s/%s\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(type),
+ _mesa_lookup_enum_by_nr(format));
return GL_FALSE;
}
@@ -120,7 +122,8 @@ do_texture_readpixels( GLcontext *ctx,
if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
UNLOCK_HARDWARE( intel );
SET_STATE(i830, state);
- fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
return GL_TRUE;
}
@@ -195,27 +198,28 @@ static GLboolean do_blit_readpixels( GLcontext *ctx,
if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
- _mesa_printf("%s - _mesa_validate_pbo_access\n", __FUNCTION__);
-
return GL_TRUE;
}
}
else {
/* PBO only for now:
*/
- _mesa_printf("%s - not PBO\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - not PBO\n", __FUNCTION__);
return GL_FALSE;
}
if (ctx->_ImageTransferState ||
!intel_check_blit_format(src, format, type)) {
- _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
- _mesa_printf("%s: bad packing params\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: bad packing params\n", __FUNCTION__);
return GL_FALSE;
}
@@ -225,7 +229,8 @@ static GLboolean do_blit_readpixels( GLcontext *ctx,
rowLength = width;
if (pack->Invert) {
- _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
return GL_FALSE;
}
else {
@@ -308,7 +313,8 @@ intelReadPixels( GLcontext *ctx,
if (do_texture_readpixels(ctx, x, y, width, height, format, type, pack, pixels))
return;
- _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
_swrast_ReadPixels( ctx, x, y, width, height, format, type, pack, pixels);
}
diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c
index 3a437adbf0..554098ec9d 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915/intel_tex_image.c
@@ -247,8 +247,10 @@ static void intelTexImage(GLcontext *ctx,
if (!intelObj->mt) {
guess_and_alloc_mipmap_tree(intel, intelObj, intelImage);
- if (!intelObj->mt)
- _mesa_printf("guess_and_alloc_mipmap_tree: failed\n");
+ if (!intelObj->mt) {
+ if (INTEL_DEBUG & DEBUG_TEXTURE)
+ _mesa_printf("guess_and_alloc_mipmap_tree: failed\n");
+ }
}
@@ -265,8 +267,10 @@ static void intelTexImage(GLcontext *ctx,
assert(intelImage->mt);
}
- if (!intelImage->mt)
- _mesa_printf("XXX: Image did not fit into tree - storing in local memory!\n");
+ if (!intelImage->mt) {
+ if (INTEL_DEBUG & DEBUG_TEXTURE)
+ _mesa_printf("XXX: Image did not fit into tree - storing in local memory!\n");
+ }
/* intelCopyTexImage calls this function with pixels == NULL, with
* the expectation that the mipmap tree will be set up but nothing