Am Dienstag, 21. September 2004 00:00 schrieb Roland Scheidegger:
> Eric Anholt wrote:
> > The attached patch removes the mandatory emits of all state which were
> > happening after each cmdbuf flush.  Instead, we set a flag after a
> > cmdbuf flush saying "save the state at the next unlock," which means
> > memcpying the state atoms off.  When we actually see the context get
> > lost, then we "back up" and restore state -- make a new cmdbuf, dirty
> > all state, emit it, flush it, then put the old cmdbuf back.
>
> I like it ;-). I thought the locking really to be inefficient (but never
> did anything against it...).
>
> > I also
> > removed the dirty/clean state lists and made a single one.  The
> > reasoning was that we have to walk the entire list on emit (and twice
> > when the all-dirty is set) anyway, and I felt that this was cleaner.
>
> It was not always that inefficient in r200EmitState, only since the
> fixed emit order was introduced (and still no one understands why the
> fixed order is needed). Didn't seem to make a performance difference
> though (profiling showed it really didn't use much cpu time).
>
> > This gets about a 5% speedup for me in ipers (which I wish was more
> > accurate in its reporting), and doesn't touch glxgears.  I didn't have
> > any interesting apps besides glxgears handy to benchmark with.  Any
> > thoughts on this?  If people think it's a good idea, I'll do it for
> > radeon as well.
>
> I certainly think it's a good idea.
> However, I still think it should be possible to lock across multiple
> buffers, to make it possible to emit larger numbers of vertices at once
> (for instance for things like glDrawElements), which, as far as I
> understand, just cannot work if you're restricted to one buffer.

Is this related?
http://marc.theaimsgroup.com/?l=dri-devel&m=108350714917936&w=2

-Dieter
? depend
Index: r200_pixel.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c,v
retrieving revision 1.6
diff -u -r1.6 r200_pixel.c
--- r200_pixel.c	27 Apr 2004 18:37:13 -0000	1.6
+++ r200_pixel.c	2 May 2004 14:01:47 -0000
@@ -287,7 +287,7 @@
 static void do_draw_pix( GLcontext *ctx,
 			 GLint x, GLint y, GLsizei width, GLsizei height,
 			 GLint pitch,
-			 const void *pixels,
+			 int src_offset,
 			 GLuint planemask)
 {
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -297,7 +297,6 @@
    int i;
    int blit_format;
    int size;
-   int src_offset = r200GartOffsetFromVirtual( rmesa, pixels );
    int src_pitch = pitch * rmesa->r200Screen->cpp;
 
    if (R200_DEBUG & DEBUG_PIXEL)
@@ -429,14 +428,20 @@
       do_draw_pix( ctx, x, y, width, height, pitch, pixels, planemask );
       return GL_TRUE;
    }
-   else if (0)
+   else
    {
       /* Pixels is in regular memory -- get dma buffers and perform
        * upload through them.
        */
+      struct r200_dma_region region;
+      memset(&region, 0, sizeof(region));
+      r200AllocDmaRegion( rmesa, &region, size, 1024 );
+      memcpy(region.address + region.start, pixels, size);
+      
+      do_draw_pix( ctx, x, y, width, height, pitch, GET_START(&region), planemask );
+      
+      r200ReleaseDmaRegion(rmesa,&region,__FUNCTION__);
    }
-   else
-      return GL_FALSE;
 }
 
 static void

Reply via email to