drm/ttm: remove the init_mem_type callback
authorChristian König <christian.koenig@amd.com>
Thu, 23 Jul 2020 15:13:47 +0000 (17:13 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 31 Jul 2020 15:14:37 +0000 (17:14 +0200)
It is a very strange concept to call a function which just
calls back the caller for the functions parameters.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382085/
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/drm_gem_vram_helper.c
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/qxl/qxl_ttm.c
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
include/drm/ttm/ttm_bo_driver.h

index 98a77fc..da6434e 100644 (file)
 
 #define AMDGPU_TTM_VRAM_MAX_DW_READ    (size_t)128
 
-static int amdgpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                               struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static int amdgpu_ttm_init_vram(struct amdgpu_device *adev)
 {
 
@@ -1727,7 +1721,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
        .ttm_tt_create = &amdgpu_ttm_tt_create,
        .ttm_tt_populate = &amdgpu_ttm_tt_populate,
        .ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-       .init_mem_type = &amdgpu_init_mem_type,
        .eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
        .evict_flags = &amdgpu_evict_flags,
        .move = &amdgpu_bo_move,
index f7f93a4..5f03c61 100644 (file)
@@ -1004,12 +1004,6 @@ err_ttm_tt_init:
        return NULL;
 }
 
-static int bo_driver_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                                  struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static void bo_driver_evict_flags(struct ttm_buffer_object *bo,
                                  struct ttm_placement *placement)
 {
@@ -1069,7 +1063,6 @@ static struct ttm_bo_driver bo_driver = {
        .ttm_tt_create = bo_driver_ttm_tt_create,
        .ttm_tt_populate = ttm_pool_populate,
        .ttm_tt_unpopulate = ttm_pool_unpopulate,
-       .init_mem_type = bo_driver_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = bo_driver_evict_flags,
        .move_notify = bo_driver_move_notify,
index 23ef9b1..5efc572 100644 (file)
@@ -646,13 +646,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
        return nouveau_sgdma_create_ttm(bo, page_flags);
 }
 
-static int
-nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                        struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static void
 nouveau_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl)
 {
@@ -1643,7 +1636,6 @@ struct ttm_bo_driver nouveau_bo_driver = {
        .ttm_tt_create = &nouveau_ttm_tt_create,
        .ttm_tt_populate = &nouveau_ttm_tt_populate,
        .ttm_tt_unpopulate = &nouveau_ttm_tt_unpopulate,
-       .init_mem_type = nouveau_bo_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = nouveau_bo_evict_flags,
        .move_notify = nouveau_bo_move_ntfy,
index 852089d..32069e4 100644 (file)
@@ -48,12 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
        return qdev;
 }
 
-static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                            struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static void qxl_evict_flags(struct ttm_buffer_object *bo,
                                struct ttm_placement *placement)
 {
@@ -215,7 +209,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
 static struct ttm_bo_driver qxl_bo_driver = {
        .ttm_tt_create = &qxl_ttm_tt_create,
-       .init_mem_type = &qxl_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = &qxl_evict_flags,
        .move = &qxl_bo_move,
index b0b59c5..f499d02 100644 (file)
@@ -66,12 +66,6 @@ struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
        return rdev;
 }
 
-static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                               struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static int radeon_ttm_init_vram(struct radeon_device *rdev)
 {
        struct ttm_mem_type_manager *man = &rdev->mman.bdev.man[TTM_PL_VRAM];
@@ -753,7 +747,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
        .ttm_tt_create = &radeon_ttm_tt_create,
        .ttm_tt_populate = &radeon_ttm_tt_populate,
        .ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-       .init_mem_type = &radeon_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = &radeon_evict_flags,
        .move = &radeon_bo_move,
index 9d316f3..6c02a33 100644 (file)
@@ -1524,10 +1524,6 @@ int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type,
        mutex_init(&man->io_reserve_mutex);
        spin_lock_init(&man->move_lock);
        INIT_LIST_HEAD(&man->io_reserve_lru);
-
-       ret = bdev->driver->init_mem_type(bdev, type, man);
-       if (ret)
-               return ret;
        man->bdev = bdev;
 
        if (type != TTM_PL_SYSTEM) {
index db4b2e2..0e28978 100644 (file)
@@ -736,12 +736,6 @@ out_no_init:
        return NULL;
 }
 
-static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
-                     struct ttm_mem_type_manager *man)
-{
-       return 0;
-}
-
 static void vmw_evict_flags(struct ttm_buffer_object *bo,
                     struct ttm_placement *placement)
 {
@@ -817,7 +811,6 @@ struct ttm_bo_driver vmw_bo_driver = {
        .ttm_tt_create = &vmw_ttm_tt_create,
        .ttm_tt_populate = &vmw_ttm_populate,
        .ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-       .init_mem_type = vmw_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = vmw_evict_flags,
        .move = NULL,
index adac4cd..f76f133 100644 (file)
@@ -157,7 +157,6 @@ struct ttm_mem_type_manager_func {
  * @move: The fence of the last pipelined move operation.
  *
  * This structure is used to identify and manage memory types for a device.
- * It's set up by the ttm_bo_driver::init_mem_type method.
  */
 
 
@@ -203,8 +202,6 @@ struct ttm_mem_type_manager {
  * struct ttm_bo_driver
  *
  * @create_ttm_backend_entry: Callback to create a struct ttm_backend.
- * @init_mem_type: Callback to initialize a struct ttm_mem_type_manager
- * structure.
  * @evict_flags: Callback to obtain placement flags when a buffer is evicted.
  * @move: Callback for a driver to hook in accelerated functions to
  * move a buffer.
@@ -247,9 +244,6 @@ struct ttm_bo_driver {
         */
        void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-       int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
-                            struct ttm_mem_type_manager *man);
-
        /**
         * struct ttm_bo_driver member eviction_valuable
         *