summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.c
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-04-20 09:28:43 +0200
committerZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-08-10 21:02:50 +0200
commit19c37851f0778e0670dd3e3f093e88413da397be (patch)
treea863b99cbbf8b2081185f0ea5ab53908679cfd30 /lib/intel_batchbuffer.c
parent433c075378210557916b3bdc8e3ed48da45c2cbf (diff)
lib/intel_allocator: Add few helper functions for common use
Add few helper functions which can be used in reloc/no-reloc tests. Common name is get_<ALLOCATOR_TYPE>_ahnd(i915, ctx), like: get_reloc_ahnd(), get_simple_ahnd(). As simple allows acquiring offsets starting from top or bottom of vm additional two were added: get_simple_l2h_ahnd() and get_simple_h2l_ahnd(). put_ahnd() closes allocator handle (if it is valid). To acquire / release an offset get_offset() and put_offset() were added. When allocator handle is invalid (equal to zero) get_offset() just returns 0, put_offset() does nothing in this case. We can then call them regardless reloc/no-reloc code keeping conditional code in these functions. Be aware that each get_..._ahnd() functions calls checking kernel relocation capabilities. This generates extra execbuf ioctl() call (but without queueing job to gpu). If that is a problem and we want to avoid additional execbuf calls, checking relocation caps should be done on the beginning of the test. Allocator handle (open()) should be acquired then conditionally according to the result of this check. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'lib/intel_batchbuffer.c')
0 files changed, 0 insertions, 0 deletions