svga: Remove unused buffer download code.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 16 Feb 2010 16:43:53 +0000 (16:43 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 22 Feb 2010 21:46:22 +0000 (21:46 +0000)
Unnecessary now that we never destroy buffer storage.

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

index 0371ddde3687afd3667fbf6e2150e1f82e4af6bb..525352f347c54487684941a34706a7a4015a09c9 100644 (file)
@@ -288,8 +288,6 @@ svga_buffer_upload_flush(struct svga_context *svga,
    sbuf->hw.svga = NULL;
    sbuf->hw.boxes = NULL;
 
-   sbuf->host_written = TRUE;
-
    /* Decrement reference count */
    pipe_reference(&(sbuf->base.reference), NULL);
    sbuf = NULL;
@@ -420,44 +418,6 @@ svga_buffer_map_range( struct pipe_screen *screen,
       if(!sbuf->hw.buf) {
          if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK)
             return NULL;
-         
-         /* Populate the hardware storage if the host surface pre-existed */
-         if(sbuf->host_written) {
-            SVGA3dSurfaceDMAFlags flags;
-            enum pipe_error ret;
-            struct pipe_fence_handle *fence = NULL;
-            
-            assert(sbuf->handle);
-
-            SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "dma from sid %p (buffer), bytes %u - %u\n", 
-                     sbuf->handle, 0, sbuf->base.size);
-
-            memset(&flags, 0, sizeof flags);
-            
-            ret = SVGA3D_BufferDMA(ss->swc,
-                                   sbuf->hw.buf,
-                                   sbuf->handle,
-                                   SVGA3D_READ_HOST_VRAM,
-                                   sbuf->base.size,
-                                   0,
-                                   flags);
-            if(ret != PIPE_OK) {
-               ss->swc->flush(ss->swc, NULL);
-               
-               ret = SVGA3D_BufferDMA(ss->swc,
-                                      sbuf->hw.buf,
-                                      sbuf->handle,
-                                      SVGA3D_READ_HOST_VRAM,
-                                      sbuf->base.size,
-                                      0,
-                                      flags);
-               assert(ret == PIPE_OK);
-            }
-            
-            ss->swc->flush(ss->swc, &fence);
-            sws->fence_finish(sws, fence, 0);
-            sws->fence_reference(sws, &fence, NULL);
-         }
       }
          
       map = sws->buffer_map(sws, sbuf->hw.buf, usage);
index 448ac107c7f309b4e8282dfbb2e7b89403501dd7..e0e1b22e462495c699a30636d14a08fe230b80f0 100644 (file)
@@ -135,11 +135,6 @@ struct svga_buffer
     */
    struct svga_winsys_surface *handle;
    
-   /**
-    * Whether the host has been ever written.
-    */
-   boolean host_written;
-
    struct {
       unsigned count;
       boolean writing;