Commit 0b91c4a1 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Dave Airlie

drm/ttm: remove ttm_buffer_object->buffer_start

All drivers set it to 0 and nothing uses it.
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ef8cf3a1
...@@ -356,7 +356,7 @@ int ast_bo_create(struct drm_device *dev, int size, int align, ...@@ -356,7 +356,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, 0, false, NULL, acc_size, align >> PAGE_SHIFT, false, NULL, acc_size,
NULL, ast_bo_ttm_destroy); NULL, ast_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -361,7 +361,7 @@ int cirrus_bo_create(struct drm_device *dev, int size, int align, ...@@ -361,7 +361,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, 0, false, NULL, acc_size, align >> PAGE_SHIFT, false, NULL, acc_size,
NULL, cirrus_bo_ttm_destroy); NULL, cirrus_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -355,7 +355,7 @@ int mgag200_bo_create(struct drm_device *dev, int size, int align, ...@@ -355,7 +355,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, 0, false, NULL, acc_size, align >> PAGE_SHIFT, false, NULL, acc_size,
NULL, mgag200_bo_ttm_destroy); NULL, mgag200_bo_ttm_destroy);
if (ret) if (ret)
return ret; return ret;
......
...@@ -225,7 +225,7 @@ nouveau_bo_new(struct drm_device *dev, int size, int align, ...@@ -225,7 +225,7 @@ nouveau_bo_new(struct drm_device *dev, int 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, 0, false, NULL, acc_size, sg, align >> PAGE_SHIFT, false, NULL, acc_size, sg,
nouveau_bo_del_ttm); 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.. */
......
...@@ -140,7 +140,7 @@ int radeon_bo_create(struct radeon_device *rdev, ...@@ -140,7 +140,7 @@ 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, 0, !kernel, NULL, &bo->placement, page_align, !kernel, NULL,
acc_size, sg, &radeon_ttm_bo_destroy); acc_size, sg, &radeon_ttm_bo_destroy);
up_read(&rdev->pm.mclk_lock); up_read(&rdev->pm.mclk_lock);
if (unlikely(r != 0)) { if (unlikely(r != 0)) {
......
...@@ -1179,7 +1179,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1179,7 +1179,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
enum ttm_bo_type type, enum ttm_bo_type type,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistent_swap_storage, struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
...@@ -1200,7 +1199,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1200,7 +1199,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
return -ENOMEM; return -ENOMEM;
} }
size += buffer_start & ~PAGE_MASK;
num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
if (num_pages == 0) { if (num_pages == 0) {
pr_err("Illegal buffer object size\n"); pr_err("Illegal buffer object size\n");
...@@ -1233,7 +1231,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1233,7 +1231,6 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
bo->mem.page_alignment = page_alignment; bo->mem.page_alignment = page_alignment;
bo->mem.bus.io_reserved_vm = false; bo->mem.bus.io_reserved_vm = false;
bo->mem.bus.io_reserved_count = 0; bo->mem.bus.io_reserved_count = 0;
bo->buffer_start = buffer_start & PAGE_MASK;
bo->priv_flags = 0; bo->priv_flags = 0;
bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
bo->seq_valid = false; bo->seq_valid = false;
...@@ -1306,7 +1303,6 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1306,7 +1303,6 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
enum ttm_bo_type type, enum ttm_bo_type type,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistent_swap_storage, struct file *persistent_swap_storage,
struct ttm_buffer_object **p_bo) struct ttm_buffer_object **p_bo)
...@@ -1321,8 +1317,8 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1321,8 +1317,8 @@ 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,
buffer_start, interruptible, interruptible, persistent_swap_storage, acc_size,
persistent_swap_storage, acc_size, NULL, NULL); NULL, NULL);
if (likely(ret == 0)) if (likely(ret == 0))
*p_bo = bo; *p_bo = bo;
......
...@@ -292,7 +292,7 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv) ...@@ -292,7 +292,7 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv)
PAGE_SIZE, PAGE_SIZE,
ttm_bo_type_device, ttm_bo_type_device,
&vmw_vram_sys_placement, &vmw_vram_sys_placement,
0, 0, false, NULL, 0, false, NULL,
&dev_priv->dummy_query_bo); &dev_priv->dummy_query_bo);
} }
......
...@@ -954,7 +954,7 @@ int vmw_surface_evict(struct vmw_private *dev_priv, ...@@ -954,7 +954,7 @@ int vmw_surface_evict(struct vmw_private *dev_priv,
if (!srf->backup) { if (!srf->backup) {
ret = ttm_bo_create(&dev_priv->bdev, srf->backup_size, ret = ttm_bo_create(&dev_priv->bdev, srf->backup_size,
ttm_bo_type_device, ttm_bo_type_device,
&vmw_srf_placement, 0, 0, true, &vmw_srf_placement, 0, true,
NULL, &srf->backup); NULL, &srf->backup);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
return ret; return ret;
...@@ -1566,7 +1566,7 @@ int vmw_dmabuf_init(struct vmw_private *dev_priv, ...@@ -1566,7 +1566,7 @@ 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, 0, interruptible, 0, interruptible,
NULL, acc_size, NULL, bo_free); NULL, acc_size, NULL, bo_free);
return ret; return ret;
} }
......
...@@ -141,8 +141,6 @@ struct ttm_tt; ...@@ -141,8 +141,6 @@ struct ttm_tt;
* struct ttm_buffer_object * struct ttm_buffer_object
* *
* @bdev: Pointer to the buffer object device structure. * @bdev: Pointer to the buffer object device structure.
* @buffer_start: The virtual user-space start address of ttm_bo_type_user
* buffers.
* @type: The bo type. * @type: The bo type.
* @destroy: Destruction function. If NULL, kfree is used. * @destroy: Destruction function. If NULL, kfree is used.
* @num_pages: Actual number of pages. * @num_pages: Actual number of pages.
...@@ -200,7 +198,6 @@ struct ttm_buffer_object { ...@@ -200,7 +198,6 @@ struct ttm_buffer_object {
struct ttm_bo_global *glob; struct ttm_bo_global *glob;
struct ttm_bo_device *bdev; struct ttm_bo_device *bdev;
unsigned long buffer_start;
enum ttm_bo_type type; enum ttm_bo_type type;
void (*destroy) (struct ttm_buffer_object *); void (*destroy) (struct ttm_buffer_object *);
unsigned long num_pages; unsigned long num_pages;
...@@ -472,8 +469,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, ...@@ -472,8 +469,6 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev,
* @type: Requested type of buffer object. * @type: Requested type of buffer object.
* @flags: Initial placement flags. * @flags: Initial placement flags.
* @page_alignment: Data alignment in pages. * @page_alignment: Data alignment in pages.
* @buffer_start: Virtual address of user space data backing a
* user buffer object.
* @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 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
...@@ -505,7 +500,6 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -505,7 +500,6 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
enum ttm_bo_type type, enum ttm_bo_type type,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start,
bool interrubtible, bool interrubtible,
struct file *persistent_swap_storage, struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
...@@ -521,8 +515,6 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -521,8 +515,6 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
* @type: Requested type of buffer object. * @type: Requested type of buffer object.
* @flags: Initial placement flags. * @flags: Initial placement flags.
* @page_alignment: Data alignment in pages. * @page_alignment: Data alignment in pages.
* @buffer_start: Virtual address of user space data backing a
* user buffer object.
* @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 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
...@@ -545,7 +537,6 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -545,7 +537,6 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev,
enum ttm_bo_type type, enum ttm_bo_type type,
struct ttm_placement *placement, struct ttm_placement *placement,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistent_swap_storage, 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