-
- Downloads
drm/ttm: Use the LRU walker helper for swapping
Rework the TTM swapping to use the LRU walker helper. This helps fixing up the ttm_bo_swapout() interface to be consistent about not requiring any locking. For now mimic the current behaviour of using trylock only. We could be using ticket-locks here but defer that until it's deemed necessary. The TTM swapout functionality is a bit weird anyway since it alternates between memory types without exhausting TTM_PL_SYSTEM first. Intentionally keep pages as the unit of progress since changing that to bytes is an unrelated change that can be done later. v6: - Improve on error code translation in the swapout callback (Matthew Brost). v7: - Use s64 rather than long. - Remove ttm_resource_cursor_fini() since it's no longer used. - Rename ttm_resource_cursor_fini_locked() to ttm_resource_cursor_fini(). - Don't swap out pinned bos. 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> #v6 Link: https://patchwork.freedesktop.org/patch/msgid/20240705153206.68526-7-thomas.hellstrom@linux.intel.com Signed-off-by:
Christian König <christian.koenig@amd.com>
Showing
- drivers/gpu/drm/ttm/ttm_bo.c 77 additions, 39 deletionsdrivers/gpu/drm/ttm/ttm_bo.c
- drivers/gpu/drm/ttm/ttm_bo_util.c 1 addition, 1 deletiondrivers/gpu/drm/ttm/ttm_bo_util.c
- drivers/gpu/drm/ttm/ttm_device.c 5 additions, 25 deletionsdrivers/gpu/drm/ttm/ttm_device.c
- drivers/gpu/drm/ttm/ttm_resource.c 3 additions, 20 deletionsdrivers/gpu/drm/ttm/ttm_resource.c
- include/drm/ttm/ttm_bo.h 3 additions, 2 deletionsinclude/drm/ttm/ttm_bo.h
- include/drm/ttm/ttm_resource.h 0 additions, 2 deletionsinclude/drm/ttm/ttm_resource.h
Loading
Please register or sign in to comment