]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/ttm/pool: Restructure the pool allocation code
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 17 Dec 2024 14:58:46 +0000 (15:58 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 13 Jan 2025 11:58:10 +0000 (12:58 +0100)
commit1d3160c7cba37b48be453f29ec2faede77002d14
tree3352932c08686ea1ffbc3b21d4436fffe1591f1a
parent1f463794097dcdf4c64fffd31de2177681525e35
drm/ttm/pool: Restructure the pool allocation code

Simplify the pool allocation code somewhat by merging loop arguments
used by multiple functions together in a struct and simplifying the
loop. Also add documentation.
This hopefully makes the behaviour of the allocation loop
simplier to understand, but above all paves the way for upcoming
restore-while-allocating functionality.

There are no functional changes, but the "allow_pools" bool
introduced to keep current functionality could be removed as a
follow up, which would enable using write-back cached pools when
allocating memory for other caching modes, rather than to resort
to allocating from the system directly.

v15:
- Introduce this patch to simplify the upcoming patch that introduces
  restore while allocating.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217145852.37342-4-thomas.hellstrom@linux.intel.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/ttm/ttm_pool.c