diff options
| author | Tvrtko Ursulin <tvrtko.ursulin@igalia.com> | 2025-10-20 12:54:06 +0100 |
|---|---|---|
| committer | Tvrtko Ursulin <tursulin@ursulin.net> | 2025-10-31 08:54:54 +0000 |
| commit | d53adc244fbf965d7efeefb278ff8f2664bbe20e (patch) | |
| tree | 31f122a7e1b8c9a4de72529e77212626b3fb6f81 /drivers/gpu/drm/ttm/ttm_tt.c | |
| parent | d7a849d126d0a75b2c5101f82d0c9693e04a43fd (diff) | |
drm/ttm: Add getter for some pool properties
No functional change but to allow easier refactoring in the future.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.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-2-tvrtko.ursulin@igalia.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_tt.c')
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 705c7d2f5798..611d20ab966d 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -47,6 +47,7 @@ #include <drm/ttm/ttm_tt.h> #include "ttm_module.h" +#include "ttm_pool_internal.h" static unsigned long ttm_pages_limit; @@ -94,7 +95,8 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) * mapped TT pages need to be decrypted or otherwise the drivers * will end up sending encrypted mem to the gpu. */ - if (bdev->pool.use_dma_alloc && cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { + if (ttm_pool_uses_dma_alloc(&bdev->pool) && + cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { page_flags |= TTM_TT_FLAG_DECRYPTED; drm_info_once(ddev, "TT memory decryption enabled."); } @@ -379,7 +381,7 @@ int ttm_tt_populate(struct ttm_device *bdev, if (!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL)) { atomic_long_add(ttm->num_pages, &ttm_pages_allocated); - if (bdev->pool.use_dma32) + if (ttm_pool_uses_dma32(&bdev->pool)) atomic_long_add(ttm->num_pages, &ttm_dma32_pages_allocated); } @@ -417,7 +419,7 @@ int ttm_tt_populate(struct ttm_device *bdev, error: if (!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL)) { atomic_long_sub(ttm->num_pages, &ttm_pages_allocated); - if (bdev->pool.use_dma32) + if (ttm_pool_uses_dma32(&bdev->pool)) atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated); } @@ -440,7 +442,7 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm) if (!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL)) { atomic_long_sub(ttm->num_pages, &ttm_pages_allocated); - if (bdev->pool.use_dma32) + if (ttm_pool_uses_dma32(&bdev->pool)) atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated); } |
