summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2009-08-30 22:07:49 +0300
committerPauli Nieminen <[email protected]>2009-08-31 20:27:48 +0300
commitfe62e4c3ff13888a85274c23b88354777760401e (patch)
tree367f5f24f1f0f898de294d722f7b03d1784203cd /src/mesa/drivers/dri
parentb6ebcf8156c4735c2e96e5aad26c3a8dc29f50a6 (diff)
radeon: Make OQ to use new style debugging.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_queryobj.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
index 7eef4faaf61..ed5ebd18e40 100644
--- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c
+++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
@@ -26,12 +26,11 @@
*/
#include "radeon_common.h"
#include "radeon_queryobj.h"
+#include "radeon_debug.h"
#include "main/imports.h"
#include "main/simple_list.h"
-#define DDEBUG 0
-
static int radeonQueryIsFlushed(GLcontext *ctx, struct gl_query_object *q)
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
@@ -52,7 +51,9 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q)
uint32_t *result;
int i;
- if (DDEBUG) fprintf(stderr, "%s: query id %d, result %d\n", __FUNCTION__, query->Base.Id, (int) query->Base.Result);
+ radeon_print(RADEON_STATE, RADEON_VERBOSE,
+ "%s: query id %d, result %d\n",
+ __FUNCTION__, query->Base.Id, (int) query->Base.Result);
radeon_bo_map(query->bo, GL_FALSE);
@@ -61,7 +62,7 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q)
query->Base.Result = 0;
for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) {
query->Base.Result += result[i];
- if (DDEBUG) fprintf(stderr, "result[%d] = %d\n", i, result[i]);
+ radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, result[i]);
}
radeon_bo_unmap(query->bo);
@@ -78,7 +79,7 @@ static struct gl_query_object * radeonNewQueryObject(GLcontext *ctx, GLuint id)
query->Base.Active = GL_FALSE;
query->Base.Ready = GL_TRUE;
- if (DDEBUG) fprintf(stderr, "%s: query id %d\n", __FUNCTION__, query->Base.Id);
+ radeon_print(RADEON_STATE, RADEON_VERBOSE,"%s: query id %d\n", __FUNCTION__, query->Base.Id);
return &query->Base;
}
@@ -87,7 +88,7 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q)
{
struct radeon_query_object *query = (struct radeon_query_object *)q;
- if (DDEBUG) fprintf(stderr, "%s: query id %d\n", __FUNCTION__, q->Id);
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
if (query->bo) {
radeon_bo_unref(query->bo);
@@ -104,7 +105,7 @@ static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q)
if (!radeonQueryIsFlushed(ctx, q))
ctx->Driver.Flush(ctx);
- if (DDEBUG) fprintf(stderr, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, q->Id, query->bo, query->curr_offset);
+ radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, q->Id, query->bo, query->curr_offset);
radeonQueryGetResult(ctx, q);
@@ -117,7 +118,7 @@ static void radeonBeginQuery(GLcontext *ctx, struct gl_query_object *q)
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
struct radeon_query_object *query = (struct radeon_query_object *)q;
- if (DDEBUG) fprintf(stderr, "%s: query id %d\n", __FUNCTION__, q->Id);
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
assert(radeon->query.current == NULL);
@@ -147,7 +148,7 @@ void radeonEmitQueryEnd(GLcontext *ctx)
if (query->emitted_begin == GL_FALSE)
return;
- if (DDEBUG) fprintf(stderr, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, query->Base.Id, query->bo, query->curr_offset);
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, query->Base.Id, query->bo, query->curr_offset);
radeon_cs_space_check_with_bo(radeon->cmdbuf.cs,
query->bo,
@@ -160,7 +161,7 @@ static void radeonEndQuery(GLcontext *ctx, struct gl_query_object *q)
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- if (DDEBUG) fprintf(stderr, "%s: query id %d\n", __FUNCTION__, q->Id);
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
if (radeon->dma.flush)
radeon->dma.flush(radeon->glCtx);
@@ -171,7 +172,7 @@ static void radeonEndQuery(GLcontext *ctx, struct gl_query_object *q)
static void radeonCheckQuery(GLcontext *ctx, struct gl_query_object *q)
{
- if (DDEBUG) fprintf(stderr, "%s: query id %d\n", __FUNCTION__, q->Id);
+ radeon_print(RADEON_STATE, RADEON_TRACE, "%s: query id %d\n", __FUNCTION__, q->Id);
#ifdef DRM_RADEON_GEM_BUSY
radeonContextPtr radeon = RADEON_CONTEXT(ctx);