iris/bufmgr: Set mmap_mode to IRIS_MMAP_NONE for lmem in small-BAR mode

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
This commit is contained in:
Jordan Justen 2022-07-15 10:16:19 -07:00 committed by Marge Bot
parent 49b1b8b853
commit 180aa4f3b2
1 changed files with 8 additions and 2 deletions

View File

@ -1079,8 +1079,14 @@ iris_bo_alloc(struct iris_bufmgr *bufmgr,
(bufmgr->vram.size > 0 && !local) ||
(flags & BO_ALLOC_COHERENT);
bool is_scanout = (flags & BO_ALLOC_SCANOUT) != 0;
enum iris_mmap_mode mmap_mode =
!local && is_coherent && !is_scanout ? IRIS_MMAP_WB : IRIS_MMAP_WC;
enum iris_mmap_mode mmap_mode;
if (!bufmgr->all_vram_mappable && heap == IRIS_HEAP_DEVICE_LOCAL)
mmap_mode = IRIS_MMAP_NONE;
else if (!local && is_coherent && !is_scanout)
mmap_mode = IRIS_MMAP_WB;
else
mmap_mode = IRIS_MMAP_WC;
simple_mtx_lock(&bufmgr->lock);