[PATCH] drm/ttm: Fix build with CONFIG_DEBUG_FS=n
Tvrtko Ursulin
tvrtko.ursulin at igalia.com
Wed Jun 4 07:20:53 UTC 2025
On 03/06/2025 19:47, Lucas De Marchi wrote:
> Move the define outside the ifdef for CONFIG_DEBUG_FS to fix the build.
> This currently breaks drm kunit tests:
>
> $ ./tools/testing/kunit/kunit.py run --kunitconfig drivers/gpu/drm/ttm/tests/.kunitconfig
> ERROR:root:../drivers/gpu/drm/ttm/ttm_pool.c: In function ‘ttm_pool_mgr_init’:
> ../drivers/gpu/drm/ttm/ttm_pool.c:1335:30: error: ‘TTM_SHRINKER_BATCH’ undeclared (first use in this function)
> 1335 | mm_shrinker->batch = TTM_SHRINKER_BATCH;
>
> Fixes: 22b929b25293 ("drm/ttm: Increase pool shrinker batch target")
> Cc: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
> Cc: Christian König <christian.koenig at amd.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
> drivers/gpu/drm/ttm/ttm_pool.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index e671812789ea7..2dead28a6c1c0 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -1132,6 +1132,9 @@ void ttm_pool_fini(struct ttm_pool *pool)
> }
> EXPORT_SYMBOL(ttm_pool_fini);
>
> +/* Free average pool number of pages. */
> +#define TTM_SHRINKER_BATCH ((1 << (MAX_PAGE_ORDER / 2)) * NR_PAGE_ORDERS)
> +
> static unsigned long ttm_pool_shrinker_scan(struct shrinker *shrink,
> struct shrink_control *sc)
> {
> @@ -1265,9 +1268,6 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
> }
> EXPORT_SYMBOL(ttm_pool_debugfs);
>
> -/* Free average pool number of pages. */
> -#define TTM_SHRINKER_BATCH ((1 << (MAX_PAGE_ORDER / 2)) * NR_PAGE_ORDERS)
> -
> /* Test the shrinker functions and dump the result */
> static int ttm_pool_debugfs_shrink_show(struct seq_file *m, void *data)
> {
Ah sorry!
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
I'll merge it straight away.
Regards,
Tvrtko
More information about the Intel-xe
mailing list