Mesa (master): svga: remove redundant surface propagation

Brian Paul brianp at kemper.freedesktop.org
Fri Apr 7 19:51:09 UTC 2017


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

Author: Charmaine Lee <charmainel at vmware.com>
Date:   Mon Apr  3 12:57:18 2017 -0700

svga: remove redundant surface propagation

Currently, surface propagation for colliding render target resource is
done at framebuffer emit time for vgpu10. This patch
adds the surface propagation for non-vgpu10 path to emit_fb_vgpu9()
and removes the redundant surface copy at set time.

Tested with MTT glretrace, piglit, NobelClinicianViewer, Turbine, Cinebench.

Reviewed-by: Neha Bhende <bhenden at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_misc.c         | 12 ------------
 src/gallium/drivers/svga/svga_state_framebuffer.c |  8 ++++++++
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c
index 725cf33f8c..e5d37419cc 100644
--- a/src/gallium/drivers/svga/svga_pipe_misc.c
+++ b/src/gallium/drivers/svga/svga_pipe_misc.c
@@ -121,18 +121,6 @@ svga_set_framebuffer_state(struct pipe_context *pipe,
    dst->height = fb->height;
    dst->nr_cbufs = fb->nr_cbufs;
 
-   /* Check if we need to propagate any of the render targets which we may
-    * be unbinding.
-    */
-   for (i = 0; i < dst->nr_cbufs; i++) {
-      struct pipe_surface *s = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;
-      if (dst->cbufs[i] && dst->cbufs[i] != s) {
-         if (svga_surface_needs_propagation(dst->cbufs[i])) {
-            svga_propagate_surface(svga, dst->cbufs[i], FALSE);
-         }
-      }
-   }
-
    /* Check that all surfaces are the same size.
     * Actually, the virtual hardware may support rendertargets with
     * different size, depending on the host API and driver,
diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index 451266b63e..146d9dcf5d 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -71,6 +71,10 @@ emit_fb_vgpu9(struct svga_context *svga)
          if (svga->curr.nr_fbs++ > MAX_RT_PER_BATCH)
             return PIPE_ERROR_OUT_OF_MEMORY;
 
+         /* Check to see if we need to propagate the render target surface */
+         if (hw->cbufs[i] && svga_surface_needs_propagation(hw->cbufs[i]))
+            svga_propagate_surface(svga, hw->cbufs[i], TRUE);
+
          ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_COLOR0 + i,
                                       curr->cbufs[i]);
          if (ret != PIPE_OK)
@@ -85,6 +89,10 @@ emit_fb_vgpu9(struct svga_context *svga)
       if (ret != PIPE_OK)
          return ret;
 
+      /* Check to see if we need to propagate the depth stencil surface */
+      if (hw->zsbuf && svga_surface_needs_propagation(hw->zsbuf))
+         svga_propagate_surface(svga, hw->zsbuf, TRUE);
+
       if (curr->zsbuf &&
           util_format_is_depth_and_stencil(curr->zsbuf->format)) {
          ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_STENCIL,




More information about the mesa-commit mailing list