Dieter Nützel wrote:


I get this with current Mesa CVS and DRI CVS for r200:


[snip errors]

Sorry, a correct patch is attached. Note that to try it, you need :
- to draw less than 64KB of pixels (that is ~16000 RGBA8 pixels)
- to specify glPixelZoom(1.F,-1.F);
- to use the correct pixel format : glDrawPixels(width,height,GL_BGRA,GL_UNSIGNED_INT_8_8_8_8_REV,mem);


The problem I have is that everything seems to work fine (dma memory is allocated/deallocated withouth error, emitblit seems to work) but no pixels happen to be drawn.

Stephane

? 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