iris: Map with WC on non-LLC platforms.
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 3 Jan 2020 18:42:10 +0000 (10:42 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 24 Jun 2021 16:14:38 +0000 (16:14 +0000)
Reworks:
 * Jordan: Required rework following
   f62724ccacf ("iris: Pick a single mmap mode (WB/WC) at BO allocation time")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>

src/gallium/drivers/iris/iris_bufmgr.c

index 3076ced..7cdb447 100644 (file)
@@ -595,9 +595,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);
    enum iris_mmap_mode desired_mmap_mode =
-      (bufmgr->has_llc || (flags & BO_ALLOC_COHERENT)) ? IRIS_MMAP_WB
-                                                       : IRIS_MMAP_WC;
+      !local && is_coherent ? IRIS_MMAP_WB : IRIS_MMAP_WC;
 
    mtx_lock(&bufmgr->lock);