@@ -994,7 +994,7 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_resource *new_reg,
return 0;
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
- *new_tile = nv10_bo_set_tiling(dev, offset, new_reg->size,
+ *new_tile = nv10_bo_set_tiling(dev, offset, new_reg->num_pages << PAGE_SHIFT,
nvbo->mode, nvbo->zeta);
}
@@ -80,7 +80,7 @@ nv17_fence_context_new(struct nouveau_channel *chan)
struct nv10_fence_chan *fctx;
struct ttm_resource *reg = &priv->bo->bo.mem;
u32 start = reg->start * PAGE_SIZE;
- u32 limit = start + reg->size - 1;
+ u32 limit = start + (reg->num_pages << PAGE_SHIFT) - 1;
int ret = 0;
fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL);
@@ -39,7 +39,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
struct nv10_fence_chan *fctx;
struct ttm_resource *reg = &priv->bo->bo.mem;
u32 start = reg->start * PAGE_SIZE;
- u32 limit = start + reg->size - 1;
+ u32 limit = start + (reg->num_pages << PAGE_SHIFT) - 1;
int ret;
fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL);
@@ -956,7 +956,6 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
dma_resv_assert_held(bo->base.resv);
mem.num_pages = bo->mem.num_pages;
- mem.size = mem.num_pages << PAGE_SHIFT;
mem.page_alignment = bo->mem.page_alignment;
mem.bus.offset = 0;
mem.bus.addr = NULL;
@@ -1102,7 +1101,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
INIT_LIST_HEAD(&bo->swap);
bo->bdev = bdev;
bo->type = type;
- bo->mem.size = num_pages << PAGE_SHIFT;
bo->mem.mem_type = TTM_PL_SYSTEM;
bo->mem.num_pages = num_pages;
bo->mem.mm_node = NULL;
@@ -614,7 +614,7 @@ int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
static inline unsigned long ttm_bo_size_bytes(struct ttm_buffer_object *bo)
{
- return bo->mem.size;
+ return bo->mem.num_pages << PAGE_SHIFT;
}
#endif
@@ -159,7 +159,6 @@ struct ttm_bus_placement {
* struct ttm_resource
*
* @mm_node: Memory manager node.
- * @size: Requested size of memory region.
* @num_pages: Actual size of memory region in pages.
* @page_alignment: Page alignment.
* @placement: Placement flags.
@@ -171,7 +170,6 @@ struct ttm_bus_placement {
struct ttm_resource {
void *mm_node;
unsigned long start;
- unsigned long size;
unsigned long num_pages;
uint32_t page_alignment;
uint32_t mem_type;