Commit 724daa4f authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/ttm: drop persistent_swap_storage from ttm_bo_init and co

Never used as parameter, the only driver actually using this is nouveau
and there it is initialized after the BO is initialized.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 231cdafc
...@@ -418,8 +418,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev, ...@@ -418,8 +418,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
amdgpu_ttm_placement_from_domain(bo, domain); amdgpu_ttm_placement_from_domain(bo, domain);
r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type, r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type,
&bo->placement, page_align, &ctx, NULL, &bo->placement, page_align, &ctx, acc_size,
acc_size, sg, resv, &amdgpu_ttm_bo_destroy); sg, resv, &amdgpu_ttm_bo_destroy);
if (unlikely(r != 0)) if (unlikely(r != 0))
return r; return r;
......
...@@ -321,7 +321,7 @@ int ast_bo_create(struct drm_device *dev, int size, int align, ...@@ -321,7 +321,7 @@ int ast_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&ast->ttm.bdev, &astbo->bo, size, ret = ttm_bo_init(&ast->ttm.bdev, &astbo->bo, size,
ttm_bo_type_device, &astbo->placement, ttm_bo_type_device, &astbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, ast_bo_ttm_destroy); NULL, NULL, ast_bo_ttm_destroy);
if (ret) if (ret)
goto error; goto error;
......
...@@ -368,7 +368,7 @@ static int bochs_bo_create(struct drm_device *dev, int size, int align, ...@@ -368,7 +368,7 @@ static int bochs_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&bochs->ttm.bdev, &bochsbo->bo, size, ret = ttm_bo_init(&bochs->ttm.bdev, &bochsbo->bo, size,
ttm_bo_type_device, &bochsbo->placement, ttm_bo_type_device, &bochsbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, bochs_bo_ttm_destroy); NULL, NULL, bochs_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -328,7 +328,7 @@ int cirrus_bo_create(struct drm_device *dev, int size, int align, ...@@ -328,7 +328,7 @@ int cirrus_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&cirrus->ttm.bdev, &cirrusbo->bo, size, ret = ttm_bo_init(&cirrus->ttm.bdev, &cirrusbo->bo, size,
ttm_bo_type_device, &cirrusbo->placement, ttm_bo_type_device, &cirrusbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, cirrus_bo_ttm_destroy); NULL, NULL, cirrus_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -317,7 +317,7 @@ int hibmc_bo_create(struct drm_device *dev, int size, int align, ...@@ -317,7 +317,7 @@ int hibmc_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&hibmc->bdev, &hibmcbo->bo, size, ret = ttm_bo_init(&hibmc->bdev, &hibmcbo->bo, size,
ttm_bo_type_device, &hibmcbo->placement, ttm_bo_type_device, &hibmcbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, hibmc_bo_ttm_destroy); NULL, NULL, hibmc_bo_ttm_destroy);
if (ret) { if (ret) {
hibmc_bo_unref(&hibmcbo); hibmc_bo_unref(&hibmcbo);
......
...@@ -324,7 +324,7 @@ int mgag200_bo_create(struct drm_device *dev, int size, int align, ...@@ -324,7 +324,7 @@ int mgag200_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&mdev->ttm.bdev, &mgabo->bo, size, ret = ttm_bo_init(&mdev->ttm.bdev, &mgabo->bo, size,
ttm_bo_type_device, &mgabo->placement, ttm_bo_type_device, &mgabo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, mgag200_bo_ttm_destroy); NULL, NULL, mgag200_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -298,7 +298,7 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align, ...@@ -298,7 +298,7 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
ret = ttm_bo_init(&drm->ttm.bdev, &nvbo->bo, size, ret = ttm_bo_init(&drm->ttm.bdev, &nvbo->bo, size,
type, &nvbo->placement, type, &nvbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, sg, align >> PAGE_SHIFT, false, acc_size, sg,
robj, nouveau_bo_del_ttm); robj, nouveau_bo_del_ttm);
if (ret) { if (ret) {
/* ttm will call nouveau_bo_del_ttm if it fails.. */ /* ttm will call nouveau_bo_del_ttm if it fails.. */
......
...@@ -109,7 +109,7 @@ int qxl_bo_create(struct qxl_device *qdev, ...@@ -109,7 +109,7 @@ int qxl_bo_create(struct qxl_device *qdev,
qxl_ttm_placement_from_domain(bo, domain, pinned); qxl_ttm_placement_from_domain(bo, domain, pinned);
r = ttm_bo_init(&qdev->mman.bdev, &bo->tbo, size, type, r = ttm_bo_init(&qdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, 0, !kernel, NULL, size, &bo->placement, 0, !kernel, size,
NULL, NULL, &qxl_ttm_bo_destroy); NULL, NULL, &qxl_ttm_bo_destroy);
if (unlikely(r != 0)) { if (unlikely(r != 0)) {
if (r != -ERESTARTSYS) if (r != -ERESTARTSYS)
......
...@@ -255,8 +255,8 @@ int radeon_bo_create(struct radeon_device *rdev, ...@@ -255,8 +255,8 @@ int radeon_bo_create(struct radeon_device *rdev,
/* Kernel allocation are uninterruptible */ /* Kernel allocation are uninterruptible */
down_read(&rdev->pm.mclk_lock); down_read(&rdev->pm.mclk_lock);
r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, page_align, !kernel, NULL, &bo->placement, page_align, !kernel, acc_size,
acc_size, sg, resv, &radeon_ttm_bo_destroy); sg, resv, &radeon_ttm_bo_destroy);
up_read(&rdev->pm.mclk_lock); up_read(&rdev->pm.mclk_lock);
if (unlikely(r != 0)) { if (unlikely(r != 0)) {
return r; return r;
......
...@@ -1149,7 +1149,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, ...@@ -1149,7 +1149,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
struct sg_table *sg, struct sg_table *sg,
struct reservation_object *resv, struct reservation_object *resv,
...@@ -1202,7 +1201,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, ...@@ -1202,7 +1201,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
bo->mem.bus.io_reserved_count = 0; bo->mem.bus.io_reserved_count = 0;
bo->moving = NULL; bo->moving = NULL;
bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
bo->persistent_swap_storage = persistent_swap_storage;
bo->acc_size = acc_size; bo->acc_size = acc_size;
bo->sg = sg; bo->sg = sg;
if (resv) { if (resv) {
...@@ -1261,7 +1259,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1261,7 +1259,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
bool interruptible, bool interruptible,
struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
struct sg_table *sg, struct sg_table *sg,
struct reservation_object *resv, struct reservation_object *resv,
...@@ -1271,8 +1268,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1271,8 +1268,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
int ret; int ret;
ret = ttm_bo_init_reserved(bdev, bo, size, type, placement, ret = ttm_bo_init_reserved(bdev, bo, size, type, placement,
page_alignment, &ctx, page_alignment, &ctx, acc_size,
persistent_swap_storage, acc_size,
sg, resv, destroy); sg, resv, destroy);
if (ret) if (ret)
return ret; return ret;
...@@ -1318,7 +1314,6 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1318,7 +1314,6 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
bool interruptible, bool interruptible,
struct file *persistent_swap_storage,
struct ttm_buffer_object **p_bo) struct ttm_buffer_object **p_bo)
{ {
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
...@@ -1331,7 +1326,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1331,7 +1326,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object)); acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object));
ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
interruptible, persistent_swap_storage, acc_size, interruptible, acc_size,
NULL, NULL, NULL); NULL, NULL, NULL);
if (likely(ret == 0)) if (likely(ret == 0))
*p_bo = bo; *p_bo = bo;
......
...@@ -89,7 +89,7 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, ...@@ -89,7 +89,7 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
virtio_gpu_init_ttm_placement(bo, pinned); virtio_gpu_init_ttm_placement(bo, pinned);
ret = ttm_bo_init(&vgdev->mman.bdev, &bo->tbo, size, type, ret = ttm_bo_init(&vgdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, 0, !kernel, NULL, acc_size, &bo->placement, 0, !kernel, acc_size,
NULL, NULL, &virtio_gpu_ttm_bo_destroy); NULL, NULL, &virtio_gpu_ttm_bo_destroy);
/* ttm_bo_init failure will call the destroy */ /* ttm_bo_init failure will call the destroy */
if (ret != 0) if (ret != 0)
......
...@@ -1245,7 +1245,7 @@ int vmw_cmdbuf_set_pool_size(struct vmw_cmdbuf_man *man, ...@@ -1245,7 +1245,7 @@ int vmw_cmdbuf_set_pool_size(struct vmw_cmdbuf_man *man,
return -ENOMEM; return -ENOMEM;
ret = ttm_bo_create(&dev_priv->bdev, size, ttm_bo_type_device, ret = ttm_bo_create(&dev_priv->bdev, size, ttm_bo_type_device,
&vmw_mob_ne_placement, 0, false, NULL, &vmw_mob_ne_placement, 0, false,
&man->cmd_space); &man->cmd_space);
if (ret) if (ret)
return ret; return ret;
......
...@@ -260,8 +260,7 @@ static int vmw_otable_batch_setup(struct vmw_private *dev_priv, ...@@ -260,8 +260,7 @@ static int vmw_otable_batch_setup(struct vmw_private *dev_priv,
ret = ttm_bo_create(&dev_priv->bdev, bo_size, ret = ttm_bo_create(&dev_priv->bdev, bo_size,
ttm_bo_type_device, ttm_bo_type_device,
&vmw_sys_ne_placement, &vmw_sys_ne_placement,
0, false, NULL, 0, false, &batch->otable_bo);
&batch->otable_bo);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
goto out_no_bo; goto out_no_bo;
...@@ -444,7 +443,7 @@ static int vmw_mob_pt_populate(struct vmw_private *dev_priv, ...@@ -444,7 +443,7 @@ static int vmw_mob_pt_populate(struct vmw_private *dev_priv,
ret = ttm_bo_create(&dev_priv->bdev, mob->num_pages * PAGE_SIZE, ret = ttm_bo_create(&dev_priv->bdev, mob->num_pages * PAGE_SIZE,
ttm_bo_type_device, ttm_bo_type_device,
&vmw_sys_ne_placement, &vmw_sys_ne_placement,
0, false, NULL, &mob->pt_bo); 0, false, &mob->pt_bo);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
return ret; return ret;
......
...@@ -384,8 +384,8 @@ int vmw_dmabuf_init(struct vmw_private *dev_priv, ...@@ -384,8 +384,8 @@ int vmw_dmabuf_init(struct vmw_private *dev_priv,
ret = ttm_bo_init(bdev, &vmw_bo->base, size, ret = ttm_bo_init(bdev, &vmw_bo->base, size,
ttm_bo_type_device, placement, ttm_bo_type_device, placement,
0, interruptible, 0, interruptible, acc_size,
NULL, acc_size, NULL, NULL, bo_free); NULL, NULL, bo_free);
return ret; return ret;
} }
......
...@@ -331,7 +331,7 @@ int vbox_bo_create(struct drm_device *dev, int size, int align, ...@@ -331,7 +331,7 @@ int vbox_bo_create(struct drm_device *dev, int size, int align,
ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size, ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size,
ttm_bo_type_device, &vboxbo->placement, ttm_bo_type_device, &vboxbo->placement,
align >> PAGE_SHIFT, false, NULL, acc_size, align >> PAGE_SHIFT, false, acc_size,
NULL, NULL, vbox_bo_ttm_destroy); NULL, NULL, vbox_bo_ttm_destroy);
if (ret) if (ret)
goto err_free_vboxbo; goto err_free_vboxbo;
......
...@@ -467,11 +467,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, ...@@ -467,11 +467,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev,
* @flags: Initial placement flags. * @flags: Initial placement flags.
* @page_alignment: Data alignment in pages. * @page_alignment: Data alignment in pages.
* @ctx: TTM operation context for memory allocation. * @ctx: TTM operation context for memory allocation.
* @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistent shmem object. Typically, this would
* point to the shmem object backing a GEM object if TTM is used to back a
* GEM user interface.
* @acc_size: Accounted size for this object. * @acc_size: Accounted size for this object.
* @resv: Pointer to a reservation_object, or NULL to let ttm allocate one. * @resv: Pointer to a reservation_object, or NULL to let ttm allocate one.
* @destroy: Destroy function. Use NULL for kfree(). * @destroy: Destroy function. Use NULL for kfree().
...@@ -504,7 +499,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, ...@@ -504,7 +499,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
struct sg_table *sg, struct sg_table *sg,
struct reservation_object *resv, struct reservation_object *resv,
...@@ -521,7 +515,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, ...@@ -521,7 +515,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
* @page_alignment: Data alignment in pages. * @page_alignment: Data alignment in pages.
* @interruptible: If needing to sleep to wait for GPU resources, * @interruptible: If needing to sleep to wait for GPU resources,
* sleep interruptible. * sleep interruptible.
* @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member * pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistent shmem object. Typically, this would * holds a pointer to a persistent shmem object. Typically, this would
* point to the shmem object backing a GEM object if TTM is used to back a * point to the shmem object backing a GEM object if TTM is used to back a
...@@ -551,8 +544,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, ...@@ -551,8 +544,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo, int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo,
unsigned long size, enum ttm_bo_type type, unsigned long size, enum ttm_bo_type type,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, bool interrubtible, uint32_t page_alignment, bool interrubtible, size_t acc_size,
struct file *persistent_swap_storage, size_t acc_size,
struct sg_table *sg, struct reservation_object *resv, struct sg_table *sg, struct reservation_object *resv,
void (*destroy) (struct ttm_buffer_object *)); void (*destroy) (struct ttm_buffer_object *));
...@@ -566,11 +558,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo, ...@@ -566,11 +558,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo,
* @page_alignment: Data alignment in pages. * @page_alignment: Data alignment in pages.
* @interruptible: If needing to sleep while waiting for GPU resources, * @interruptible: If needing to sleep while waiting for GPU resources,
* sleep interruptible. * sleep interruptible.
* @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistent shmem object. Typically, this would
* point to the shmem object backing a GEM object if TTM is used to back a
* GEM user interface.
* @p_bo: On successful completion *p_bo points to the created object. * @p_bo: On successful completion *p_bo points to the created object.
* *
* This function allocates a ttm_buffer_object, and then calls ttm_bo_init * This function allocates a ttm_buffer_object, and then calls ttm_bo_init
...@@ -583,7 +570,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo, ...@@ -583,7 +570,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo,
int ttm_bo_create(struct ttm_bo_device *bdev, unsigned long size, int ttm_bo_create(struct ttm_bo_device *bdev, unsigned long size,
enum ttm_bo_type type, struct ttm_placement *placement, enum ttm_bo_type type, struct ttm_placement *placement,
uint32_t page_alignment, bool interruptible, uint32_t page_alignment, bool interruptible,
struct file *persistent_swap_storage,
struct ttm_buffer_object **p_bo); struct ttm_buffer_object **p_bo);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment