Home
last modified time | relevance | path

Searched full:heap (Results 1 – 25 of 502) sorted by relevance

12345678910>>...21

/kernel/linux/linux-5.10/drivers/staging/android/ion/
Dion_heap.c3 * ION Memory Allocator generic heap helpers
20 void *ion_heap_map_kernel(struct ion_heap *heap, in ion_heap_map_kernel() argument
54 void ion_heap_unmap_kernel(struct ion_heap *heap, in ion_heap_unmap_kernel() argument
60 int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, in ion_heap_map_user() argument
130 void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer) in ion_heap_freelist_add() argument
132 spin_lock(&heap->free_lock); in ion_heap_freelist_add()
133 list_add(&buffer->list, &heap->free_list); in ion_heap_freelist_add()
134 heap->free_list_size += buffer->size; in ion_heap_freelist_add()
135 spin_unlock(&heap->free_lock); in ion_heap_freelist_add()
136 wake_up(&heap->waitqueue); in ion_heap_freelist_add()
[all …]
Dion.c33 static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, in ion_buffer_create() argument
45 buffer->heap = heap; in ion_buffer_create()
50 ret = heap->ops->allocate(heap, buffer, len, flags); in ion_buffer_create()
53 if (!(heap->flags & ION_HEAP_FLAG_DEFER_FREE)) in ion_buffer_create()
56 ion_heap_freelist_drain(heap, 0); in ion_buffer_create()
57 ret = heap->ops->allocate(heap, buffer, len, flags); in ion_buffer_create()
63 WARN_ONCE(1, "This heap needs to set the sgtable"); in ion_buffer_create()
68 spin_lock(&heap->stat_lock); in ion_buffer_create()
69 heap->num_of_buffers++; in ion_buffer_create()
70 heap->num_of_alloc_bytes += len; in ion_buffer_create()
[all …]
Dion_system_heap.c3 * ION Memory Allocator system heap exporter
43 struct ion_heap heap; member
47 static struct page *alloc_buffer_page(struct ion_system_heap *heap, in alloc_buffer_page() argument
51 struct ion_page_pool *pool = heap->pools[order_to_index(order)]; in alloc_buffer_page()
56 static void free_buffer_page(struct ion_system_heap *heap, in free_buffer_page() argument
68 pool = heap->pools[order_to_index(order)]; in free_buffer_page()
73 static struct page *alloc_largest_available(struct ion_system_heap *heap, in alloc_largest_available() argument
87 page = alloc_buffer_page(heap, buffer, orders[i]); in alloc_largest_available()
97 static int ion_system_heap_allocate(struct ion_heap *heap, in ion_system_heap_allocate() argument
102 struct ion_system_heap *sys_heap = container_of(heap, in ion_system_heap_allocate()
[all …]
Dion.h28 * @heap: back pointer to the heap the buffer came from
43 struct ion_heap *heap; member
71 * struct ion_heap_ops - ops to operate on a given heap
86 int (*allocate)(struct ion_heap *heap,
90 void * (*map_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
91 void (*unmap_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
94 int (*shrink)(struct ion_heap *heap, gfp_t gfp_mask, int nr_to_scan);
98 * heap flags - flags between the heaps and core ion code
107 * heap-specific caching mechanism (e.g. page pools). Guarantees that
114 * struct ion_heap - represents a heap in the system
[all …]
Dion_cma_heap.c3 * ION Memory Allocator CMA heap exporter
20 struct ion_heap heap; member
24 #define to_cma_heap(x) container_of(x, struct ion_cma_heap, heap)
26 /* ION CMA heap operations functions */
27 static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, in ion_cma_allocate() argument
31 struct ion_cma_heap *cma_heap = to_cma_heap(heap); in ion_cma_allocate()
85 struct ion_cma_heap *cma_heap = to_cma_heap(buffer->heap); in ion_cma_free()
113 cma_heap->heap.ops = &ion_cma_ops; in __ion_cma_heap_create()
115 cma_heap->heap.type = ION_HEAP_TYPE_DMA; in __ion_cma_heap_create()
116 return &cma_heap->heap; in __ion_cma_heap_create()
[all …]
/kernel/linux/linux-5.10/drivers/dma-buf/
Ddma-heap.c20 #include <linux/dma-heap.h>
21 #include <uapi/linux/dma-heap.h>
28 * struct dma_heap - represents a dmabuf heap in the system
30 * @ops: ops struct for this heap
31 * @heap_devt heap device node
33 * @heap_cdev heap char device
35 * Represents a heap of memory from which buffers can be made.
52 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument
64 return heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc()
69 struct dma_heap *heap; in dma_heap_open() local
[all …]
/kernel/linux/linux-6.6/drivers/dma-buf/
Ddma-heap.c20 #include <linux/dma-heap.h>
21 #include <uapi/linux/dma-heap.h>
28 * struct dma_heap - represents a dmabuf heap in the system
30 * @ops: ops struct for this heap
31 * @heap_devt heap device node
33 * @heap_cdev heap char device
35 * Represents a heap of memory from which buffers can be made.
52 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument
67 dmabuf = heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc()
81 struct dma_heap *heap; in dma_heap_open() local
[all …]
/kernel/linux/linux-6.6/include/linux/
Dmin_heap.h10 * struct min_heap - Data structure to hold a min-heap.
11 * @data: Start of array holding the heap elements.
12 * @nr: Number of elements currently in the heap.
24 * @less: Partial order function for this heap.
33 /* Sift the element at pos down the heap. */
35 void min_heapify(struct min_heap *heap, int pos, in min_heapify() argument
39 void *data = heap->data; in min_heapify()
42 if (pos * 2 + 1 >= heap->nr) in min_heapify()
51 if (pos * 2 + 2 < heap->nr) { in min_heapify()
68 void min_heapify_all(struct min_heap *heap, in min_heapify_all() argument
[all …]
Ddma-heap.h18 * struct dma_heap_ops - ops to operate on a given heap
24 struct dma_buf *(*allocate)(struct dma_heap *heap,
31 * struct dma_heap_export_info - information needed to export a new dmabuf heap
33 * @ops: ops struct for this heap
34 * @priv: heap exporter private data
36 * Information needed to export a new dmabuf heap.
45 * dma_heap_get_drvdata() - get per-heap driver data
46 * @heap: DMA-Heap to retrieve private data for
49 * The per-heap data for the heap.
51 void *dma_heap_get_drvdata(struct dma_heap *heap);
[all …]
/kernel/linux/linux-5.10/include/linux/
Dmin_heap.h10 * struct min_heap - Data structure to hold a min-heap.
11 * @data: Start of array holding the heap elements.
12 * @nr: Number of elements currently in the heap.
24 * @less: Partial order function for this heap.
33 /* Sift the element at pos down the heap. */
35 void min_heapify(struct min_heap *heap, int pos, in min_heapify() argument
39 void *data = heap->data; in min_heapify()
42 if (pos * 2 + 1 >= heap->nr) in min_heapify()
51 if (pos * 2 + 2 < heap->nr) { in min_heapify()
68 void min_heapify_all(struct min_heap *heap, in min_heapify_all() argument
[all …]
Ddma-heap.h18 * struct dma_heap_ops - ops to operate on a given heap
24 int (*allocate)(struct dma_heap *heap,
31 * struct dma_heap_export_info - information needed to export a new dmabuf heap
33 * @ops: ops struct for this heap
34 * @priv: heap exporter private data
36 * Information needed to export a new dmabuf heap.
45 * dma_heap_get_drvdata() - get per-heap driver data
46 * @heap: DMA-Heap to retrieve private data for
49 * The per-heap data for the heap.
51 void *dma_heap_get_drvdata(struct dma_heap *heap);
[all …]
/kernel/linux/linux-5.10/lib/
Dtest_min_heap.c5 * Test cases for the min max heap.
33 struct min_heap *heap, in pop_verify_heap() argument
36 int *values = heap->data; in pop_verify_heap()
41 min_heap_pop(heap, funcs); in pop_verify_heap()
42 while (heap->nr > 0) { in pop_verify_heap()
57 min_heap_pop(heap, funcs); in pop_verify_heap()
66 struct min_heap heap = { in test_heapify_all() local
79 min_heapify_all(&heap, &funcs); in test_heapify_all()
80 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
84 heap.nr = ARRAY_SIZE(values); in test_heapify_all()
[all …]
/kernel/linux/linux-6.6/lib/
Dtest_min_heap.c5 * Test cases for the min max heap.
33 struct min_heap *heap, in pop_verify_heap() argument
36 int *values = heap->data; in pop_verify_heap()
41 min_heap_pop(heap, funcs); in pop_verify_heap()
42 while (heap->nr > 0) { in pop_verify_heap()
57 min_heap_pop(heap, funcs); in pop_verify_heap()
66 struct min_heap heap = { in test_heapify_all() local
79 min_heapify_all(&heap, &funcs); in test_heapify_all()
80 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
84 heap.nr = ARRAY_SIZE(values); in test_heapify_all()
[all …]
/kernel/linux/linux-5.10/fs/ubifs/
Dlprops.c22 * get_heap_comp_val - get the LEB properties value for heap comparisons.
39 * move_up_lpt_heap - move a new heap entry up as far as possible.
41 * @heap: LEB category heap
45 * New entries to a heap are added at the bottom and then moved up until the
50 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
57 return; /* Already top of the heap */ in move_up_lpt_heap()
59 /* Compare to parent and, if greater, move up the heap */ in move_up_lpt_heap()
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
67 heap->arr[ppos]->hpos = hpos; in move_up_lpt_heap()
68 heap->arr[hpos] = heap->arr[ppos]; in move_up_lpt_heap()
[all …]
/kernel/linux/linux-6.6/fs/ubifs/
Dlprops.c22 * get_heap_comp_val - get the LEB properties value for heap comparisons.
39 * move_up_lpt_heap - move a new heap entry up as far as possible.
41 * @heap: LEB category heap
45 * New entries to a heap are added at the bottom and then moved up until the
50 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
57 return; /* Already top of the heap */ in move_up_lpt_heap()
59 /* Compare to parent and, if greater, move up the heap */ in move_up_lpt_heap()
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
67 heap->arr[ppos]->hpos = hpos; in move_up_lpt_heap()
68 heap->arr[hpos] = heap->arr[ppos]; in move_up_lpt_heap()
[all …]
/kernel/linux/patches/linux-5.10/zhiyuan_patch/
Dkernel.patch13 drivers/dma-buf/dma-heap.c | 223 +++++--
19 drivers/dma-buf/heaps/heap-helpers.c | 1 -
26 include/linux/dma-heap.h | 62 +-
262 diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
264 --- a/drivers/dma-buf/dma-heap.c
265 +++ b/drivers/dma-buf/dma-heap.c
273 #include <linux/dma-heap.h>
275 * @heap_devt heap device node
277 * @heap_cdev heap char device
278 + * @heap_dev heap device struct
[all …]
/kernel/linux/linux-5.10/drivers/dma-buf/heaps/
Dcma_heap.c3 * DMABUF CMA heap exporter
12 #include <linux/dma-heap.h>
22 #include "heap-helpers.h"
25 struct dma_heap *heap; member
31 struct cma_heap *cma_heap = dma_heap_get_drvdata(buffer->heap); in cma_heap_free()
42 /* dmabuf heap CMA operations functions */
43 static int cma_heap_allocate(struct dma_heap *heap, in cma_heap_allocate() argument
48 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); in cma_heap_allocate()
66 helper_buffer->heap = heap; in cma_heap_allocate()
154 cma_heap->heap = dma_heap_add(&exp_info); in __add_cma_heap()
[all …]
DKconfig2 bool "DMA-BUF System Heap"
5 Choose this option to enable the system dmabuf heap. The system heap
9 bool "DMA-BUF CMA Heap"
12 Choose this option to enable dma-buf CMA heap. This heap is backed
/kernel/linux/linux-5.10/drivers/staging/android/uapi/
Dion.h19 * carveout heap, allocations are physically
24 * total heap types are supported
62 * @heap_id_mask: mask of heap ids to allocate from
63 * @flags: flags passed to heap
80 * struct ion_heap_data - data about a heap
81 * @name - first 32 characters of the heap name
82 * @type - heap type
83 * @heap_id - heap id for the heap
97 * @heaps - buffer to copy heap data
/kernel/linux/linux-5.10/tools/testing/selftests/android/ion/
Dion.h26 * carveout heap, allocations are physically
31 * total heap types are supported
69 * @heap_id_mask: mask of heap ids to allocate from
70 * @flags: flags passed to heap
87 * struct ion_heap_data - data about a heap
88 * @name - first 32 characters of the heap name
89 * @type - heap type
90 * @heap_id - heap id for the heap
104 * @heaps - buffer to copy heap data
DREADME13 two user space processes, using various heap types.
14 The following heap types are supported by ION driver.
22 Each heap is associated with the respective heap id.
26 the heap id, writing some data to this buffer and then exporting the FD
61 buffer sharing using ion system heap.
62 Currently the heap size is hard coded as just 10 bytes inside this script.
68 Now you can run the export and import manually by specifying the heap type
69 and the heap size.
82 heap type: 0
83 heap id: 1
[all …]
/kernel/linux/linux-6.6/drivers/dma-buf/heaps/
DKconfig2 bool "DMA-BUF System Heap"
5 Choose this option to enable the system dmabuf heap. The system heap
9 bool "DMA-BUF CMA Heap"
12 Choose this option to enable dma-buf CMA heap. This heap is backed
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
Dbase.c255 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
257 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
258 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
259 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
268 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
269 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
270 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
282 int heap; in nvkm_mmu_host() local
285 heap = nvkm_mmu_heap(mmu, NVKM_MEM_HOST, ~0ULL); in nvkm_mmu_host()
286 nvkm_mmu_type(mmu, heap, type); in nvkm_mmu_host()
[all …]
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
Dbase.c255 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
257 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
258 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
259 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
268 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
269 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
270 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
282 int heap; in nvkm_mmu_host() local
285 heap = nvkm_mmu_heap(mmu, NVKM_MEM_HOST, ~0ULL); in nvkm_mmu_host()
286 nvkm_mmu_type(mmu, heap, type); in nvkm_mmu_host()
[all …]
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/include/nvkm/core/
Dmm.h12 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()

12345678910>>...21