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@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>
This commit is contained in:
Jason Ekstrand
2021-07-16 09:39:56 -05:00
committed by Marge Bot
parent 24031700a7
commit 373f0d6acc

View File

@@ -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,