Lines Matching refs:size
44 static size_t roundup_gem_size(size_t size) in roundup_gem_size() argument
46 return roundup(size, PAGE_SIZE); in roundup_gem_size()
62 unsigned int order = get_order(dobj->obj.size); in armada_gem_free_object()
91 size_t size = obj->obj.size; in armada_gem_linear_back() local
104 if (size <= 8192) { in armada_gem_linear_back()
105 unsigned int order = get_order(size); in armada_gem_linear_back()
113 memset(obj->addr, 0, PAGE_ALIGN(size)); in armada_gem_linear_back()
143 unsigned align = min_t(unsigned, size, SZ_2M); in armada_gem_linear_back()
153 size, align, 0, 0); in armada_gem_linear_back()
163 ptr = ioremap_wc(obj->linear->start, size); in armada_gem_linear_back()
173 memset_io(ptr, 0, size); in armada_gem_linear_back()
193 dobj->addr = ioremap_wc(dobj->phys_addr, dobj->obj.size); in armada_gem_map_object()
198 armada_gem_alloc_private_object(struct drm_device *dev, size_t size) in armada_gem_alloc_private_object() argument
202 size = roundup_gem_size(size); in armada_gem_alloc_private_object()
208 drm_gem_private_object_init(dev, &obj->obj, size); in armada_gem_alloc_private_object()
210 DRM_DEBUG_DRIVER("alloc private obj %p size %zu\n", obj, size); in armada_gem_alloc_private_object()
216 size_t size) in armada_gem_alloc_object() argument
221 size = roundup_gem_size(size); in armada_gem_alloc_object()
227 if (drm_gem_object_init(dev, &obj->obj, size)) { in armada_gem_alloc_object()
235 DRM_DEBUG_DRIVER("alloc obj %p size %zu\n", obj, size); in armada_gem_alloc_object()
246 size_t size; in armada_gem_dumb_create() local
250 args->size = size = args->pitch * args->height; in armada_gem_dumb_create()
252 dobj = armada_gem_alloc_private_object(dev, size); in armada_gem_dumb_create()
267 DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); in armada_gem_dumb_create()
315 size_t size; in armada_gem_create_ioctl() local
319 if (args->size == 0) in armada_gem_create_ioctl()
322 size = args->size; in armada_gem_create_ioctl()
324 dobj = armada_gem_alloc_object(dev, size); in armada_gem_create_ioctl()
335 DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); in armada_gem_create_ioctl()
358 addr = vm_mmap(dobj->obj.filp, 0, args->size, PROT_READ | PROT_WRITE, in armada_gem_mmap_ioctl()
378 args->handle, args->offset, args->size, args->ptr); in armada_gem_pwrite_ioctl()
380 if (args->size == 0) in armada_gem_pwrite_ioctl()
385 if (!access_ok(VERIFY_READ, ptr, args->size)) in armada_gem_pwrite_ioctl()
388 ret = fault_in_pages_readable(ptr, args->size); in armada_gem_pwrite_ioctl()
400 if (args->offset > dobj->obj.size || in armada_gem_pwrite_ioctl()
401 args->size > dobj->obj.size - args->offset) { in armada_gem_pwrite_ioctl()
402 DRM_ERROR("invalid size: object size %u\n", dobj->obj.size); in armada_gem_pwrite_ioctl()
407 if (copy_from_user(dobj->addr + args->offset, ptr, args->size)) { in armada_gem_pwrite_ioctl()
438 count = dobj->obj.size / PAGE_SIZE; in armada_gem_prime_map_dma_buf()
465 sg_set_page(sgt->sgl, dobj->page, dobj->obj.size, 0); in armada_gem_prime_map_dma_buf()
474 sg_dma_len(sgt->sgl) = dobj->obj.size; in armada_gem_prime_map_dma_buf()
544 exp_info.size = obj->size; in armada_gem_prime_export()
573 dobj = armada_gem_alloc_private_object(dev, buf->size); in armada_gem_prime_import()
606 if (sg_dma_len(dobj->sgt->sgl) < dobj->obj.size) { in armada_gem_map_import()