diff options
| author | Tvrtko Ursulin <tvrtko.ursulin@igalia.com> | 2025-10-20 12:54:07 +0100 |
|---|---|---|
| committer | Tvrtko Ursulin <tursulin@ursulin.net> | 2025-10-31 09:01:08 +0000 |
| commit | 0af5b6a8f8dd41fd801bb0f2af3295d69ba8b7fe (patch) | |
| tree | 916000b46e1064b84a3c6d062e230126a93d353b /drivers/gpu/drm/ttm/ttm_pool.c | |
| parent | d53adc244fbf965d7efeefb278ff8f2664bbe20e (diff) | |
drm/ttm: Replace multiple booleans with flags in pool init
Multiple consecutive boolean function arguments are usually not very
readable.
Replace the ones in ttm_pool_init() with flags with the additional
benefit of soon being able to pass in more data with just this one
code base churning cost.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20251020115411.36818-3-tvrtko.ursulin@igalia.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_pool.c')
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_pool.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index ff6fab4122bb..4fc69447060c 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -1059,13 +1059,12 @@ long ttm_pool_backup(struct ttm_pool *pool, struct ttm_tt *tt, * @pool: the pool to initialize * @dev: device for DMA allocations and mappings * @nid: NUMA node to use for allocations - * @use_dma_alloc: true if coherent DMA alloc should be used - * @use_dma32: true if GFP_DMA32 should be used + * @alloc_flags: TTM_ALLOCATION_POOL_ flags * * Initialize the pool and its pool types. */ void ttm_pool_init(struct ttm_pool *pool, struct device *dev, - int nid, bool use_dma_alloc, bool use_dma32) + int nid, unsigned int alloc_flags) { unsigned int i, j; @@ -1073,8 +1072,7 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev, pool->dev = dev; pool->nid = nid; - pool->use_dma_alloc = use_dma_alloc; - pool->use_dma32 = use_dma32; + pool->alloc_flags = alloc_flags; for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i) { for (j = 0; j < NR_PAGE_ORDERS; ++j) { |
