aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tegra_ion.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tegra_ion.h')
-rw-r--r--include/linux/tegra_ion.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/include/linux/tegra_ion.h b/include/linux/tegra_ion.h
new file mode 100644
index 00000000000..73e190908b8
--- /dev/null
+++ b/include/linux/tegra_ion.h
@@ -0,0 +1,91 @@
1/*
2 * include/linux/tegra_ion.h
3 *
4 * Copyright (C) 2011, NVIDIA Corporation.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#include <linux/types.h>
18#include <linux/ion.h>
19
20#if !defined(__KERNEL__)
21#define __user
22#endif
23
24#ifndef _LINUX_TEGRA_ION_H
25#define _LINUX_TEGRA_ION_H
26
27struct tegra_ion_id_data {
28 struct ion_handle *handle;
29 unsigned long id;
30 size_t size;
31};
32
33struct tegra_ion_pin_data {
34 struct ion_handle **handles; /* array of handles to pin/unpin */
35 unsigned long *addr; /* array pf addresses to return */
36 unsigned long count; /* number of entries in handles */
37};
38
39/* Cache operations. */
40enum {
41 TEGRA_ION_CACHE_OP_WB = 0,
42 TEGRA_ION_CACHE_OP_INV,
43 TEGRA_ION_CACHE_OP_WB_INV,
44};
45
46struct tegra_ion_cache_maint_data {
47 unsigned long addr;
48 struct ion_handle *handle;
49 size_t len;
50 unsigned int op;
51};
52
53struct tegra_ion_rw_data {
54 unsigned long addr; /* user pointer*/
55 struct ion_handle *handle;
56 unsigned int offset; /* offset into handle mem */
57 unsigned int elem_size; /* individual atome size */
58 unsigned int mem_stride; /*delta in bytes between atoms in handle mem*/
59 unsigned int user_stride; /* delta in bytes between atoms in user */
60 unsigned int count; /* number of atoms to copy */
61};
62
63struct tegra_ion_get_params_data {
64 struct ion_handle *handle;
65 size_t size;
66 unsigned int align;
67 unsigned int heap;
68 unsigned long addr;
69};
70
71/* Custom Ioctl's. */
72enum {
73 TEGRA_ION_ALLOC_FROM_ID = 0,
74 TEGRA_ION_GET_ID,
75 TEGRA_ION_PIN,
76 TEGRA_ION_UNPIN,
77 TEGRA_ION_CACHE_MAINT,
78 TEGRA_ION_READ,
79 TEGRA_ION_WRITE,
80 TEGRA_ION_GET_PARAM,
81};
82
83/* List of heaps in the system. */
84enum {
85 TEGRA_ION_HEAP_CARVEOUT = 0,
86 TEGRA_ION_HEAP_IRAM,
87 TEGRA_ION_HEAP_VPR,
88 TEGRA_ION_HEAP_IOMMU
89};
90
91#endif /* _LINUX_TEGRA_ION_H */