svga: Treat forced coherent maps as maps of persistent memory
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 31 Mar 2020 07:10:17 +0000 (09:10 +0200)
committerThomas Hellstrom (VMware) <thomas_os@shipmail.org>
Wed, 1 Apr 2020 06:58:28 +0000 (08:58 +0200)
commit15a9f6c07228f59401954bb18b9c2f980297f634
treeb764203553a308ebea3e302807ab6d41038bd8fa
parent46fdc288fb52345134fd9aacd6d7ff71c7b747bb
svga: Treat forced coherent maps as maps of persistent memory

A previous commit made sure we sent a BindGBSurface command at map time
rather than at unmap time for persistent memory. To be consistent, do the
same for forced coherent maps. This makes it possible to avoid the
explicit UpdateGBSurface at unmap time for discard maps and to instead rely
on the kernel's dirty-tracking mechanism at the cost of an additional flush.

Tested with SVGA_FORCE_COHERENT=1, piglit run quick. No regressions.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4399>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4399>
src/gallium/drivers/svga/svga_resource_buffer.h
src/gallium/drivers/svga/svga_resource_texture.c