Mesa (master): svga: Set the surface dirty bit for the right surface view

Brian Paul brianp at kemper.freedesktop.org
Wed Apr 26 17:40:28 UTC 2017


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

Author: Charmaine Lee <charmainel at vmware.com>
Date:   Thu Apr 13 15:12:25 2017 -0700

svga: Set the surface dirty bit for the right surface view

For VGPU10, we will render to a backed surface view when
the same resource is used for rendering and sampling.
In this case, we will mark the dirty bit for the backed surface view.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/svga/svga_surface.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index 02df0ca3ef..d0dc58d10f 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -656,13 +656,27 @@ void
 svga_mark_surfaces_dirty(struct svga_context *svga)
 {
    unsigned i;
+   struct svga_hw_clear_state *hw = &svga->state.hw_clear;
 
-   for (i = 0; i < svga->curr.framebuffer.nr_cbufs; i++) {
-      if (svga->curr.framebuffer.cbufs[i])
-         svga_mark_surface_dirty(svga->curr.framebuffer.cbufs[i]);
+   if (svga_have_vgpu10(svga)) {
+
+      /* For VGPU10, mark the dirty bit in the rendertarget/depth stencil view surface.
+       * This surface can be the backed surface.
+       */
+      for (i = 0; i < hw->num_rendertargets; i++) {
+         if (hw->rtv[i])
+            svga_mark_surface_dirty(hw->rtv[i]);
+      }
+      if (hw->dsv)
+         svga_mark_surface_dirty(hw->dsv);
+   } else {
+      for (i = 0; i < svga->curr.framebuffer.nr_cbufs; i++) {
+         if (svga->curr.framebuffer.cbufs[i])
+            svga_mark_surface_dirty(svga->curr.framebuffer.cbufs[i]);
+      }
+      if (svga->curr.framebuffer.zsbuf)
+         svga_mark_surface_dirty(svga->curr.framebuffer.zsbuf);
    }
-   if (svga->curr.framebuffer.zsbuf)
-      svga_mark_surface_dirty(svga->curr.framebuffer.zsbuf);
 }
 
 




More information about the mesa-commit mailing list