diff options
| author | Deepak Nibade <dnibade@nvidia.com> | 2017-11-16 02:34:20 -0500 |
|---|---|---|
| committer | Deepak Nibade <dnibade@nvidia.com> | 2017-11-16 02:44:33 -0500 |
| commit | 7047764bbc20ff8d839b646ad31bb4a9f97a243a (patch) | |
| tree | 72b59a5a40da704fc346e1048223f1b2ae6cd778 /include/uapi/linux | |
| parent | 44b9b64dbde264b648a7c8ef9c136f9012123ef5 (diff) | |
| parent | 276714cceccf291b9cc05d71fe98fe2098fbfe01 (diff) | |
Merge remote-tracking branch 'remotes/origin/dev/linux-t19x' into linux-nvidia
Bug 200363166
Change-Id: Id0fcee1cc01fe1648afe7e3f2d44f820563898ca
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/nvhost_pva_ioctl.h | 316 | ||||
| -rw-r--r-- | include/uapi/linux/tegra_l3_cache.h | 45 |
2 files changed, 361 insertions, 0 deletions
diff --git a/include/uapi/linux/nvhost_pva_ioctl.h b/include/uapi/linux/nvhost_pva_ioctl.h new file mode 100644 index 000000000..233b9eca5 --- /dev/null +++ b/include/uapi/linux/nvhost_pva_ioctl.h | |||
| @@ -0,0 +1,316 @@ | |||
| 1 | /* | ||
| 2 | * Tegra PVA Driver ioctls | ||
| 3 | * | ||
| 4 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms and conditions of the GNU General Public License, | ||
| 8 | * version 2, as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 13 | * more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License along with | ||
| 16 | * this program; If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_NVHOST_PVA_IOCTL_H | ||
| 20 | #define __LINUX_NVHOST_PVA_IOCTL_H | ||
| 21 | |||
| 22 | #include <linux/ioctl.h> | ||
| 23 | #include <linux/types.h> | ||
| 24 | |||
| 25 | #if !defined(__KERNEL__) | ||
| 26 | #define __user | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #define NVHOST_PVA_IOCTL_MAGIC 'P' | ||
| 30 | |||
| 31 | /** | ||
| 32 | * struct pva_characteristics_req - Request filling of characteristics struct | ||
| 33 | * | ||
| 34 | * @characteristics: pointer to be filled with characteristics | ||
| 35 | * @characteristics_size: size in bytes | ||
| 36 | * @characteristics_filled: reserved(set to zero) | ||
| 37 | * | ||
| 38 | */ | ||
| 39 | struct pva_characteristics_req { | ||
| 40 | __u64 characteristics; | ||
| 41 | __u64 characteristics_size; | ||
| 42 | __u64 characteristics_filled; | ||
| 43 | }; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * struct pva_characteristics - the information of the pva cluster | ||
| 47 | * | ||
| 48 | * @num_vpu: number of vpu per pva | ||
| 49 | * @vpu_generation: vpu hardware generation | ||
| 50 | * @num_queues: number of queues per pva | ||
| 51 | * @reserved: reserved for future use | ||
| 52 | * @r5_ucode_version: R5 firmware version | ||
| 53 | * @r5_ucode_earliest: 1st version compatible with current running fw | ||
| 54 | * @r5_vpu_runtime_earliest: First supported vpu runtime version | ||
| 55 | * | ||
| 56 | */ | ||
| 57 | struct pva_characteristics { | ||
| 58 | __u8 num_vpu; | ||
| 59 | __u8 vpu_generation; | ||
| 60 | __u8 num_queues; | ||
| 61 | __u8 reserved[1]; | ||
| 62 | __u32 r5_ucode_version; | ||
| 63 | __u32 r5_ucode_earliest; | ||
| 64 | __u32 r5_vpu_runtime_earliest; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /** | ||
| 68 | * struct pva_pin_unpin_args - buffer handles to pin or unpin | ||
| 69 | * | ||
| 70 | * @buffers: Pointer to the table of u32 | ||
| 71 | * @num_buffers: elements in the buffer table | ||
| 72 | * @reserved: reserved | ||
| 73 | * | ||
| 74 | * Used to deliver information about the buffer handles that should be | ||
| 75 | * be pinned into (or unpinned from) the PVA address space. | ||
| 76 | * | ||
| 77 | */ | ||
| 78 | struct pva_pin_unpin_args { | ||
| 79 | __u64 buffers; | ||
| 80 | __u32 num_buffers; | ||
| 81 | __u32 reserved; | ||
| 82 | }; | ||
| 83 | |||
| 84 | #define PVA_MAX_PIN_BUFFERS 64 | ||
| 85 | |||
| 86 | /** | ||
| 87 | * struct pva_memory_handle - A handle to PVA pointer | ||
| 88 | * | ||
| 89 | * @handle: Handle to a dmabuf that holds the data | ||
| 90 | * @offset: An offset within the buffer to the data within the buffer | ||
| 91 | */ | ||
| 92 | struct pva_memory_handle { | ||
| 93 | __u32 handle; | ||
| 94 | __u32 offset; | ||
| 95 | }; | ||
| 96 | |||
| 97 | /** | ||
| 98 | * struct pva_ioctl_status_handle - A handle to a status structure | ||
| 99 | * | ||
| 100 | * @handle: Handle to a dmabuf that holds the status buffer | ||
| 101 | * @offset: An offset within the buffer to the status structure. | ||
| 102 | */ | ||
| 103 | struct pva_status_handle { | ||
| 104 | __u32 handle; | ||
| 105 | __u32 offset; | ||
| 106 | }; | ||
| 107 | |||
| 108 | /** | ||
| 109 | * struct pva_ioctl_surface - The surface descriptor | ||
| 110 | * | ||
| 111 | * @format: Surface pixel format | ||
| 112 | * @surface_handle: Memory handle that holds the surface | ||
| 113 | * @surface_offset: Offset within the surface memory buffer to the surface | ||
| 114 | * @roi_handle: Memory handle that holds the ROI | ||
| 115 | * @roi_offset: Offset within the ROI memory buffer to the ROI | ||
| 116 | * @surface_stride: Offset between planes in bytes | ||
| 117 | * @line_stride: Offset between two consequent lines in bytes. | ||
| 118 | * @depth: Number of planes in the surface | ||
| 119 | * @width: Width of the surface | ||
| 120 | * @height: Height of the surface | ||
| 121 | * @layout: Surface layout (pitch linear, block linear) | ||
| 122 | * @block_height_log2: Block height | ||
| 123 | * | ||
| 124 | * This structure defines a list of surfaces to be delivered for | ||
| 125 | * PVA. | ||
| 126 | */ | ||
| 127 | struct pva_surface { | ||
| 128 | __u64 format; | ||
| 129 | __u32 surface_handle; | ||
| 130 | __u32 surface_offset; | ||
| 131 | __u32 roi_handle; | ||
| 132 | __u32 roi_offset; | ||
| 133 | __u32 surface_stride; | ||
| 134 | __u32 line_stride; | ||
| 135 | __u32 depth; | ||
| 136 | __u32 width; | ||
| 137 | __u32 height; | ||
| 138 | __u16 layout; | ||
| 139 | __u16 block_height_log2; | ||
| 140 | }; | ||
| 141 | |||
| 142 | /** | ||
| 143 | * struct pva_ioct_task_parameter - Parameter structure for a task | ||
| 144 | * | ||
| 145 | * @handle: Memory handle including the parameter array. This field shall be | ||
| 146 | * used in cases where the UMD prepares the data in advance to a | ||
| 147 | * shared buffer or the input data is prepared by the upstream engine. | ||
| 148 | * @offset: Offset within the memory handle to the parameter array | ||
| 149 | * | ||
| 150 | * The parameter descriptor defines a single parameter array that is | ||
| 151 | * received. The handle and offset is translated into IOVA by the kernel | ||
| 152 | * driver and delivered to PVA. | ||
| 153 | */ | ||
| 154 | struct pva_task_parameter { | ||
| 155 | __u32 handle; | ||
| 156 | __u32 offset; | ||
| 157 | }; | ||
| 158 | |||
| 159 | /** | ||
| 160 | * struct pva_ioctl_fence structure for passing fence information | ||
| 161 | * | ||
| 162 | * @type: Type of the fence (syncpoint, sync fd or semaphore) | ||
| 163 | * @syncpoint_index: Syncpoint id | ||
| 164 | * @syncpoint_value: Value of syncpoint id | ||
| 165 | * @sync_fd: Linux sync FD handle | ||
| 166 | * @semaphore_handle: File handle to the semaphore memory buffer | ||
| 167 | * @semaphore_offset: Offset to the semaphore within the buffer | ||
| 168 | * @semaphore_value: Value of the semaphore | ||
| 169 | */ | ||
| 170 | struct pva_fence { | ||
| 171 | __u32 type; | ||
| 172 | #define PVA_FENCE_TYPE_SYNCPT 0 | ||
| 173 | #define PVA_FENCE_TYPE_SYNC_FD 1 | ||
| 174 | #define PVA_FENCE_TYPE_SEMAPHORE 2 | ||
| 175 | #define PVA_FENCE_TYPE_SEMAPHORE_TS 3 | ||
| 176 | __u32 syncpoint_index; | ||
| 177 | __u32 syncpoint_value; | ||
| 178 | __u32 sync_fd; | ||
| 179 | __u32 semaphore_handle; | ||
| 180 | __u32 semaphore_offset; | ||
| 181 | __u32 semaphore_value; | ||
| 182 | }; | ||
| 183 | |||
| 184 | #define PVA_MAX_TASKS 1 | ||
| 185 | #define PVA_MAX_PREFENCES 8 | ||
| 186 | #define PVA_MAX_POSTFENCES 8 | ||
| 187 | #define PVA_MAX_INPUT_STATUS 8 | ||
| 188 | #define PVA_MAX_OUTPUT_STATUS 8 | ||
| 189 | #define PVA_MAX_INPUT_SURFACES 8 | ||
| 190 | #define PVA_MAX_OUTPUT_SURFACES 8 | ||
| 191 | #define PVA_MAX_POINTERS 128 | ||
| 192 | #define PVA_MAX_PRIMARY_PAYLOAD_SIZE 4096 | ||
| 193 | |||
| 194 | /** | ||
| 195 | * struct pva_ioctl_submit_task - Describe a task for PVA | ||
| 196 | * | ||
| 197 | * @num_prefences: Number of pre-fences in this task | ||
| 198 | * @num_postfences: Number of post-fences in this task | ||
| 199 | * @num_input_surfaces: Number of input surfaces | ||
| 200 | * @num_output_surfaces: Number of output surfaces | ||
| 201 | * @num_input_task_status: Number of input task status structures | ||
| 202 | * @num_output_task_status: Number of output task status structures | ||
| 203 | * @reserved: Reserved for future usage. | ||
| 204 | * @timeout: Latest Unix time when the task must complete. 0 if disabled. | ||
| 205 | * @prefences: Pointer to pre-fence structures | ||
| 206 | * @postfences: Pointer to post-fence structures | ||
| 207 | * @input_surfaces: Pointer to input surfaces | ||
| 208 | * @input_scalars: Information for input scalars | ||
| 209 | * @output_surfaces: Pointer to output surfaces | ||
| 210 | * @output_scalars: Information for output scalars | ||
| 211 | * @input_task_status: Pointer to input status structure | ||
| 212 | * @output_task_status: Pointer to output status structure | ||
| 213 | * | ||
| 214 | * This structure is used for delivering information that is required to | ||
| 215 | * finish a single task on PVA. | ||
| 216 | * | ||
| 217 | */ | ||
| 218 | struct pva_ioctl_submit_task { | ||
| 219 | __u8 num_prefences; | ||
| 220 | __u8 num_postfences; | ||
| 221 | __u8 num_input_surfaces; | ||
| 222 | __u8 num_output_surfaces; | ||
| 223 | __u8 num_input_task_status; | ||
| 224 | __u8 num_output_task_status; | ||
| 225 | __u16 num_pointers; | ||
| 226 | __u64 pointers; | ||
| 227 | __u32 primary_payload_size; | ||
| 228 | __u32 operation; | ||
| 229 | __u64 timeout; | ||
| 230 | __u64 prefences; | ||
| 231 | __u64 postfences; | ||
| 232 | __u64 input_surfaces; | ||
| 233 | struct pva_task_parameter input_scalars; | ||
| 234 | __u64 primary_payload; | ||
| 235 | u8 reserved0[8]; | ||
| 236 | __u64 output_surfaces; | ||
| 237 | struct pva_task_parameter output_scalars; | ||
| 238 | u8 reserved1[16]; | ||
| 239 | __u64 input_task_status; | ||
| 240 | __u64 output_task_status; | ||
| 241 | }; | ||
| 242 | |||
| 243 | /** | ||
| 244 | * struct pva_submit_args - submit tasks to PVA | ||
| 245 | * | ||
| 246 | * @tasks: Pointer to a list of tasks structures | ||
| 247 | * @flags: Flags for the given tasks | ||
| 248 | * @num_tasks: Number of tasks in the list | ||
| 249 | * @version: Version of the task structure. | ||
| 250 | * | ||
| 251 | * This ioctl is used for submitting tasks to PVA. The given structures | ||
| 252 | * are modified to include information about post-fences. | ||
| 253 | * | ||
| 254 | */ | ||
| 255 | struct pva_ioctl_submit_args { | ||
| 256 | __u64 tasks; | ||
| 257 | __u16 flags; | ||
| 258 | __u16 num_tasks; | ||
| 259 | __u32 version; | ||
| 260 | }; | ||
| 261 | |||
| 262 | /** | ||
| 263 | * struct pva_ioctl_queue_attr - set queue attributes | ||
| 264 | * | ||
| 265 | * @attr_id: Attribute id which defines the attribute to be set | ||
| 266 | * @reserved: reserved | ||
| 267 | * @attr_val: The value to be set for the attribute | ||
| 268 | * | ||
| 269 | * This ioctl is used for setting attributes for a queue with id queue_id | ||
| 270 | * on the R5. | ||
| 271 | * | ||
| 272 | */ | ||
| 273 | struct pva_ioctl_queue_attr { | ||
| 274 | __u16 id; | ||
| 275 | __u16 reserved; | ||
| 276 | __u32 val; | ||
| 277 | }; | ||
| 278 | |||
| 279 | /** | ||
| 280 | * struct pva_ioctl_vpu_func_table - ioctl vpu function table entries | ||
| 281 | * | ||
| 282 | * @addr: Userspace address space to which the function table needs to be copied | ||
| 283 | * @entries: The number of entries in the vpu table | ||
| 284 | * @size: Size of the user buffer passed/ Size of the function table | ||
| 285 | * | ||
| 286 | * This ioctl is used to fetch the VPU function table available on a PVA, which | ||
| 287 | * is copied to user space buffer starting at "addr" with size "size". Once the | ||
| 288 | * function table is copied the the number of entries is updated along with the | ||
| 289 | * size of the vpu function table. | ||
| 290 | * | ||
| 291 | */ | ||
| 292 | struct pva_ioctl_vpu_func_table { | ||
| 293 | __u64 addr; | ||
| 294 | __u32 entries; | ||
| 295 | __u32 size; | ||
| 296 | }; | ||
| 297 | |||
| 298 | #define PVA_IOCTL_CHARACTERISTICS \ | ||
| 299 | _IOWR(NVHOST_PVA_IOCTL_MAGIC, 1, struct pva_characteristics_req) | ||
| 300 | #define PVA_IOCTL_PIN \ | ||
| 301 | _IOW(NVHOST_PVA_IOCTL_MAGIC, 2, struct pva_pin_unpin_args) | ||
| 302 | #define PVA_IOCTL_UNPIN \ | ||
| 303 | _IOW(NVHOST_PVA_IOCTL_MAGIC, 3, struct pva_pin_unpin_args) | ||
| 304 | #define PVA_IOCTL_SUBMIT \ | ||
| 305 | _IOW(NVHOST_PVA_IOCTL_MAGIC, 4, struct pva_ioctl_submit_args) | ||
| 306 | #define PVA_IOCTL_SET_QUEUE_ATTRIBUTES \ | ||
| 307 | _IOW(NVHOST_PVA_IOCTL_MAGIC, 5, struct pva_ioctl_queue_attr) | ||
| 308 | #define PVA_IOCTL_COPY_VPU_FUNCTION_TABLE \ | ||
| 309 | _IOWR(NVHOST_PVA_IOCTL_MAGIC, 6, struct pva_ioctl_vpu_func_table) | ||
| 310 | |||
| 311 | |||
| 312 | #define NVHOST_PVA_IOCTL_LAST _IOC_NR(PVA_IOCTL_COPY_VPU_FUNCTION_TABLE) | ||
| 313 | #define NVHOST_PVA_IOCTL_MAX_ARG_SIZE sizeof(struct pva_characteristics_req) | ||
| 314 | |||
| 315 | #endif /* __LINUX_NVHOST_PVA_IOCTL_H */ | ||
| 316 | |||
diff --git a/include/uapi/linux/tegra_l3_cache.h b/include/uapi/linux/tegra_l3_cache.h new file mode 100644 index 000000000..2ba30ddc6 --- /dev/null +++ b/include/uapi/linux/tegra_l3_cache.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * tegra_l3_cache.h | ||
| 3 | * | ||
| 4 | * declarations for t19x cache | ||
| 5 | * | ||
| 6 | * Copyright (c) 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 | |||
| 18 | #ifndef __TEGRA_L3_CACHE_H | ||
| 19 | #define __TEGRA_L3_CACHE_H | ||
| 20 | |||
| 21 | #include <linux/ioctl.h> | ||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 24 | #define TEGRA_L3_CACHE_IOC_MAGIC 'C' | ||
| 25 | |||
| 26 | #if !defined(__KERNEL__) | ||
| 27 | #define __user | ||
| 28 | #endif | ||
| 29 | |||
| 30 | struct tegra_l3_ioctl_data { | ||
| 31 | __u32 igpu_cpu_ways; /* integrated gpu */ | ||
| 32 | __u32 igpu_only_ways; | ||
| 33 | __u32 total_ways; | ||
| 34 | __u32 reserved; | ||
| 35 | __u64 size; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define TEGRA_L3_CACHE_GET_IOCTL_DATA \ | ||
| 39 | _IOWR(TEGRA_L3_CACHE_IOC_MAGIC, 1, struct tegra_l3_ioctl_data) | ||
| 40 | |||
| 41 | #define TEGRA_L3_CACHE_IOCTL_IOC_MAXNR _IOC_NR(TEGRA_L3_CACHE_GET_IOCTL_DATA) | ||
| 42 | #define TEGRA_L3_CACHE_IOCTL_MAX_ARG_SIZE \ | ||
| 43 | sizeof(struct tegra_l3_ioctl_data) | ||
| 44 | |||
| 45 | #endif /* __TEGRA_L3_CACHE_H */ | ||
