sna: Always sync before using mmap pointers in memcpy_copy_boxes

kgem_bo_map__(cpu|gtt) leaves the sync up to the caller, in particular
so that the obtaining the pointer and controlling the cache domains are
not conflated and can be separated. However, it does mean that the
caller can not assume that obtaining the pointer updates the cache
domains, as it does not. memcpy_copy_boxes fell into this trap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2018-04-04 13:17:34 +01:00
parent 12db28ab3d
commit 4953aa13b9
1 changed files with 3 additions and 0 deletions

View File

@ -2370,6 +2370,9 @@ use_gtt:
if (dst == NULL || src == NULL)
return false;
kgem_bo_sync__gtt(&sna->kgem, dst_bo);
kgem_bo_sync__gtt(&sna->kgem, src_bo);
detile = NULL;
} else {
if (dst == dst_bo->map__wc)