From 4953aa13b93cb753f3ee8c6acf984e123cbf32ae Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Apr 2018 13:17:34 +0100 Subject: [PATCH] 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 --- src/sna/sna_render.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index bba7c942..1787ffae 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -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)