Mesa (main): iris: Add an assert to iris_bo_gem_mmap_legacy()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 12 20:00:55 UTC 2021


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Jul 16 09:39:56 2021 -0500

iris: Add an assert to iris_bo_gem_mmap_legacy()

It only supports two caching modes so we should assert that the only
mode we ever see is one of them.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>

---

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

diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index dbe11e454bc..7dfb2cc8df3 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -1017,6 +1017,9 @@ iris_bo_gem_mmap_legacy(struct pipe_debug_callback *dbg, struct iris_bo *bo)
 {
    struct iris_bufmgr *bufmgr = bo->bufmgr;
 
+   assert(bufmgr->vram.size == 0);
+   assert(bo->mmap_mode == IRIS_MMAP_WB || bo->mmap_mode == IRIS_MMAP_WC);
+
    struct drm_i915_gem_mmap mmap_arg = {
       .handle = bo->gem_handle,
       .size = bo->size,



More information about the mesa-commit mailing list