iris: SMEM buffers on discrete platforms are coherent
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 23 Jul 2021 17:03:32 +0000 (12:03 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 12 Aug 2021 19:29:59 +0000 (19:29 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>

src/gallium/drivers/iris/iris_bufmgr.c

index 9515c4b..f5f0ec0 100644 (file)
@@ -613,7 +613,9 @@ iris_bo_alloc(struct iris_bufmgr *bufmgr,
    uint64_t bo_size =
       bucket ? bucket->size : MAX2(ALIGN(size, page_size), page_size);
 
-   bool is_coherent = bufmgr->has_llc || (flags & BO_ALLOC_COHERENT);
+   bool is_coherent = bufmgr->has_llc ||
+                      (bufmgr->vram.size > 0 && !local) ||
+                      (flags & BO_ALLOC_COHERENT);
    enum iris_mmap_mode mmap_mode =
       !local && is_coherent ? IRIS_MMAP_WB : IRIS_MMAP_WC;