Module: Mesa
Branch: main
Commit: 7b2a0b6778a515fcdda05d6c008b053b0d58264f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b2a0b6778a515fcdda05d6c008b053b0d58264f

Author: José Roberto de Souza <jose.so...@intel.com>
Date:   Fri Dec  1 11:34:23 2023 -0800

iris: Fix the mmap mode for IRIS_HEAP_DEVICE_LOCAL_PREFERRED

bos allocated into IRIS_HEAP_DEVICE_LOCAL_PREFERRED can always be
mmaped because it is also backed to smem which is not the case for
IRIS_HEAP_DEVICE_LOCAL.

This fixes issues with small PCIe bar systems.

Fixes: 21170a58d8ae ("iris: Split system memory heap into cached-coherent and 
uncached heaps")
Signed-off-by: José Roberto de Souza <jose.so...@intel.com>
Reviewed-by: Nanley Chery <nanley.g.ch...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26455>

---

 src/gallium/drivers/iris/iris_bufmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_bufmgr.c 
b/src/gallium/drivers/iris/iris_bufmgr.c
index fe88efa60b6..48c8cc34e79 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -1140,8 +1140,9 @@ heap_to_mmap_mode(struct iris_bufmgr *bufmgr, enum 
iris_heap heap)
 
    switch (heap) {
    case IRIS_HEAP_DEVICE_LOCAL:
-   case IRIS_HEAP_DEVICE_LOCAL_PREFERRED:
       return intel_vram_all_mappable(devinfo) ? IRIS_MMAP_WC : IRIS_MMAP_NONE;
+   case IRIS_HEAP_DEVICE_LOCAL_PREFERRED:
+      return IRIS_MMAP_WC;
    case IRIS_HEAP_SYSTEM_MEMORY_CACHED_COHERENT:
       return IRIS_MMAP_WB;
    case IRIS_HEAP_SYSTEM_MEMORY_UNCACHED:

Reply via email to