intel/dump_gpu: only map in GTT buffers not previously mapped
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
This commit is contained in:
parent
22b512ea5b
commit
42cb068d9f
|
@ -68,6 +68,8 @@ struct bo {
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint64_t offset;
|
uint64_t offset;
|
||||||
void *map;
|
void *map;
|
||||||
|
/* Whether the buffer has been positionned in the GTT already. */
|
||||||
|
bool gtt_mapped : 1;
|
||||||
/* Tracks userspace mmapping of the buffer */
|
/* Tracks userspace mmapping of the buffer */
|
||||||
bool user_mapped : 1;
|
bool user_mapped : 1;
|
||||||
/* Using the i915-gem mmapping ioctl & execbuffer ioctl, track whether a
|
/* Using the i915-gem mmapping ioctl & execbuffer ioctl, track whether a
|
||||||
|
@ -278,8 +280,10 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
|
||||||
bo->map = gem_mmap(fd, obj->handle, 0, bo->size);
|
bo->map = gem_mmap(fd, obj->handle, 0, bo->size);
|
||||||
fail_if(bo->map == MAP_FAILED, "bo mmap failed\n");
|
fail_if(bo->map == MAP_FAILED, "bo mmap failed\n");
|
||||||
|
|
||||||
if (aub_use_execlists(&aub_file))
|
if (aub_use_execlists(&aub_file) && !bo->gtt_mapped) {
|
||||||
aub_map_ppgtt(&aub_file, bo->offset, bo->size);
|
aub_map_ppgtt(&aub_file, bo->offset, bo->size);
|
||||||
|
bo->gtt_mapped = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 :
|
batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 :
|
||||||
|
@ -348,6 +352,7 @@ add_new_bo(unsigned fd, int handle, uint64_t size, void *map)
|
||||||
bo->size = size;
|
bo->size = size;
|
||||||
bo->map = map;
|
bo->map = map;
|
||||||
bo->user_mapped = false;
|
bo->user_mapped = false;
|
||||||
|
bo->gtt_mapped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -357,9 +362,7 @@ remove_bo(int fd, int handle)
|
||||||
|
|
||||||
if (bo->map && !IS_USERPTR(bo->map))
|
if (bo->map && !IS_USERPTR(bo->map))
|
||||||
munmap(bo->map, bo->size);
|
munmap(bo->map, bo->size);
|
||||||
bo->size = 0;
|
memset(bo, 0, sizeof(*bo));
|
||||||
bo->map = NULL;
|
|
||||||
bo->user_mapped = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__ ((visibility ("default"))) int
|
__attribute__ ((visibility ("default"))) int
|
||||||
|
|
Loading…
Reference in New Issue