From 4767d27ee32cc30ee00ab5265ecbb8eeefcab8c9 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Tue, 9 Feb 2010 21:37:19 +0200 Subject: [PATCH] radeon: Add some debug output for fbo support --- src/mesa/drivers/dri/radeon/radeon_common.h | 7 +++ src/mesa/drivers/dri/radeon/radeon_fbo.c | 53 ++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_span.c | 8 +++ src/mesa/drivers/dri/radeon/radeon_texture.c | 12 +++++ 4 files changed, 80 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h index f31f08edf36..cd01c9984e3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.h +++ b/src/mesa/drivers/dri/radeon/radeon_common.h @@ -48,6 +48,9 @@ void radeon_check_front_buffer_rendering(GLcontext *ctx); static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb) { struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb; + radeon_print(RADEON_MEMORY, RADEON_TRACE, + "%s(rb %p)\n", + __func__, rb); if (rrb && rrb->base.ClassID == RADEON_RB_CLASS) return rrb; else @@ -56,6 +59,10 @@ static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbu static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index) { + radeon_print(RADEON_MEMORY, RADEON_TRACE, + "%s(fb %p, index %d)\n", + __func__, fb, att_index); + if (att_index >= 0) return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer); else diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index e780b9eef1b..01fe933a670 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -29,6 +29,7 @@ #include "main/imports.h" #include "main/macros.h" #include "main/mtypes.h" +#include "main/enums.h" #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" @@ -56,6 +57,10 @@ radeon_delete_renderbuffer(struct gl_renderbuffer *rb) { struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb); + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(rb %p, rrb %p) \n", + __func__, rb, rrb); + ASSERT(rrb); if (rrb && rrb->bo) { @@ -68,6 +73,10 @@ static void * radeon_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) { + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rb %p) \n", + __func__, ctx, rb); + return NULL; } @@ -85,6 +94,10 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, GLboolean software_buffer = GL_FALSE; int cpp; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rb %p) \n", + __func__, ctx, rb); + ASSERT(rb->Name != 0); switch (internalFormat) { case GL_R3_G3_B2: @@ -200,6 +213,10 @@ radeon_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; rb->InternalFormat = internalFormat; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rb %p) \n", + __func__, ctx, rb); + return GL_TRUE; } @@ -212,6 +229,10 @@ radeon_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb, struct radeon_framebuffer *radeon_fb = (struct radeon_framebuffer*)fb; int i; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, fb %p) \n", + __func__, ctx, fb); + _mesa_resize_framebuffer(ctx, fb, width, height); fb->Initialized = GL_TRUE; /* XXX remove someday */ @@ -252,6 +273,11 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv) struct radeon_renderbuffer *rrb; rrb = CALLOC_STRUCT(radeon_renderbuffer); + + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s( rrb %p ) \n", + __func__, rrb); + if (!rrb) return NULL; @@ -331,6 +357,11 @@ radeon_new_renderbuffer(GLcontext * ctx, GLuint name) struct radeon_renderbuffer *rrb; rrb = CALLOC_STRUCT(radeon_renderbuffer); + + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rrb %p) \n", + __func__, ctx, rrb); + if (!rrb) return NULL; @@ -348,6 +379,11 @@ static void radeon_bind_framebuffer(GLcontext * ctx, GLenum target, struct gl_framebuffer *fb, struct gl_framebuffer *fbread) { + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, fb %p, target %s) \n", + __func__, ctx, fb, + _mesa_lookup_enum_by_nr(target)); + if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) { radeon_draw_buffer(ctx, fb); } @@ -365,6 +401,10 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx, if (ctx->Driver.Flush) ctx->Driver.Flush(ctx); /* +r6/r7 */ + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, fb %p, rb %p) \n", + __func__, ctx, fb, rb); + _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb); radeon_draw_buffer(ctx, fb); } @@ -383,6 +423,10 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, int retry = 0; gl_format texFormat; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rrb %p, texImage %p) \n", + __func__, ctx, rrb, texImage); + restart: if (texImage->TexFormat == _dri_texformat_argb8888) { rrb->base.DataType = GL_UNSIGNED_BYTE; @@ -453,6 +497,11 @@ radeon_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) /* make an radeon_renderbuffer to wrap the texture image */ rrb = CALLOC_STRUCT(radeon_renderbuffer); + + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, rrb %p, texImage %p) \n", + __func__, ctx, rrb, texImage); + if (!rrb) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture"); return NULL; @@ -480,6 +529,10 @@ radeon_render_texture(GLcontext * ctx, radeon_texture_image *radeon_image; GLuint imageOffset; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, fb %p, rrb %p, att att)\n", + __func__, ctx, fb, rrb, att); + (void) fb; ASSERT(newImage); diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 8db3d2b143b..1adb6096033 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -810,6 +810,10 @@ static void map_unmap_rb(struct gl_renderbuffer *rb, int flag) if (rrb == NULL || !rrb->bo) return; + radeon_print(RADEON_MEMORY, RADEON_TRACE, + "%s( rb %p, flag %s )\n", + __func__, rb, flag ? "true":"false"); + if (flag) { radeon_bo_wait(rrb->bo); r = radeon_bo_map(rrb->bo, 1); @@ -832,6 +836,10 @@ radeon_map_unmap_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, { GLuint i, j; + radeon_print(RADEON_MEMORY, RADEON_TRACE, + "%s( %p , fb %p, map %s )\n", + __func__, ctx, fb, map ? "true":"false"); + /* color draw buffers */ for (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers; j++) map_unmap_rb(fb->_ColorDrawBuffers[j], map); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 86b213c05cb..9179a3f5c8a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -129,6 +129,10 @@ static void teximage_set_map_data(radeon_texture_image *image) */ void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable) { + radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, + "%s(img %p), write_enable %s.\n", + __func__, image, + write_enable ? "true": "false"); if (image->mt) { assert(!image->base.Data); @@ -140,6 +144,9 @@ void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable) void radeon_teximage_unmap(radeon_texture_image *image) { + radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, + "%s(img %p)\n", + __func__, image); if (image->mt) { assert(image->base.Data); @@ -275,6 +282,11 @@ void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_objec radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]); bo = !baseimage->mt ? baseimage->bo : baseimage->mt->bo; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s(%p, target %s, tex %p)\n", + __func__, _mesa_lookup_enum_by_nr(target), + texObj); + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) { radeon_print(RADEON_TEXTURE, RADEON_NORMAL, "%s(%p, tex %p) Trying to generate mipmap for texture " -- 2.30.2