mirror of
https://github.com/torvalds/linux.git
synced 2026-03-07 23:04:33 +01:00
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: 7e9c548d37 ("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
25 lines
600 B
C
25 lines
600 B
C
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
|
|
/* Copyright (c) 2025 Valve Corporation */
|
|
|
|
#ifndef _TTM_POOL_INTERNAL_H_
|
|
#define _TTM_POOL_INTERNAL_H_
|
|
|
|
#include <drm/ttm/ttm_allocation.h>
|
|
#include <drm/ttm/ttm_pool.h>
|
|
|
|
static inline bool ttm_pool_uses_dma_alloc(struct ttm_pool *pool)
|
|
{
|
|
return pool->alloc_flags & TTM_ALLOCATION_POOL_USE_DMA_ALLOC;
|
|
}
|
|
|
|
static inline bool ttm_pool_uses_dma32(struct ttm_pool *pool)
|
|
{
|
|
return pool->alloc_flags & TTM_ALLOCATION_POOL_USE_DMA32;
|
|
}
|
|
|
|
static inline unsigned int ttm_pool_beneficial_order(struct ttm_pool *pool)
|
|
{
|
|
return pool->alloc_flags & 0xff;
|
|
}
|
|
|
|
#endif
|