diff options
| author | Rebecca Schultz Zavin <rebecca@android.com> | 2013-02-13 14:48:11 -0800 |
|---|---|---|
| committer | Arve Hjønnevåg <arve@android.com> | 2013-07-01 14:16:22 -0700 |
| commit | 7533724d29d13cde4f8b839ec066c5941a6674c8 (patch) | |
| tree | f4e4fd4ab3a1bf0b014ff10e83f3d3d803f2d7c0 /drivers/gpu/ion/ion_priv.h | |
| parent | 0c5363f6a0a89952b0d0072ff4e4c3bd042add9a (diff) | |
| download | olio-linux-3.10-7533724d29d13cde4f8b839ec066c5941a6674c8.tar.xz olio-linux-3.10-7533724d29d13cde4f8b839ec066c5941a6674c8.zip | |
gpu: ion: Make ion_free asynchronous
Add the ability for a heap to free buffers asynchrounously. Freed buffers
are placed on a free list and freed from a low priority background thread.
If allocations from a particular heap fail, the free list is drained. This
patch also enable asynchronous frees from the chunk heap.
Change-Id: Idfdbc8608b6cbd9e27d2e31ea4fd84fea9f69f7d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/gpu/ion/ion_priv.h')
| -rw-r--r-- | drivers/gpu/ion/ion_priv.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/ion/ion_priv.h b/drivers/gpu/ion/ion_priv.h index c1169216519..505681479c0 100644 --- a/drivers/gpu/ion/ion_priv.h +++ b/drivers/gpu/ion/ion_priv.h @@ -57,7 +57,10 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); */ struct ion_buffer { struct kref ref; - struct rb_node node; + union { + struct rb_node node; + struct list_head list; + }; struct ion_device *dev; struct ion_heap *heap; unsigned long flags; @@ -108,15 +111,25 @@ struct ion_heap_ops { }; /** + * heap flags - flags between the heaps and core ion code + */ +#define ION_HEAP_FLAG_DEFER_FREE (1 << 0) + +/** * struct ion_heap - represents a heap in the system * @node: rb node to put the heap on the device's tree of heaps * @dev: back pointer to the ion_device * @type: type of heap * @ops: ops struct as above + * @flags: flags * @id: id of heap, also indicates priority of this heap when * allocating. These are specified by platform data and * MUST be unique * @name: used for debugging + * @free_list: free list head if deferred free is used + * @lock: protects the free list + * @waitqueue: queue to wait on from deferred free thread + * @task: task struct of deferred free thread * @debug_show: called when heap debug file is read to add any * heap specific debug info to output * @@ -130,8 +143,13 @@ struct ion_heap { struct ion_device *dev; enum ion_heap_type type; struct ion_heap_ops *ops; + unsigned long flags; unsigned int id; const char *name; + struct list_head free_list; + struct rt_mutex lock; + wait_queue_head_t waitqueue; + struct task_struct *task; int (*debug_show)(struct ion_heap *heap, struct seq_file *, void *); }; |