]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/ttm, drm/amdgpu, drm/xe: Consider hitch moves within bulk sublist moves
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Fri, 5 Jul 2024 15:32:02 +0000 (17:32 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 9 Jul 2024 10:39:33 +0000 (12:39 +0200)
commit4c44f89c5daee9540cb7428de5d835bd00951350
tree9391aeee02d42b834ba2a00345a1f43a310148e8
parent8e9bf0fb10a79aaed37474600948cd33d14aa606
drm/ttm, drm/amdgpu, drm/xe: Consider hitch moves within bulk sublist moves

To address the problem with hitches moving when bulk move
sublists are lru-bumped, register the list cursors with the
ttm_lru_bulk_move structure when traversing its list, and
when lru-bumping the list, move the cursor hitch to the tail.
This also means it's mandatory for drivers to call
ttm_lru_bulk_move_init() and ttm_lru_bulk_move_fini() when
initializing and finalizing the bulk move structure, so add
those calls to the amdgpu- and xe driver.

Compared to v1 this is slightly more code but less fragile
and hopefully easier to understand.

Changes in previous series:
- Completely rework the functionality
- Avoid a NULL pointer dereference assigning manager->mem_type
- Remove some leftover code causing build problems
v2:
- For hitch bulk tail moves, store the mem_type in the cursor
  instead of with the manager.
v3:
- Remove leftover mem_type member from change in v2.
v6:
- Add some lockdep asserts (Matthew Brost)
- Avoid NULL pointer dereference (Matthew Brost)
- No need to check bo->resource before dereferencing
  bo->bulk_move (Matthew Brost)

Cc: Christian König <christian.koenig@amd.com>
Cc: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <dri-devel@lists.freedesktop.org>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240705153206.68526-5-thomas.hellstrom@linux.intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/ttm/ttm_resource.c
drivers/gpu/drm/xe/xe_vm.c
include/drm/ttm/ttm_resource.h