svga: Avoid discard DMA uploads
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 28 Jan 2020 11:49:30 +0000 (12:49 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 10:56:06 +0000 (10:56 +0000)
Newer versions of the device code will make discard DMA uploads
sub-optimal. Disable them for guest-backed aware code, where we previously
had them conditionally enabled.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3614>

src/gallium/drivers/svga/svga_resource_texture.c

index 31ac6a9b7305293449304388662c20aa832aaa23..b57d2d7ee95538370090863f11e0a66441e46f50 100644 (file)
@@ -531,7 +531,7 @@ svga_texture_transfer_map(struct pipe_context *pipe,
    struct svga_transfer *st;
    struct svga_winsys_surface *surf = tex->handle;
    boolean use_direct_map = svga_have_gb_objects(svga) &&
-                            !svga_have_gb_dma(svga);
+       (!svga_have_gb_dma(svga) || (usage & PIPE_TRANSFER_WRITE));
    void *map = NULL;
    int64_t begin = svga_get_time(svga);