After finding the 3 places where the reg I wanted to control was changed I
went about normalising the code by creating a function
r200UpdateColorOffset.
Added it to the .h and used in in other files that included that .h. 
After a succsesfull build I got this error???  I then verrified the output
of 'nm' on the bins to find nothing out of place.

[EMAIL PROTECTED]:~$ LIBGL_DEBUG=1 glxgears 
libGL error: dlopen /usr/X11R6-DRI/lib/modules/dri/r200_dri.so failed
(/usr/X11R6-DRI/lib/modules/dri/r200_dri.so: undefined symbol:
r200UpdateColorOffset)
libGL error: unable to find driver: r200_dri.so

What or lords of the register controling world did i miss?



        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 
Index: src/mesa/drivers/dri/r200/r200_ioctl.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c,v
retrieving revision 1.13
diff -u -r1.13 r200_ioctl.c
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c    14 Apr 2004 08:25:57 -0000      1.13
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c    25 May 2004 14:28:54 -0000
@@ -534,8 +534,7 @@
    }
 
    R200_STATECHANGE( rmesa, ctx );
-   rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
-                                          + rmesa->r200Screen->fbLocation;
+   r200UpdateColorOffset( rmesa );
    rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH]  = rmesa->state.color.drawPitch;
 }
 
Index: src/mesa/drivers/dri/r200/r200_lock.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_lock.c,v
retrieving revision 1.6
diff -u -r1.6 r200_lock.c
--- a/src/mesa/drivers/dri/r200/r200_lock.c     21 Mar 2004 17:05:03 -0000      1.6
+++ b/src/mesa/drivers/dri/r200/r200_lock.c     25 May 2004 14:28:54 -0000
@@ -65,8 +65,7 @@
    }
 
    R200_STATECHANGE( rmesa, ctx );
-   rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
-                                          + rmesa->r200Screen->fbLocation;
+   r200UpdateColorOffset( rmesa );
    rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH]  = rmesa->state.color.drawPitch;
 }
 
Index: src/mesa/drivers/dri/r200/r200_state.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_state.c,v
retrieving revision 1.20
diff -u -r1.20 r200_state.c
--- a/src/mesa/drivers/dri/r200/r200_state.c    20 May 2004 00:31:26 -0000      1.20
+++ b/src/mesa/drivers/dri/r200/r200_state.c    25 May 2004 14:28:56 -0000
@@ -1737,6 +1737,25 @@
       r200RecalcScissorRects( rmesa );
 }
 
+void r200UpdateColorOffset( r200ContextPtr rmesa )
+{
+   unsigned int xmax = 0, xmin = (int)-1, ymax = 0, ymin = (int)-1;
+   int i;
+   for ( i = 0 ; i < rmesa->numClipRects ;  i++ )
+     {
+       if ( xmin < rmesa->pClipRects[i].x1 ) xmin = rmesa->pClipRects[i].x1;
+       if ( xmax > rmesa->pClipRects[i].x2 ) xmax = rmesa->pClipRects[i].x2;
+       if ( ymin < rmesa->pClipRects[i].y1 ) ymin = rmesa->pClipRects[i].y1;
+       if ( ymax > rmesa->pClipRects[i].y2 ) ymax = rmesa->pClipRects[i].y2;
+     }
+   rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] =
+     ((rmesa->state.color.drawOffset +
+       rmesa->r200Screen->fbLocation +
+       (xmax / 2048) * xmin +
+       /* (ymax / 2048) * ymin * FBWid + */
+       0)
+      & R200_COLOROFFSET_MASK);
+};
 
 static void r200DrawBuffer( GLcontext *ctx, GLenum mode )
 {
@@ -1772,9 +1791,8 @@
    _swrast_DrawBuffer(ctx, mode);
 
    R200_STATECHANGE( rmesa, ctx );
-   rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset +
-                                              rmesa->r200Screen->fbLocation)
-                                             & R200_COLOROFFSET_MASK);
+   r200UpdateColorOffset( rmesa );
+
    rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
 }
 
Index: src/mesa/drivers/dri/r200/r200_state.h
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_state.h,v
retrieving revision 1.4
diff -u -r1.4 r200_state.h
--- a/src/mesa/drivers/dri/r200/r200_state.h    20 Jan 2004 02:49:27 -0000      1.4
+++ b/src/mesa/drivers/dri/r200/r200_state.h    25 May 2004 14:28:57 -0000
@@ -45,6 +45,7 @@
 extern void r200InitTnlFuncs( GLcontext *ctx );
 
 extern void r200UpdateMaterial( GLcontext *ctx );
+extern void r200UpdateColorOffset( r200ContextPtr rmesa );
 
 extern void r200SetCliprects( r200ContextPtr rmesa, GLenum mode );
 extern void r200RecalcScissorRects( r200ContextPtr rmesa );

Reply via email to