/linux/drivers/gpu/drm/panthor/ |
H A D | panthor_heap.c | 16 * The GPU heap context is an opaque structure used by the GPU to track the 17 * heap allocations. The driver should only touch it to initialize it (zero all 28 * @next: Next heap chunk in the list. 39 * struct panthor_heap_chunk - Structure used to keep track of allocated heap chunks. 42 /** @node: Used to insert the heap chunk in panthor_heap::chunks. */ 45 /** @bo: Buffer object backing the heap chunk. */ 50 * struct panthor_heap - Structure used to manage tiler heap contexts. 53 /** @chunks: List containing all heap chunks allocated so far. */ 71 /** @chunk_count: Number of heap chunks currently allocated. */ 78 * struct panthor_heap_pool - Pool of heap context 125 panthor_free_heap_chunk(struct panthor_heap_pool * pool,struct panthor_heap * heap,struct panthor_heap_chunk * chunk) panthor_free_heap_chunk() argument 140 panthor_alloc_heap_chunk(struct panthor_heap_pool * pool,struct panthor_heap * heap,bool initial_chunk) panthor_alloc_heap_chunk() argument 202 panthor_free_heap_chunks(struct panthor_heap_pool * pool,struct panthor_heap * heap) panthor_free_heap_chunks() argument 211 panthor_alloc_heap_chunks(struct panthor_heap_pool * pool,struct panthor_heap * heap,u32 chunk_count) panthor_alloc_heap_chunks() argument 229 struct panthor_heap *heap; panthor_heap_destroy_locked() local 281 struct panthor_heap *heap; panthor_heap_create() local 376 struct panthor_heap *heap; panthor_heap_return_chunk() local 440 struct panthor_heap *heap; panthor_heap_grow() local 596 struct panthor_heap *heap; panthor_heap_pool_destroy() local [all...] |
/linux/Documentation/core-api/ |
H A D | min_heap.rst | 13 in the Linux kernel. A min-heap is a binary tree structure where the value of 39 The core data structure for representing a min-heap is defined using the 41 you to define a min-heap with a preallocated buffer or dynamically allocated 50 size_t nr; /* Number of elements in the heap */ 52 _type *data; /* Pointer to the heap data */ 58 A typical heap structure will include a counter for the number of elements 59 (`nr`), the maximum capacity of the heap (`size`), and a pointer to an array of 61 heap storage using **MIN_HEAP_PREALLOCATED**. 67 elements in the heap and swapping them. It contains two function pointers: 77 - **swp** is a function for swapping elements in the heap [all...] |
/linux/lib/ |
H A D | min_heap.c | 5 void __min_heap_init(min_heap_char *heap, void *data, size_t size) in __min_heap_init() argument 7 __min_heap_init_inline(heap, data, size); in __min_heap_init() 11 void *__min_heap_peek(struct min_heap_char *heap) in __min_heap_peek() argument 13 return __min_heap_peek_inline(heap); in __min_heap_peek() 17 bool __min_heap_full(min_heap_char *heap) in __min_heap_full() argument 19 return __min_heap_full_inline(heap); in __min_heap_full() 23 void __min_heap_sift_down(min_heap_char *heap, size_t pos, size_t elem_size, in __min_heap_sift_down() argument 26 __min_heap_sift_down_inline(heap, pos, elem_size, func, args); in __min_heap_sift_down() 30 void __min_heap_sift_up(min_heap_char *heap, size_t elem_size, size_t idx, in __min_heap_sift_up() argument 33 __min_heap_sift_up_inline(heap, elem_siz in __min_heap_sift_up() 37 __min_heapify_all(min_heap_char * heap,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heapify_all() argument 44 __min_heap_pop(min_heap_char * heap,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_pop() argument 51 __min_heap_pop_push(min_heap_char * heap,const void * element,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_pop_push() argument 58 __min_heap_push(min_heap_char * heap,const void * element,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_push() argument 65 __min_heap_del(min_heap_char * heap,size_t elem_size,size_t idx,const struct min_heap_callbacks * func,void * args) __min_heap_del() argument [all...] |
/linux/drivers/dma-buf/ |
H A D | dma-heap.c | 12 #include <linux/dma-heap.h> 19 #include <uapi/linux/dma-heap.h> 26 * struct dma_heap - represents a dmabuf heap in the system 28 * @ops: ops struct for this heap 29 * @priv: private data for this heap 30 * @heap_devt: heap device node 32 * @heap_cdev: heap char device 34 * Represents a heap of memory from which buffers can be made. 51 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument 66 dmabuf = heap in dma_heap_buffer_alloc() 80 struct dma_heap *heap; dma_heap_open() local 98 struct dma_heap *heap = file->private_data; dma_heap_ioctl_allocate() local 201 dma_heap_get_drvdata(struct dma_heap * heap) dma_heap_get_drvdata() argument 213 dma_heap_get_name(struct dma_heap * heap) dma_heap_get_name() argument 224 struct dma_heap *heap, *h, *err_ret; dma_heap_add() local [all...] |
/linux/include/linux/ |
H A D | min_heap.h | 21 * Data structure to hold a min-heap. 22 * @nr: Number of elements currently in the heap. 24 * @data: Pointer to the start of array holding the heap elements. 25 * @preallocated: Start of the static preallocated array holding the heap elements. 44 * @less: Partial order function for this heap. 195 * @i: the offset of the heap element whose parent is sought. Non-zero. 219 /* Initialize a min-heap. */ 221 void __min_heap_init_inline(min_heap_char *heap, void *data, size_t size) in __min_heap_init_inline() argument 223 heap->nr = 0; in __min_heap_init_inline() 224 heap in __min_heap_init_inline() 236 __min_heap_peek_inline(struct min_heap_char * heap) __min_heap_peek_inline() argument 247 __min_heap_full_inline(min_heap_char * heap) __min_heap_full_inline() argument 257 __min_heap_sift_down_inline(min_heap_char * heap,size_t pos,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_sift_down_inline() argument 297 __min_heap_sift_up_inline(min_heap_char * heap,size_t elem_size,size_t idx,const struct min_heap_callbacks * func,void * args) __min_heap_sift_up_inline() argument 324 __min_heapify_all_inline(min_heap_char * heap,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heapify_all_inline() argument 339 __min_heap_pop_inline(min_heap_char * heap,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_pop_inline() argument 365 __min_heap_pop_push_inline(min_heap_char * heap,const void * element,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_pop_push_inline() argument 378 __min_heap_push_inline(min_heap_char * heap,const void * element,size_t elem_size,const struct min_heap_callbacks * func,void * args) __min_heap_push_inline() argument 404 __min_heap_del_inline(min_heap_char * heap,size_t elem_size,size_t idx,const struct min_heap_callbacks * func,void * args) __min_heap_del_inline() argument [all...] |
/linux/tools/include/nolibc/ |
H A D | stdlib.h | 94 struct nolibc_heap *heap; in free() local 99 heap = container_of(ptr, struct nolibc_heap, user_p); in free() 100 munmap(heap, heap->len); in free() 129 struct nolibc_heap *heap; in malloc() local 132 len = sizeof(*heap) + len; in malloc() 134 heap = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, in malloc() 136 if (__builtin_expect(heap == MAP_FAILED, 0)) in malloc() 139 heap->len = len; in malloc() 140 return heap in malloc() 163 struct nolibc_heap *heap; realloc() local [all...] |
/linux/drivers/gpu/drm/nouveau/include/nvkm/core/ |
H A D | mm.h | 12 u8 heap; member 34 int nvkm_mm_init(struct nvkm_mm *, u8 heap, u32 offset, u32 length, u32 block); 36 int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max, 38 int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max, 44 nvkm_mm_heap_size(struct nvkm_mm *mm, u8 heap) in nvkm_mm_heap_size() argument 49 if (node->heap == heap) in nvkm_mm_heap_size()
|
/linux/Documentation/ABI/testing/ |
H A D | sysfs-kernel-mm-cma | 6 heap name (also sometimes called CMA areas). 8 Each CMA heap subdirectory (that is, each 9 /sys/kernel/mm/cma/<cma-heap-name> directory) contains the 15 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success 21 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail 27 What: /sys/kernel/mm/cma/<cma-heap-name>/release_pages_success 33 What: /sys/kernel/mm/cma/<cma-heap-name>/total_pages 39 What: /sys/kernel/mm/cma/<cma-heap-name>/available_pages
|
/linux/drivers/gpu/drm/nouveau/nvkm/core/ |
H A D | mm.c | 99 b->heap = a->heap; in region_head() 111 nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_head() argument 122 if (unlikely(heap != NVKM_MM_HEAP_ANY)) { in nvkm_mm_head() 123 if (this->heap != heap) in nvkm_mm_head() 175 b->heap = a->heap; in region_tail() 186 nvkm_mm_tail(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_tail() argument 198 if (unlikely(heap ! in nvkm_mm_tail() 240 nvkm_mm_init(struct nvkm_mm * mm,u8 heap,u32 offset,u32 length,u32 block) nvkm_mm_init() argument [all...] |
H A D | gpuobj.c | 180 ret = nvkm_mm_head(&parent->heap, 0, 1, size, size, in nvkm_gpuobj_ctor() 183 ret = nvkm_mm_tail(&parent->heap, 0, 1, size, size, in nvkm_gpuobj_ctor() 211 return nvkm_mm_init(&gpuobj->heap, 0, 0, gpuobj->size, 1); in nvkm_gpuobj_ctor() 220 nvkm_mm_free(&gpuobj->parent->heap, &gpuobj->node); in nvkm_gpuobj_del() 221 nvkm_mm_fini(&gpuobj->heap); in nvkm_gpuobj_del()
|
/linux/drivers/gpu/drm/nouveau/nvif/ |
H A D | mmu.c | 35 kfree(mmu->heap); in nvif_mmu_dtor() 53 mmu->heap = NULL; in nvif_mmu_ctor() 72 mmu->heap = kmalloc_array(mmu->heap_nr, sizeof(*mmu->heap), in nvif_mmu_ctor() 76 if (ret = -ENOMEM, !mmu->heap || !mmu->type) in nvif_mmu_ctor() 92 mmu->heap[i].size = args.size; in nvif_mmu_ctor() 112 mmu->type[i].heap = args.heap; in nvif_mmu_ctor()
|
/linux/drivers/dma-buf/heaps/ |
H A D | Kconfig | 5 Choose this option to enable the system dmabuf heap. The system heap 12 Choose this option to enable dma-buf CMA heap. This heap is backed 21 Add a duplicate CMA-backed dma-buf heap with legacy naming derived
|
H A D | cma_heap.c | 3 * DMABUF CMA heap exporter 8 * Also utilizing parts of Andrew Davis' SRAM heap: 17 #include <linux/dma-heap.h> 31 struct dma_heap *heap; member 36 struct cma_heap *heap; member 251 struct cma_heap *cma_heap = buffer->heap; in cma_heap_dma_buf_release() 279 static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, in cma_heap_allocate() argument 284 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); in cma_heap_allocate() 343 buffer->heap = cma_heap; in cma_heap_allocate() 347 exp_info.exp_name = dma_heap_get_name(heap); in cma_heap_allocate() [all...] |
/linux/fs/ubifs/ |
H A D | find.c | 45 struct ubifs_lpt_heap *heap; in valuable() local 51 heap = &c->lpt_heap[cat - 1]; in valuable() 52 if (heap->cnt < heap->max_cnt) in valuable() 130 struct ubifs_lpt_heap *heap; in scan_for_dirty() local 134 /* There may be an LEB with enough dirty space on the free heap */ in scan_for_dirty() 135 heap = &c->lpt_heap[LPROPS_FREE - 1]; in scan_for_dirty() 136 for (i = 0; i < heap->cnt; i++) { in scan_for_dirty() 137 lprops = heap->arr[i]; in scan_for_dirty() 145 * A LEB may have fallen off of the bottom of the dirty heap, an in scan_for_dirty() 226 struct ubifs_lpt_heap *heap, *idx_heap; ubifs_find_dirty_leb() local 401 struct ubifs_lpt_heap *heap; do_find_free_space() local 820 struct ubifs_lpt_heap *heap; find_dirty_idx_leb() local [all...] |
/linux/drivers/md/bcache/ |
H A D | movinggc.c | 194 return (b = heap_peek(&ca->heap)) ? GC_SECTORS_USED(b) : 0; in bucket_heap_top() 212 ca->heap.used = 0; in bch_moving_gc() 221 if (!heap_full(&ca->heap)) { in bch_moving_gc() 223 heap_add(&ca->heap, b, bucket_cmp); in bch_moving_gc() 224 } else if (bucket_cmp(b, heap_peek(&ca->heap))) { in bch_moving_gc() 228 ca->heap.data[0] = b; in bch_moving_gc() 229 heap_sift(&ca->heap, 0, bucket_cmp); in bch_moving_gc() 234 heap_pop(&ca->heap, b, bucket_cmp); in bch_moving_gc() 238 while (heap_pop(&ca->heap, b, bucket_cmp)) in bch_moving_gc()
|
H A D | util.h | 39 #define init_heap(heap, _size, gfp) \ argument 42 (heap)->used = 0; \ 43 (heap)->size = (_size); \ 44 _bytes = (heap)->size * sizeof(*(heap)->data); \ 45 (heap)->data = kvmalloc(_bytes, (gfp) & GFP_KERNEL); \ 46 (heap)->data; \ 49 #define free_heap(heap) \ argument 51 kvfree((heap)->data); \ 52 (heap) [all...] |
H A D | alloc.c | 74 /* Bucket heap / gen */ 182 ca->heap.used = 0; in invalidate_buckets_lru() 188 if (!heap_full(&ca->heap)) in invalidate_buckets_lru() 189 heap_add(&ca->heap, b, bucket_max_cmp); in invalidate_buckets_lru() 190 else if (bucket_max_cmp(b, heap_peek(&ca->heap))) { in invalidate_buckets_lru() 191 ca->heap.data[0] = b; in invalidate_buckets_lru() 192 heap_sift(&ca->heap, 0, bucket_max_cmp); in invalidate_buckets_lru() 196 for (i = ca->heap.used / 2 - 1; i >= 0; --i) in invalidate_buckets_lru() 197 heap_sift(&ca->heap, i, bucket_min_cmp); in invalidate_buckets_lru() 200 if (!heap_pop(&ca->heap, in invalidate_buckets_lru() [all...] |
/linux/lib/zlib_deflate/ |
H A D | deftree.c | 298 top = s->heap[SMALLEST]; \ 299 s->heap[SMALLEST] = s->heap[s->heap_len--]; \ 323 int v = s->heap[k]; in pqdownheap() 328 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { in pqdownheap() 332 if (smaller(tree, v, s->heap[j], s->depth)) break; in pqdownheap() 335 s->heap[k] = s->heap[j]; k = j; in pqdownheap() 340 s->heap[k] = v; in pqdownheap() 376 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ in gen_bitlen() 379 n = s->heap[h]; in gen_bitlen() 420 m = s->heap[--h]; in gen_bitlen() [all …]
|
/linux/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ |
H A D | tu102.c | 227 meta->gspFwRsvdStart = gsp->fb.heap.addr; in tu102_gsp_wpr_meta_init() 228 meta->nonWprHeapOffset = gsp->fb.heap.addr; in tu102_gsp_wpr_meta_init() 229 meta->nonWprHeapSize = gsp->fb.heap.size; in tu102_gsp_wpr_meta_init() 231 meta->gspFwHeapOffset = gsp->fb.wpr2.heap.addr; in tu102_gsp_wpr_meta_init() 232 meta->gspFwHeapSize = gsp->fb.wpr2.heap.size; in tu102_gsp_wpr_meta_init() 319 gsp->fb.wpr2.heap.size = tu102_gsp_wpr_heap_size(gsp); in tu102_gsp_oneinit() 321 gsp->fb.wpr2.heap.addr = ALIGN_DOWN(gsp->fb.wpr2.elf.addr - gsp->fb.wpr2.heap.size, 0x100000); in tu102_gsp_oneinit() 322 gsp->fb.wpr2.heap.size = ALIGN_DOWN(gsp->fb.wpr2.elf.addr - gsp->fb.wpr2.heap in tu102_gsp_oneinit() [all...] |
/linux/Documentation/userspace-api/ |
H A D | dma-buf-heaps.rst | 14 A heap represents a specific allocator. The Linux kernel currently supports the 17 - The ``system`` heap allocates virtually contiguous, cacheable, buffers. 19 - The ``cma`` heap allocates physically contiguous, cacheable, 24 ``CMA_SIZE_PERCENTAGE`` Kconfig options. The heap's name in devtmpfs is
|
/linux/drivers/accel/amdxdna/ |
H A D | aie2_ctx.c | 59 struct amdxdna_gem_obj *heap = hwctx->priv->heap; in aie2_hwctx_restart() local 69 heap->mem.userptr, heap->mem.size); in aie2_hwctx_restart() 532 struct amdxdna_gem_obj *heap; in aie2_hwctx_init() local 542 heap = client->dev_heap; in aie2_hwctx_init() 543 if (!heap) { in aie2_hwctx_init() 544 XDNA_ERR(xdna, "The client dev heap object not exist"); in aie2_hwctx_init() 549 drm_gem_object_get(to_gobj(heap)); in aie2_hwctx_init() 551 priv->heap in aie2_hwctx_init() [all...] |
H A D | amdxdna_gem.c | 32 struct amdxdna_gem_obj *heap; in amdxdna_gem_heap_alloc() local 39 heap = client->dev_heap; in amdxdna_gem_heap_alloc() 40 if (!heap) { in amdxdna_gem_heap_alloc() 45 if (heap->mem.userptr == AMDXDNA_INVALID_ADDR) { in amdxdna_gem_heap_alloc() 46 XDNA_ERR(xdna, "Invalid dev heap userptr"); in amdxdna_gem_heap_alloc() 51 if (mem->size == 0 || mem->size > heap->mem.size) { in amdxdna_gem_heap_alloc() 53 mem->size, heap->mem.size); in amdxdna_gem_heap_alloc() 59 ret = drm_mm_insert_node_generic(&heap->mm, &abo->mm_node, in amdxdna_gem_heap_alloc() 68 offset = mem->dev_addr - heap->mem.dev_addr; in amdxdna_gem_heap_alloc() 69 mem->userptr = heap in amdxdna_gem_heap_alloc() 90 struct amdxdna_gem_obj *heap; amdxdna_gem_heap_free() local [all...] |
/linux/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/ |
H A D | nv04.c | 32 struct nvkm_mm heap; member 104 nvkm_mm_free(&iobj->imem->heap, &iobj->node); in nv04_instobj_dtor() 137 ret = nvkm_mm_head(&imem->heap, 0, 1, size, size, align ? align : 1, &iobj->node); in nv04_instobj_new() 210 ret = nvkm_mm_init(&imem->heap, 0, 0, imem->base.reserved, 1); in nv04_instmem_oneinit() 248 nvkm_mm_fini(&imem->heap); in nv04_instmem_dtor()
|
H A D | nv40.c | 32 struct nvkm_mm heap; member 103 nvkm_mm_free(&iobj->imem->heap, &iobj->node); in nv40_instobj_dtor() 136 ret = nvkm_mm_head(&imem->heap, 0, 1, size, size, align ? align : 1, &iobj->node); in nv40_instobj_new() 179 ret = nvkm_mm_init(&imem->heap, 0, 0, imem->base.reserved, 1); in nv40_instmem_oneinit() 221 nvkm_mm_fini(&imem->heap); in nv40_instmem_dtor()
|
/linux/arch/x86/boot/compressed/ |
H A D | misc.c | 408 memptr heap = (memptr)boot_heap; in extract_kernel() local 456 free_mem_ptr = heap; /* Heap */ in extract_kernel() 457 free_mem_end_ptr = heap + BOOT_HEAP_SIZE; in extract_kernel() 499 if (heap > 0x3fffffffffffUL) in extract_kernel() 504 if (heap > ((-__PAGE_OFFSET-(128<<20)-1) & 0x7fffffff)) in extract_kernel()
|