radeon: fix up span function setting
authorDave Airlie <airlied@linux.ie>
Sat, 21 Mar 2009 04:31:14 +0000 (14:31 +1000)
committerDave Airlie <airlied@linux.ie>
Sat, 21 Mar 2009 04:31:14 +0000 (14:31 +1000)
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_span.c
src/mesa/drivers/dri/radeon/radeon_span.h

index 01978ec..0e3ac9c 100644 (file)
@@ -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)
index 49ec2c3..503a1e0 100644 (file)
@@ -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);
index dd44ab5..ea6a2e7 100644 (file)
@@ -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