linux/drivers/gpu/drm/ttm/ttm_pool_internal.h
Tvrtko Ursulin 6e3f4514e3 drm/ttm: Fix ttm_pool_beneficial_order() return type
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
2026-02-27 14:54:31 +00:00

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