diff options
| author | Ishan Mittal <imittal@nvidia.com> | 2017-06-28 08:57:29 -0400 |
|---|---|---|
| committer | Ishan Mittal <imittal@nvidia.com> | 2017-06-28 08:57:29 -0400 |
| commit | 94c70a1d3d9bd9e2205ce3fb617688ecedfdca74 (patch) | |
| tree | 2e3867db2acb860a179cf65cea05a5c52f18dbaf /include/linux | |
| parent | 7a1657e1fc15ba8f865f066dae626166a6bd098e (diff) | |
| parent | ecb2a4feff1ea906d2eae2eff227df088ea4d186 (diff) | |
Merge branch 'nvt19x/dev-kernel' into t19x
Change-Id: I202b16a874abcaae3e1a66cfa30b3a32e015aa71
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nvhost_ioctl_t194.h | 31 | ||||
| -rw-r--r-- | include/linux/nvhost_nvdla_ioctl.h | 217 | ||||
| -rw-r--r-- | include/linux/nvhost_t194.h | 29 |
3 files changed, 277 insertions, 0 deletions
diff --git a/include/linux/nvhost_ioctl_t194.h b/include/linux/nvhost_ioctl_t194.h new file mode 100644 index 000000000..6606c84dd --- /dev/null +++ b/include/linux/nvhost_ioctl_t194.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/nvhost_ioctl_t194.h | ||
| 3 | * | ||
| 4 | * Tegra graphics host driver | ||
| 5 | * | ||
| 6 | * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. | ||
| 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 __LINUX_NVHOST_IOCTL_T194_H | ||
| 24 | #define __LINUX_NVHOST_IOCTL_T194_H | ||
| 25 | |||
| 26 | enum nvhost_module_id_t194 { | ||
| 27 | NVHOST_MODULE_NVENC1 = 12, | ||
| 28 | NVHOST_MODULE_NVDEC1 = 13, | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif | ||
diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h new file mode 100644 index 000000000..60893e813 --- /dev/null +++ b/include/linux/nvhost_nvdla_ioctl.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/nvhost_nvdla_ioctl.h | ||
| 3 | * | ||
| 4 | * Tegra NvDLA Driver | ||
| 5 | * | ||
| 6 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms and conditions of the GNU General Public License, | ||
| 10 | * version 2, as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 15 | * more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along with | ||
| 18 | * this program; if not, see <http://www.gnu.org/licenses/>. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_NVHOST_NVDLA_IOCTL_H | ||
| 22 | #define __LINUX_NVHOST_NVDLA_IOCTL_H | ||
| 23 | |||
| 24 | #include <linux/ioctl.h> | ||
| 25 | #include <linux/types.h> | ||
| 26 | |||
| 27 | #if !defined(__KERNEL__) | ||
| 28 | #define __user | ||
| 29 | #endif | ||
| 30 | |||
| 31 | /** | ||
| 32 | * struct nvdla_queue_stat_args strcture | ||
| 33 | * | ||
| 34 | * @status queue status flags | ||
| 35 | * | ||
| 36 | */ | ||
| 37 | struct nvdla_queue_status_args { | ||
| 38 | #define NVDLA_QUEUE_FLAGS_SUSPEND (1 << 0) | ||
| 39 | #define NVDLA_QUEUE_FLAGS_RESUME (1 << 1) | ||
| 40 | __u64 status; | ||
| 41 | }; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * struct nvdla_ping_args structure for ping data | ||
| 45 | * | ||
| 46 | * @in_challenge challenge data to be sent | ||
| 47 | * @out_response response/CRC on challenge data from engine | ||
| 48 | * | ||
| 49 | */ | ||
| 50 | struct nvdla_ping_args { | ||
| 51 | __u32 in_challenge; | ||
| 52 | __u32 out_response; | ||
| 53 | }; | ||
| 54 | |||
| 55 | |||
| 56 | /** | ||
| 57 | * struct nvdla_pin_unpin_args strcture args for buffer pin/unpin | ||
| 58 | * | ||
| 59 | * @buffers list of buffers to pin/unpin'ed | ||
| 60 | * @num_buffers number of buffers count | ||
| 61 | * @reserved reserved for future use | ||
| 62 | * | ||
| 63 | */ | ||
| 64 | struct nvdla_pin_unpin_args { | ||
| 65 | __u64 buffers; | ||
| 66 | __u32 num_buffers; | ||
| 67 | __u32 reserved; | ||
| 68 | }; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * struct nvdla_submit_args structure for task submit | ||
| 72 | * | ||
| 73 | * @tasks pointer to task list | ||
| 74 | * @num_tasks number of tasks count | ||
| 75 | * @flags flags for task submit, like atomic | ||
| 76 | * @version version of task structure | ||
| 77 | * | ||
| 78 | */ | ||
| 79 | struct nvdla_submit_args { | ||
| 80 | __u64 tasks; | ||
| 81 | __u16 num_tasks; | ||
| 82 | #define MAX_TASKS_PER_SUBMIT 24 | ||
| 83 | #define NVDLA_SUBMIT_FLAGS_ATOMIC (1 << 0) | ||
| 84 | __u16 flags; | ||
| 85 | __u32 version; | ||
| 86 | }; | ||
| 87 | |||
| 88 | /** | ||
| 89 | * struct nvdla_get_fw_ver_args strcture | ||
| 90 | * | ||
| 91 | * @version Firmware version | ||
| 92 | * | ||
| 93 | */ | ||
| 94 | struct nvdla_get_fw_ver_args { | ||
| 95 | __u32 version; | ||
| 96 | }; | ||
| 97 | |||
| 98 | /** | ||
| 99 | * struct nvdla_get_q_status_args strcture | ||
| 100 | * | ||
| 101 | * @id queue id | ||
| 102 | * @fence fence assigned to queue | ||
| 103 | * | ||
| 104 | */ | ||
| 105 | struct nvdla_get_q_status_args { | ||
| 106 | __u32 id; | ||
| 107 | __u64 fence; | ||
| 108 | }; | ||
| 109 | |||
| 110 | /** | ||
| 111 | * struct nvdla_mem_handle structure for memory handles | ||
| 112 | * | ||
| 113 | * @handle handle to buffer allocated in userspace | ||
| 114 | * @offset offset in buffer | ||
| 115 | * | ||
| 116 | */ | ||
| 117 | struct nvdla_mem_handle { | ||
| 118 | __u32 handle; | ||
| 119 | __u32 offset; | ||
| 120 | }; | ||
| 121 | |||
| 122 | /** | ||
| 123 | * struct nvdla_ioctl_submit_task structure for single task information | ||
| 124 | * | ||
| 125 | * @num_prefences number of pre-fences in task | ||
| 126 | * @num_postfences number of post-fences in task | ||
| 127 | * @num_input_task_status number of input task status | ||
| 128 | * @num_output_task_status number of output task status | ||
| 129 | * @flags flags for bitwise task info embeddeing | ||
| 130 | * @reserved reserved for future use | ||
| 131 | * @prefences pointer to pre-fence struct table | ||
| 132 | * @postfences pointer to post-fence struct table | ||
| 133 | * @input_task_status pointer to input task status struct table | ||
| 134 | * @output_task_status pointer to output task status struct table | ||
| 135 | * @num_addresses total number of addressed passed in structure | ||
| 136 | * @address_list pointer to address list | ||
| 137 | * @timeout task timeout | ||
| 138 | * | ||
| 139 | */ | ||
| 140 | struct nvdla_ioctl_submit_task { | ||
| 141 | __u8 num_prefences; | ||
| 142 | __u8 num_postfences; | ||
| 143 | __u8 num_input_task_status; | ||
| 144 | __u8 num_output_task_status; | ||
| 145 | #define NVDLA_MAX_BUFFERS_PER_TASK (256) | ||
| 146 | __u32 num_addresses; | ||
| 147 | __u16 flags; | ||
| 148 | __u16 reserved; | ||
| 149 | |||
| 150 | __u64 prefences; | ||
| 151 | __u64 postfences; | ||
| 152 | |||
| 153 | __u64 input_task_status; | ||
| 154 | __u64 output_task_status; | ||
| 155 | __u64 address_list; | ||
| 156 | __u64 timeout; | ||
| 157 | }; | ||
| 158 | |||
| 159 | /** | ||
| 160 | * struct nvdla_fence structure for passing fence information | ||
| 161 | * | ||
| 162 | * @type type of fence: syncpoint, Linux Sync Fd | ||
| 163 | * @syncpoint_index syncpoint id | ||
| 164 | * @syncpoint_value value of syncpoint id | ||
| 165 | * @sync_fd Linux sync FD handle | ||
| 166 | */ | ||
| 167 | struct nvdla_fence { | ||
| 168 | __u32 type; | ||
| 169 | #define NVDLA_FENCE_TYPE_SYNCPT 0 | ||
| 170 | #define NVDLA_FENCE_TYPE_SYNC_FD 1 | ||
| 171 | #define NVDLA_FENCE_TYPE_SEMAPHORE 2 | ||
| 172 | #define NVDLA_FENCE_TYPE_TS_SEMAPHORE 3 | ||
| 173 | __u32 syncpoint_index; | ||
| 174 | __u32 syncpoint_value; | ||
| 175 | __u32 sync_fd; | ||
| 176 | __u32 sem_handle; | ||
| 177 | __u32 sem_offset; | ||
| 178 | __u32 sem_val; | ||
| 179 | }; | ||
| 180 | |||
| 181 | /** | ||
| 182 | * struct nvdla_status_notify structure for passing status notify information | ||
| 183 | * | ||
| 184 | * @handle handle to buffer allocated in userspace | ||
| 185 | * @offset offset in buffer | ||
| 186 | * @status status | ||
| 187 | * | ||
| 188 | */ | ||
| 189 | struct nvdla_status_notify { | ||
| 190 | __u32 handle; | ||
| 191 | __u32 offset; | ||
| 192 | __u32 status; | ||
| 193 | }; | ||
| 194 | |||
| 195 | #define NVHOST_NVDLA_IOCTL_MAGIC 'D' | ||
| 196 | |||
| 197 | #define NVDLA_IOCTL_PING \ | ||
| 198 | _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 1, struct nvdla_ping_args) | ||
| 199 | #define NVDLA_IOCTL_PIN \ | ||
| 200 | _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 2, struct nvdla_pin_unpin_args) | ||
| 201 | #define NVDLA_IOCTL_UNPIN \ | ||
| 202 | _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_pin_unpin_args) | ||
| 203 | #define NVDLA_IOCTL_SUBMIT \ | ||
| 204 | _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_submit_args) | ||
| 205 | #define NVDLA_IOCTL_SET_QUEUE_STATUS \ | ||
| 206 | _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 5, struct nvdla_queue_status_args) | ||
| 207 | #define NVDLA_IOCTL_GET_FIRMWARE_VERSION \ | ||
| 208 | _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 6, struct nvdla_get_fw_ver_args) | ||
| 209 | #define NVDLA_IOCTL_GET_QUEUE_STATUS \ | ||
| 210 | _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 7, struct nvdla_get_q_status_args) | ||
| 211 | #define NVDLA_IOCTL_LAST \ | ||
| 212 | _IOC_NR(NVDLA_IOCTL_GET_QUEUE_STATUS) | ||
| 213 | |||
| 214 | #define NVDLA_IOCTL_MAX_ARG_SIZE \ | ||
| 215 | sizeof(struct nvdla_pin_unpin_args) | ||
| 216 | |||
| 217 | #endif /* __LINUX_NVHOST_NVDLA_IOCTL_H */ | ||
diff --git a/include/linux/nvhost_t194.h b/include/linux/nvhost_t194.h new file mode 100644 index 000000000..f7b7dbdeb --- /dev/null +++ b/include/linux/nvhost_t194.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_NVHOST_T194_H__ | ||
| 20 | #define __LINUX_NVHOST_T194_H__ | ||
| 21 | |||
| 22 | int nvhost_syncpt_unit_interface_get_aperture( | ||
| 23 | struct platform_device *host_pdev, | ||
| 24 | phys_addr_t *base, | ||
| 25 | size_t *size); | ||
| 26 | |||
| 27 | u32 nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id); | ||
| 28 | |||
| 29 | #endif /* __LINUX_NVHOST_T194_H__ */ | ||
