drm/i915/ttm: add ttm_buddy_man
authorMatthew Auld <matthew.auld@intel.com>
Wed, 16 Jun 2021 15:24:55 +0000 (16:24 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Wed, 16 Jun 2021 15:33:21 +0000 (16:33 +0100)
commit88be9a0a06b73ecd85a688a7c174c941e9692e92
tree91d47ca57f2a5dbeddcb663940918d68623649a1
parentc865204e84a1a5c35e055b45971524efe4616e31
drm/i915/ttm: add ttm_buddy_man

Add back our standalone i915_buddy allocator and integrate it into a
ttm_resource_manager. This will plug into our ttm backend for managing
device local-memory in the next couple of patches.

v2(Thomas):
    - Return -ENOSPC from the buddy; ttm expects this in order to
      trigger eviction
    - Drop the unnecessary inline
    - bo->page_alignment is in page units

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-1-matthew.auld@intel.com
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/i915_buddy.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_buddy.h [new file with mode: 0644]
drivers/gpu/drm/i915/i915_ttm_buddy_manager.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_ttm_buddy_manager.h [new file with mode: 0644]
drivers/gpu/drm/i915/selftests/i915_buddy.c [new file with mode: 0644]