svga: Fix the guest offset of piecewise buffer DMAs.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 22 Feb 2010 19:20:25 +0000 (19:20 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 22 Feb 2010 21:47:19 +0000 (21:47 +0000)
It was being erroneously set equal to the host offset, but it should be
zero.

src/gallium/drivers/svga/svga_cmd.c
src/gallium/drivers/svga/svga_cmd.h
src/gallium/drivers/svga/svga_screen_buffer.c

index a0da7d7e5d5dd67a8b0e7273376af5a91a27cbf9..04307d17fe0cd59fe078f6a6887bdaaa8ce4ee96 100644 (file)
@@ -478,7 +478,8 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc,
                  struct svga_winsys_surface *host,
                  SVGA3dTransferType transfer,      // IN
                  uint32 size,                      // IN
-                 uint32 offset,                    // IN
+                 uint32 guest_offset,              // IN
+                 uint32 host_offset,               // IN
                  SVGA3dSurfaceDMAFlags flags)      // IN
 {
    SVGA3dCmdSurfaceDMA *cmd;
@@ -517,19 +518,19 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc,
    cmd->transfer = transfer;
 
    box = (SVGA3dCopyBox *)&cmd[1];
-   box->x = offset;
+   box->x = host_offset;
    box->y = 0;
    box->z = 0;
    box->w = size;
    box->h = 1;
    box->d = 1;
-   box->srcx = offset;
+   box->srcx = guest_offset;
    box->srcy = 0;
    box->srcz = 0;
    
    pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + sizeof *box);
    pSuffix->suffixSize = sizeof *pSuffix;
-   pSuffix->maximumOffset = offset + size;
+   pSuffix->maximumOffset = guest_offset + size;
    pSuffix->flags = flags;
 
    swc->commit(swc);
index 804105476907272496625214b957c5c1bf095d90..da9fc4355fae61f583a6859fbd26da65dba2fea1 100644 (file)
@@ -111,7 +111,8 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc,
                  struct svga_winsys_surface *host,
                  SVGA3dTransferType transfer,
                  uint32 size,
-                 uint32 offset,
+                 uint32 guest_offset,
+                 uint32 host_offset,
                  SVGA3dSurfaceDMAFlags flags);
 
 /*
index 54663e764b0ac4a59354750383ca0b67601fee83..e3f4a4626050259b1ff959a93a6cf42ae7f5ca7b 100644 (file)
@@ -715,13 +715,13 @@ svga_buffer_upload_piecewise(struct svga_screen *ss,
          ret = SVGA3D_BufferDMA(svga->swc,
                                 hwbuf, sbuf->handle,
                                 SVGA3D_WRITE_HOST_VRAM,
-                                size, offset, sbuf->dma.flags);
+                                size, 0, offset, sbuf->dma.flags);
          if(ret != PIPE_OK) {
             svga_context_flush(svga, NULL);
             ret =  SVGA3D_BufferDMA(svga->swc,
                                     hwbuf, sbuf->handle,
                                     SVGA3D_WRITE_HOST_VRAM,
-                                    size, offset, sbuf->dma.flags);
+                                    size, 0, offset, sbuf->dma.flags);
             assert(ret == PIPE_OK);
          }