]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/ttm: Fix ttm_pool_beneficial_order() return type
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fri, 27 Feb 2026 12:49:01 +0000 (12:49 +0000)
committerTvrtko Ursulin <tursulin@ursulin.net>
Fri, 27 Feb 2026 14:54:31 +0000 (14:54 +0000)
Fix a nasty copy and paste bug, where the incorrect boolean return type of
the ttm_pool_beneficial_order() helper had a consequence of avoiding
direct reclaim too eagerly for drivers which use this feature (currently
amdgpu).

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: 7e9c548d3709 ("drm/ttm: Allow drivers to specify maximum beneficial TTM pool size")
Cc: Christian König <christian.koenig@amd.com>
Cc: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.19+
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20260227124901.3177-1-tvrtko.ursulin@igalia.com
drivers/gpu/drm/ttm/ttm_pool_internal.h

index 82c4b7e56a99d5dc1781cf80ca51eb08b2bf28ca..24c179fd69d1af541afb04ea49734747784452da 100644 (file)
@@ -17,7 +17,7 @@ static inline bool ttm_pool_uses_dma32(struct ttm_pool *pool)
        return pool->alloc_flags & TTM_ALLOCATION_POOL_USE_DMA32;
 }
 
-static inline bool ttm_pool_beneficial_order(struct ttm_pool *pool)
+static inline unsigned int ttm_pool_beneficial_order(struct ttm_pool *pool)
 {
        return pool->alloc_flags & 0xff;
 }