intel/dump_gpu: mark bo as unmapped if its address changes
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Fri, 12 Feb 2021 11:44:03 +0000 (12:44 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 15 Feb 2021 11:40:58 +0000 (11:40 +0000)
Fixes crash in ppgtt_lookup when the same bo is used twice
with different offsets.

It's possible to hit this with i965 and always_flush_batch=true.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9008>

src/intel/tools/intel_dump_gpu.c

index a0d60e3..bc91639 100644 (file)
@@ -251,6 +251,8 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
       }
 
       if (obj->flags & EXEC_OBJECT_PINNED) {
+         if (bo->offset != obj->offset)
+            bo->gtt_mapped = false;
          bo->offset = obj->offset;
       } else {
          if (obj->alignment != 0)