diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2011-12-19 14:35:48 -0800 |
---|---|---|
committer | Krishna Reddy <vdumpa@nvidia.com> | 2011-12-29 17:10:18 -0800 |
commit | 3b1a4102d33699c713d32aea8b1621ee53e16819 (patch) | |
tree | 8f7fe976b96a9e906da60a63ab0441f28ee52373 /include | |
parent | e3763055fa85f6e815d1cd8c26cb4453bf0869a7 (diff) |
gpu: ion: tegra: add tegra custom ioctl handling.
Add tegra specific custom ioctl handling.
Change-Id: If87b47f969fe0b3fdbb3bee965c370f6610fd4be
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/71113
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Tested-by: Hiroshi Doyu <hdoyu@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tegra_ion.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/include/linux/tegra_ion.h b/include/linux/tegra_ion.h new file mode 100644 index 000000000000..43d3d5a1cfdc --- /dev/null +++ b/include/linux/tegra_ion.h @@ -0,0 +1,98 @@ +/* + * include/linux/tegra_ion.h + * + * Copyright (C) 2011, NVIDIA Corporation. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include <linux/types.h> +#include <linux/ion.h> + +#if !defined(__KERNEL__) +#define __user +#endif + +#ifndef _LINUX_TEGRA_ION_H +#define _LINUX_TEGRA_ION_H + +struct tegra_ion_id_data { + struct ion_handle *handle; + unsigned long id; + size_t size; +}; + +struct tegra_ion_pin_data { + struct ion_handle **handles; /* array of handles to pin/unpin */ + unsigned long *addr; /* array pf addresses to return */ + unsigned long count; /* number of entries in handles */ +}; + +/* Cache operations. */ +enum { + TEGRA_ION_CACHE_OP_WB = 0, + TEGRA_ION_CACHE_OP_INV, + TEGRA_ION_CACHE_OP_WB_INV, +}; + +struct tegra_ion_cache_maint_data { + unsigned long addr; + struct ion_handle *handle; + size_t len; + unsigned int op; +}; + +struct tegra_ion_rw_data { + unsigned long addr; /* user pointer*/ + struct ion_handle *handle; + unsigned int offset; /* offset into handle mem */ + unsigned int elem_size; /* individual atome size */ + unsigned int mem_stride; /*delta in bytes between atoms in handle mem*/ + unsigned int user_stride; /* delta in bytes between atoms in user */ + unsigned int count; /* number of atoms to copy */ +}; + +struct tegra_ion_get_params_data { + struct ion_handle *handle; + size_t size; + unsigned int align; + unsigned int heap; + unsigned long addr; +}; + +/* Custom Ioctl's. */ +enum { + TEGRA_ION_ALLOC_FROM_ID = 0, + TEGRA_ION_GET_ID, + TEGRA_ION_PIN, + TEGRA_ION_UNPIN, + TEGRA_ION_CACHE_MAINT, + TEGRA_ION_READ, + TEGRA_ION_WRITE, + TEGRA_ION_GET_PARAM, +}; + +/* List of heaps in the system. */ +enum { + TEGRA_ION_HEAP_CARVEOUT = 0, + TEGRA_ION_HEAP_IRAM, + TEGRA_ION_HEAP_VPR, + TEGRA_ION_HEAP_IOMMU +}; + +/* additional heap types used only on tegra */ +enum { + TEGRA_ION_HEAP_TYPE_IOMMU = ION_HEAP_TYPE_CUSTOM + 1, +}; + +#define TEGRA_ION_HEAP_IOMMU_MASK (1 << TEGRA_ION_HEAP_TYPE_IOMMU) + +#endif /* _LINUX_TEGRA_ION_H */ |