diff options
author | Kamil Konieczny <kamil.konieczny@linux.intel.com> | 2022-02-02 15:13:11 +0100 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-02-02 19:13:31 +0100 |
commit | 9cd99d763440ae75d9981ce4e361d3deb5edb4e4 (patch) | |
tree | fbd164189abf979b1cbc06d4884c746def822e18 /lib/intel_batchbuffer.h | |
parent | f31f9ca3d81440e955e3963f9d91f54fa6c3c09f (diff) |
lib/intel_batchbuffer: add tracking and reset for allocator
After subtest ends, due to normal flow or after fail by
igt_assert, igt_core inits intel_allocator before next subtest,
and this makes allocator handle keeped in intel_batchbuffer
invalid. Moreover any call to intel_allocator can result in
fail as there are no allocators until first allocator_open.
Add tracking intel_butchbuffer if it is using allocator and
recreate its allocator handle and offsets from igt_core before
next subtest.
Add flag for turn on tracking and a helper function for it with
default value off. It will not change behaviour of already used
tests. Use case is for standalone runs with many subtests like
gem_concurrent_blit.
v2: add tracking flag with default off (Zbigniew)
v3: add and correct functions descriptions (Zbigniew)
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/intel_batchbuffer.h')
-rw-r--r-- | lib/intel_batchbuffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index e7606307..a488f9cf 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -456,7 +456,10 @@ struct igt_pxp { * Batchbuffer without libdrm dependency */ struct intel_bb { + struct igt_list_head link; + uint64_t allocator_handle; + uint64_t allocator_start, allocator_end; uint8_t allocator_type; enum allocator_strategy allocator_strategy; @@ -524,6 +527,10 @@ struct intel_bb * intel_bb_create_with_relocs_and_context(int i915, uint32_t ctx, uint32_t size); void intel_bb_destroy(struct intel_bb *ibb); +/* make it safe to use intel_allocator after failed test */ +void intel_bb_reinit_allocator(void); +void intel_bb_track(bool do_tracking); + static inline void intel_bb_ref(struct intel_bb *ibb) { ibb->refcount++; |