]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/ttm: Fix build with CONFIG_DEBUG_FS=n
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 3 Jun 2025 18:47:51 +0000 (11:47 -0700)
committerTvrtko Ursulin <tursulin@ursulin.net>
Wed, 4 Jun 2025 07:23:21 +0000 (08:23 +0100)
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@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20250603184750.3304647-2-lucas.demarchi@intel.com
drivers/gpu/drm/ttm/ttm_pool.c

index 4b16946d3248ccd74f6c8c9f71f5c055b14b6f28..cd31a30df3b09a95ae4193cff6cdc3659307a6ec 100644 (file)
@@ -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)
 {
@@ -1270,9 +1273,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)
 {