From ffde891a0390a915716087ca7d99b3ddf7f1ef89 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 21 Mar 2009 14:31:14 +1000 Subject: [PATCH] radeon: fix up span function setting --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 12 ++++++++---- src/mesa/drivers/dri/radeon/radeon_span.c | 8 +++++++- src/mesa/drivers/dri/radeon/radeon_span.h | 1 - 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 01978ec2933..0e3ac9c4057 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -180,7 +180,14 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } else { /* TODO Alloc a BO */ - + uint32_t size = width * height * cpp; + + rrb->bo = radeon_bo_open(radeon->radeonScreen->bom, + 0, + size, + 0, + RADEON_GEM_DOMAIN_VRAM, + 0); // rrb->bo = radeon_bo_open(); rb->Width = width; rb->Height = height; @@ -313,8 +320,6 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) rrb->base.AllocStorage = radeon_alloc_window_storage; rrb->base.GetPointer = radeon_get_pointer; - radeonSetSpanFunctions(rrb); - rrb->bo = NULL; return &rrb->base; } @@ -338,7 +343,6 @@ radeon_new_renderbuffer(GLcontext * ctx, GLuint name) return &rrb->base; } - static void radeon_bind_framebuffer(GLcontext * ctx, GLenum target, struct gl_framebuffer *fb, struct gl_framebuffer *fbread) diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 49ec2c378e5..503a1e0b869 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -49,6 +49,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG 0 +static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb); + static GLubyte *radeon_ptr32(const struct radeon_renderbuffer * rrb, GLint x, GLint y) { @@ -366,6 +368,8 @@ static void map_buffer(struct gl_renderbuffer *rb, GLboolean write) __FUNCTION__, r); } } + + radeonSetSpanFunctions(rrb); } static void unmap_buffer(struct gl_renderbuffer *rb) @@ -375,6 +379,8 @@ static void unmap_buffer(struct gl_renderbuffer *rb) if (rrb->bo) { radeon_bo_unmap(rrb->bo); } + rb->GetRow = NULL; + rb->PutRow = NULL; } static void radeonSpanRenderStart(GLcontext * ctx) @@ -446,7 +452,7 @@ void radeonInitSpanFuncs(GLcontext * ctx) /** * Plug in the Get/Put routines for the given driRenderbuffer. */ -void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) +static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) { if (rrb->base.InternalFormat == GL_RGB5) { radeonInitPointers_RGB565(&rrb->base); diff --git a/src/mesa/drivers/dri/radeon/radeon_span.h b/src/mesa/drivers/dri/radeon/radeon_span.h index dd44ab517af..ea6a2e7fb4e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.h +++ b/src/mesa/drivers/dri/radeon/radeon_span.h @@ -44,5 +44,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern void radeonInitSpanFuncs(GLcontext * ctx); -extern void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb); #endif -- 2.30.2