aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/tegra/nvmap/nvmap_heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap_heap.h')
-rw-r--r--drivers/video/tegra/nvmap/nvmap_heap.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_heap.h b/drivers/video/tegra/nvmap/nvmap_heap.h
new file mode 100644
index 00000000000..158a1fa3d33
--- /dev/null
+++ b/drivers/video/tegra/nvmap/nvmap_heap.h
@@ -0,0 +1,68 @@
1/*
2 * drivers/video/tegra/nvmap/nvmap_heap.h
3 *
4 * GPU heap allocator.
5 *
6 * Copyright (c) 2010-2011, NVIDIA Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22
23#ifndef __NVMAP_HEAP_H
24#define __NVMAP_HEAP_H
25
26struct device;
27struct nvmap_heap;
28struct attribute_group;
29
30struct nvmap_heap_block {
31 phys_addr_t base;
32 unsigned int type;
33 struct nvmap_handle *handle;
34};
35
36#define NVMAP_HEAP_MIN_BUDDY_SIZE 8192
37
38struct nvmap_heap *nvmap_heap_create(struct device *parent, const char *name,
39 phys_addr_t base, size_t len,
40 unsigned int buddy_size, void *arg);
41
42void nvmap_heap_destroy(struct nvmap_heap *heap);
43
44void *nvmap_heap_device_to_arg(struct device *dev);
45
46void *nvmap_heap_to_arg(struct nvmap_heap *heap);
47
48struct nvmap_heap_block *nvmap_heap_alloc(struct nvmap_heap *heap,
49 struct nvmap_handle *handle);
50
51struct nvmap_heap *nvmap_block_to_heap(struct nvmap_heap_block *b);
52
53void nvmap_heap_free(struct nvmap_heap_block *block);
54
55int nvmap_heap_create_group(struct nvmap_heap *heap,
56 const struct attribute_group *grp);
57
58void nvmap_heap_remove_group(struct nvmap_heap *heap,
59 const struct attribute_group *grp);
60
61int __init nvmap_heap_init(void);
62
63void nvmap_heap_deinit(void);
64
65int nvmap_flush_heap_block(struct nvmap_client *client,
66 struct nvmap_heap_block *block, size_t len, unsigned int prot);
67
68#endif