Commit 28578f35 authored by Christian König's avatar Christian König

drm/ttm: remove ttm_bo_create

Not used any more.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391616/?series=81973&rev=1
parent 4671078e
...@@ -1254,19 +1254,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1254,19 +1254,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
} }
EXPORT_SYMBOL(ttm_bo_init); EXPORT_SYMBOL(ttm_bo_init);
static size_t ttm_bo_acc_size(struct ttm_bo_device *bdev,
unsigned long bo_size,
unsigned struct_size)
{
unsigned npages = (PAGE_ALIGN(bo_size)) >> PAGE_SHIFT;
size_t size = 0;
size += ttm_round_pot(struct_size);
size += ttm_round_pot(npages * sizeof(void *));
size += ttm_round_pot(sizeof(struct ttm_tt));
return size;
}
size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev,
unsigned long bo_size, unsigned long bo_size,
unsigned struct_size) unsigned struct_size)
...@@ -1281,33 +1268,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, ...@@ -1281,33 +1268,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev,
} }
EXPORT_SYMBOL(ttm_bo_dma_acc_size); EXPORT_SYMBOL(ttm_bo_dma_acc_size);
int ttm_bo_create(struct ttm_bo_device *bdev,
unsigned long size,
enum ttm_bo_type type,
struct ttm_placement *placement,
uint32_t page_alignment,
bool interruptible,
struct ttm_buffer_object **p_bo)
{
struct ttm_buffer_object *bo;
size_t acc_size;
int ret;
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (unlikely(bo == NULL))
return -ENOMEM;
acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object));
ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
interruptible, acc_size,
NULL, NULL, NULL);
if (likely(ret == 0))
*p_bo = bo;
return ret;
}
EXPORT_SYMBOL(ttm_bo_create);
int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type) int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bdev, mem_type); struct ttm_resource_manager *man = ttm_manager_type(bdev, mem_type);
......
...@@ -448,30 +448,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo, ...@@ -448,30 +448,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo,
struct sg_table *sg, struct dma_resv *resv, struct sg_table *sg, struct dma_resv *resv,
void (*destroy) (struct ttm_buffer_object *)); void (*destroy) (struct ttm_buffer_object *));
/**
* ttm_bo_create
*
* @bdev: Pointer to a ttm_bo_device struct.
* @size: Requested size of buffer object.
* @type: Requested type of buffer object.
* @placement: Initial placement.
* @page_alignment: Data alignment in pages.
* @interruptible: If needing to sleep while waiting for GPU resources,
* sleep interruptible.
* @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
* on that object. The destroy function is set to kfree().
* Returns
* -ENOMEM: Out of memory.
* -EINVAL: Invalid placement flags.
* -ERESTARTSYS: Interrupted by signal while waiting for resources.
*/
int ttm_bo_create(struct ttm_bo_device *bdev, unsigned long size,
enum ttm_bo_type type, struct ttm_placement *placement,
uint32_t page_alignment, bool interruptible,
struct ttm_buffer_object **p_bo);
/** /**
* ttm_bo_evict_mm * ttm_bo_evict_mm
* *
......
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