summaryrefslogtreecommitdiff
path: root/lib/intel_allocator_simple.c
AgeCommit message (Collapse)Author
2021-07-28lib/intel_allocator_simple: Check boundaries of reserved blocksAndrzej Turko
Make sure that reserved blocks fit in the address space managed by the simple allocator. 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-06-18lib/intel_allocator: Move ioctl calls to client processesAndrzej Turko
When allocator is running in multiprocess mode, all queries are processed in a designated thread in the parent process. However, a child process may request opening the allocator for a gpu using a file descriptor absent in the parent process. Hence, querying available gtt size must be done in the child instead of the parent process. As a consequence of this change creating allocators managing only a given interval of available gtt is now enabled for all allocator implementations. Additionally, this commit sets a universal lower bound on alignment to 4096. 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-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-13lib/intel_allocator_simple: Add simple allocatorDominik Grzegorzek
Simple allocator borrowed from Mesa adopted for IGT use. From default we prefer an allocation from the top of vm address space (we can catch addressing issues pro-actively). When function intel_allocator_simple_create() is used we exclude last page as HW tends to hang on the render engine when full 3D pipeline is executed from the last page. For more control of vm range user can specify range using intel_allocator_simple_create_full() (with the respect of the gtt size). v2: fix size calculation (don't allow to subtract number which can be negative - as we got for canonical addresses with 47 bit set - Jason) v3: change to new igt_map implementation, add refcounts in allocator (according to Jason review comments) v4: return ALLOC_INVALID_ADDRESS instead of assert for failed allocation Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> 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>