svga: fix texture upload path condition
authorCharmaine Lee <charmainel@vmware.com>
Fri, 30 Sep 2016 22:52:14 +0000 (15:52 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2016 20:29:22 +0000 (14:29 -0600)
commit3dfb4243bdefcdfa94b0165199a50a739e8c6679
treea3be0fee3627f3ac7b770f9a2d99fbd09a071a68
parent4750c4e5439f5c2689051ac072003cc3a2ff5c1b
svga: fix texture upload path condition

As Thomas suggested, we'll first try to map directly to a GB surface.
If it is blocked, then we'll use texture upload buffer.
Also if a texture is already "rendered to", that is, the GB surface
is already out of sync, then we'll use the texture upload buffer
to avoid syncing the GB surface.

Tested with Lightsmark2008, Tropics, MTT piglit, glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_resource_texture.c