svga: Set the rendered-to flag for dma transfers to surfaces
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 8 May 2019 14:26:27 +0000 (16:26 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Fri, 17 May 2019 06:44:31 +0000 (08:44 +0200)
The rendered-to flag indicates that the HW surface content is more recent
than the content of the mob. That's the case after a SurfaceDMA transfer
to the surface.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_resource_texture.c

index e9449e8a1ffbc5193a71c8605e38966bb8fd6937..307b5ca4a10cf5277ed568fefa695e71a955d96d 100644 (file)
@@ -753,6 +753,9 @@ svga_texture_transfer_unmap_dma(struct svga_context *svga,
    if (st->base.usage & PIPE_TRANSFER_WRITE) {
       /* Use DMA to transfer texture data */
       SVGA3dSurfaceDMAFlags flags;
+      struct pipe_resource *texture = st->base.resource;
+      struct svga_texture *tex = svga_texture(texture);
+
 
       memset(&flags, 0, sizeof flags);
       if (st->base.usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) {
@@ -763,6 +766,7 @@ svga_texture_transfer_unmap_dma(struct svga_context *svga,
       }
 
       svga_transfer_dma(svga, st, SVGA3D_WRITE_HOST_VRAM, flags);
+      svga_set_texture_rendered_to(tex, st->slice, st->base.level);
    }
 
    FREE(st->swbuf);