[16/59] drm/radeon: use new ttm man init path
diff mbox series

Message ID 20200804025632.3868079-17-airlied@gmail.com
State New
Headers show
Series
  • ttm misc cleanups, mem refactoring, rename objects. (v2)
Related show

Commit Message

Dave Airlie Aug. 4, 2020, 2:55 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

Use the new common manager init path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Christian König Aug. 4, 2020, 11:15 a.m. UTC | #1
Am 04.08.20 um 04:55 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> Use the new common manager init path.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon_ttm.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 0b07d8ed6edd..84c02b4529c0 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -70,19 +70,17 @@ static int radeon_ttm_init_vram(struct radeon_device *rdev)
>   {
>   	struct ttm_mem_type_manager *man = &rdev->mman.bdev.man[TTM_PL_VRAM];
>   
> -	man->func = &ttm_bo_manager_func;
>   	man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
>   	man->default_caching = TTM_PL_FLAG_WC;
>   
> -	return ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM,
> -			      rdev->mc.real_vram_size >> PAGE_SHIFT);
> +	return ttm_range_man_init(&rdev->mman.bdev, man,
> +				  rdev->mc.real_vram_size >> PAGE_SHIFT);
>   }
>   
>   static int radeon_ttm_init_gtt(struct radeon_device *rdev)
>   {
>   	struct ttm_mem_type_manager *man = &rdev->mman.bdev.man[TTM_PL_TT];
>   
> -	man->func = &ttm_bo_manager_func;
>   	man->available_caching = TTM_PL_MASK_CACHING;
>   	man->default_caching = TTM_PL_FLAG_CACHED;
>   	man->use_tt = true;
> @@ -98,8 +96,8 @@ static int radeon_ttm_init_gtt(struct radeon_device *rdev)
>   	}
>   #endif
>   
> -	return ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT,
> -			      rdev->mc.gtt_size >> PAGE_SHIFT);
> +	return ttm_range_man_init(&rdev->mman.bdev, man,
> +				  rdev->mc.gtt_size >> PAGE_SHIFT);
>   }
>   
>   static void radeon_evict_flags(struct ttm_buffer_object *bo,

Patch
diff mbox series

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 0b07d8ed6edd..84c02b4529c0 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -70,19 +70,17 @@  static int radeon_ttm_init_vram(struct radeon_device *rdev)
 {
 	struct ttm_mem_type_manager *man = &rdev->mman.bdev.man[TTM_PL_VRAM];
 
-	man->func = &ttm_bo_manager_func;
 	man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
 	man->default_caching = TTM_PL_FLAG_WC;
 
-	return ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM,
-			      rdev->mc.real_vram_size >> PAGE_SHIFT);
+	return ttm_range_man_init(&rdev->mman.bdev, man,
+				  rdev->mc.real_vram_size >> PAGE_SHIFT);
 }
 
 static int radeon_ttm_init_gtt(struct radeon_device *rdev)
 {
 	struct ttm_mem_type_manager *man = &rdev->mman.bdev.man[TTM_PL_TT];
 
-	man->func = &ttm_bo_manager_func;
 	man->available_caching = TTM_PL_MASK_CACHING;
 	man->default_caching = TTM_PL_FLAG_CACHED;
 	man->use_tt = true;
@@ -98,8 +96,8 @@  static int radeon_ttm_init_gtt(struct radeon_device *rdev)
 	}
 #endif
 
-	return ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT,
-			      rdev->mc.gtt_size >> PAGE_SHIFT);
+	return ttm_range_man_init(&rdev->mman.bdev, man,
+				  rdev->mc.gtt_size >> PAGE_SHIFT);
 }
 
 static void radeon_evict_flags(struct ttm_buffer_object *bo,