diff options
author | Dave Airlie <airlied@redhat.com> | 2020-08-04 12:56:19 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-08-06 13:12:39 +1000 |
commit | 37205891d84f9269de61d6e85c24607209478a85 (patch) | |
tree | 64b43845d0885fcdb5d830872d44b74c049d7732 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |
parent | 0af135b892bf06c1a56cb0cd9632feb34511f9ee (diff) | |
download | lwn-37205891d84f9269de61d6e85c24607209478a85.tar.gz lwn-37205891d84f9269de61d6e85c24607209478a85.zip |
drm/ttm: make ttm_range_man_init/takedown take type + args
This makes it easier to move these to a driver allocated system
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-47-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 207ba70a7a39..555695854076 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -66,12 +66,9 @@ static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev, unsigned int type, uint64_t size) { - struct ttm_mem_type_manager *man = ttm_manager_type(&adev->mman.bdev, type); - - man->available_caching = TTM_PL_FLAG_UNCACHED; - man->default_caching = TTM_PL_FLAG_UNCACHED; - - return ttm_range_man_init(&adev->mman.bdev, man, size >> PAGE_SHIFT); + return ttm_range_man_init(&adev->mman.bdev, type, + TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED, + false, size >> PAGE_SHIFT); } /** @@ -1996,9 +1993,9 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev) amdgpu_vram_mgr_fini(adev); amdgpu_gtt_mgr_fini(adev); - ttm_range_man_fini(&adev->mman.bdev, ttm_manager_type(&adev->mman.bdev, AMDGPU_PL_GDS)); - ttm_range_man_fini(&adev->mman.bdev, ttm_manager_type(&adev->mman.bdev, AMDGPU_PL_GWS)); - ttm_range_man_fini(&adev->mman.bdev, ttm_manager_type(&adev->mman.bdev, AMDGPU_PL_OA)); + ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GDS); + ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GWS); + ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_OA); ttm_bo_device_release(&adev->mman.bdev); adev->mman.initialized = false; DRM_INFO("amdgpu: ttm finalized\n"); |