summaryrefslogtreecommitdiff
path: root/tests/i915/api_intel_allocator.c
AgeCommit message (Collapse)Author
2022-03-11tests/api_intel_allocator: Verify gem-pool is working as expectedZbigniew Kempczyński
Simple check which acquires buffer objects from gem-pool. It verifies: - object reuse (previously created is completed in execbuf) - object creation (submitting batches when spinner is executing). Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2022-02-25tests/api_intel_allocator: Add default-alignment testZbigniew Kempczyński
Test verifies that intel-allocator uses caller default-alignment setting during open() instead of choosing safe alignment instead. Also check does alloc() can overwrite default setting used by the allocator. v2: rename allocator -> default-allocator test name Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-02-25lib/intel_allocator: Add safe alignment as a defaultZbigniew Kempczyński
For DG2 and beyond regions alignment may vary so many tests would need to be rewritten to handle this constraint. As Ashutosh noticed most of tests can use safe alignment as a default. Adopt intel-allocator to use safe or user defined power-of-two alignment. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Suggested-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-02-24tests/i915/api_intel_allocator: change copy instruction for new gensKamil Konieczny
Use XY_FAST_COPY_BLT on newer GPU generations. 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>
2022-02-16i915/api_intel_allocator: fix standalone subtestKamil Konieczny
Subtest standalone uses igt_fork macro and after that makes checks of work done by children processes, but this macro start counting from zero, it never touches index 2. Correct indicies, comment and asserts accordingly. This wasn't observed in CI due to HIGH_TO_LOW strategy used as default in allocator so first obtained offset was never zero. v2: correct comment, indices and checks (Zbigniew review) 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>
2021-11-29tests/api_intel_allocator: Fix build warningTvrtko Ursulin
.../tests/i915/api_intel_allocator.c: In function ‘basic_alloc’: .../tests/i915/api_intel_allocator.c:158:25: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 158 | if (j == i) | ^~ Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-06-18tests/i915/api_intel_allocator: Exercise allocator in multiprocess modeAndrzej Turko
Test creation and usage of allocators in multiprocess mode for contexts shared with the parent process as well as private for the child. This new test discovers a bug in the allocator implementation: allocator is not correctly initialized if it is opened by a child process using its private file descriptor. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-05-27lib/i915/gem_create: Add gem_create_extAndrzej Turko
Add a wrapper for gem_create_ext ioctl (a version of gem_create that accepts extensions). In preparation for the driver change implementing it, a local definition of its id and necessary structs have been added, which are to be erased as soon as those definitions appear in the i915_drm.h file. The new ioctl wrapper is added to a separate file. For consistency the wrapper of the old ioctl, gem_create is moved from ioctl_wrappers to gem_create. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris P Wilson <chris.p.wilson@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-04-13lib/intel_allocator: Add alloc function which allows passing strategy argumentZbigniew Kempczyński
To use spinners with no-reloc we need to alloc offsets for them from already opened allocator. As we don't know what strategy is chosen for open (likely HIGH_TO_LOW for SIMPLE allocator) we want to overwrite it for spinners (there's expectation they will reside on low addresses). Extend allocator API adding intel_allocator_alloc_with_strategy() to support spinners rewriting. v2: add change in api_intel_allocator test to compile properly whole series. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-04-13tests/api_intel_allocator: Verify child can use its standalone allocatorZbigniew Kempczyński
Sometimes we don't want to use common allocator provided by main IGT process. Verify it is able to "detach" from it and initialize its own version of allocator. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-04-13tests/api_intel_allocator: Add execbuf with allocator exampleZbigniew Kempczyński
Simplified version of non-fork test which can be used as a copy-paste template. Uses blit to show how to prepare batch with addresses acquired from allocator. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-04-13tests/api_intel_allocator: Simple allocator test suiteDominik Grzegorzek
We want to verify allocator works as expected. Try to exploit it. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com>