Mesa (master): svga: clean up svga_pipe_blit.c

Brian Paul brianp at kemper.freedesktop.org
Tue May 3 21:42:06 UTC 2016


Module: Mesa
Branch: master
Commit: b94f73c15066d434e44b60ddddb1d837b841c08f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b94f73c15066d434e44b60ddddb1d837b841c08f

Author: Brian Paul <brianp at vmware.com>
Date:   Mon May  2 17:57:43 2016 -0600

svga: clean up svga_pipe_blit.c

Remove dead code.  Fix formatting.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_blit.c | 81 +++++--------------------------
 1 file changed, 13 insertions(+), 68 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index 2b34f96..925f972 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -36,21 +36,17 @@
 #define FILE_DEBUG_FLAG DEBUG_BLIT
 
 
-/* XXX still have doubts about this... */
-static void svga_surface_copy(struct pipe_context *pipe,
-                              struct pipe_resource* dst_tex,
-                              unsigned dst_level,
-                              unsigned dstx, unsigned dsty, unsigned dstz,
-                              struct pipe_resource* src_tex,
-                              unsigned src_level,
-                              const struct pipe_box *src_box)
+static void
+svga_surface_copy(struct pipe_context *pipe,
+                  struct pipe_resource* dst_tex,
+                  unsigned dst_level,
+                  unsigned dstx, unsigned dsty, unsigned dstz,
+                  struct pipe_resource* src_tex,
+                  unsigned src_level,
+                  const struct pipe_box *src_box)
  {
    struct svga_context *svga = svga_context(pipe);
    struct svga_texture *stex, *dtex;
-/*   struct pipe_screen *screen = pipe->screen;
-   SVGA3dCopyBox *box;
-   enum pipe_error ret;
-   struct pipe_surface *srcsurf, *dstsurf;*/
    unsigned dst_face, dst_z, src_face, src_z;
 
    /* Emit buffered drawing commands, and any back copies.
@@ -67,58 +63,6 @@ static void svga_surface_copy(struct pipe_context *pipe,
    stex = svga_texture(src_tex);
    dtex = svga_texture(dst_tex);
 
-#if 0
-   srcsurf = screen->get_tex_surface(screen, src_tex,
-                                     src_level, src_box->z, src_box->z,
-                                     PIPE_BIND_SAMPLER_VIEW);
-
-   dstsurf = screen->get_tex_surface(screen, dst_tex,
-                                     dst_level, dst_box->z, dst_box->z,
-                                     PIPE_BIND_RENDER_TARGET);
-
-   SVGA_DBG(DEBUG_DMA, "blit to sid %p (%d,%d), from sid %p (%d,%d) sz %dx%d\n",
-            svga_surface(dstsurf)->handle,
-            dstx, dsty,
-            svga_surface(srcsurf)->handle,
-            src_box->x, src_box->y,
-            width, height);
-
-   ret = SVGA3D_BeginSurfaceCopy(svga->swc,
-                                 srcsurf,
-                                 dstsurf,
-                                 &box,
-                                 1);
-   if(ret != PIPE_OK) {
-
-      svga_context_flush(svga, NULL);
-
-      ret = SVGA3D_BeginSurfaceCopy(svga->swc,
-                                    srcsurf,
-                                    dstsurf,
-                                    &box,
-                                    1);
-      assert(ret == PIPE_OK);
-   }
-
-   box->x = dstx;
-   box->y = dsty;
-   box->z = 0;
-   box->w = width;
-   box->h = height;
-   box->d = 1;
-   box->srcx = src_box->x;
-   box->srcy = src_box->y;
-   box->srcz = 0;
-
-   SVGA_FIFOCommitAll(svga->swc);
-
-   svga_surface(dstsurf)->dirty = TRUE;
-   svga_propagate_surface(pipe, dstsurf);
-
-   pipe_surface_reference(&srcsurf, NULL);
-   pipe_surface_reference(&dstsurf, NULL);
-
-#else
    if (src_tex->target == PIPE_TEXTURE_CUBE) {
       src_face = src_box->z;
       src_z = 0;
@@ -128,6 +72,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
       src_face = 0;
       src_z = src_box->z;
    }
+
    /* different src/dst type???*/
    if (dst_tex->target == PIPE_TEXTURE_CUBE) {
       dst_face = dstz;
@@ -138,6 +83,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
       dst_face = 0;
       dst_z = dstz;
    }
+
    svga_texture_copy_handle(svga,
                             stex->handle,
                             src_box->x, src_box->y, src_z,
@@ -147,15 +93,14 @@ static void svga_surface_copy(struct pipe_context *pipe,
                             dst_level, dst_face,
                             src_box->width, src_box->height, src_box->depth);
 
-#endif
-
    /* Mark the destination image as being defined */
    svga_define_texture_level(dtex, dst_face, dst_level);
 }
 
 
-static void svga_blit(struct pipe_context *pipe,
-                      const struct pipe_blit_info *blit_info)
+static void
+svga_blit(struct pipe_context *pipe,
+          const struct pipe_blit_info *blit_info)
 {
    struct svga_context *svga = svga_context(pipe);
    struct pipe_blit_info info = *blit_info;




More information about the mesa-commit mailing list