| 1 |
/* |
| 2 |
* Copyright © 2022 Imagination Technologies Ltd. |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 |
* of this software and associated documentation files (the "Software"), to deal |
| 6 |
* in the Software without restriction, including without limitation the rights |
| 7 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 |
* copies of the Software, and to permit persons to whom the Software is |
| 9 |
* furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice (including the next |
| 12 |
* paragraph) shall be included in all copies or substantial portions of the |
| 13 |
* Software. |
| 14 |
* |
| 15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 |
* SOFTWARE. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef PVR_SRV_BRIDGE_H |
| 25 |
#define PVR_SRV_BRIDGE_H |
| 26 |
|
| 27 |
#include <stdbool.h> |
| 28 |
#include <stdint.h> |
| 29 |
|
| 30 |
#include "drm-uapi/drm.h" |
| 31 |
#include "pvr_srv.h" |
| 32 |
#include "pvr_types.h" |
| 33 |
#include "util/macros.h" |
| 34 |
|
| 35 |
/****************************************************************************** |
| 36 |
Services bridges |
| 37 |
******************************************************************************/ |
| 38 |
|
| 39 |
#define PVR_SRV_BRIDGE_SRVCORE 1UL |
| 40 |
|
| 41 |
#define PVR_SRV_BRIDGE_SRVCORE_CONNECT 0UL |
| 42 |
#define PVR_SRV_BRIDGE_SRVCORE_DISCONNECT 1UL |
| 43 |
#define PVR_SRV_BRIDGE_SRVCORE_GETMULTICOREINFO 12U |
| 44 |
|
| 45 |
#define PVR_SRV_BRIDGE_SYNC 2UL |
| 46 |
|
| 47 |
#define PVR_SRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK 0UL |
| 48 |
#define PVR_SRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK 1UL |
| 49 |
#define PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET 2UL |
| 50 |
|
| 51 |
#define PVR_SRV_BRIDGE_MM 6UL |
| 52 |
|
| 53 |
#define PVR_SRV_BRIDGE_MM_PMRUNREFUNLOCKPMR 8UL |
| 54 |
#define PVR_SRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDLOCKEDPMR 10UL |
| 55 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTCTXCREATE 15UL |
| 56 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTCTXDESTROY 16UL |
| 57 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTHEAPCREATE 17UL |
| 58 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY 18UL |
| 59 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTMAPPMR 19UL |
| 60 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTUNMAPPMR 20UL |
| 61 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTRESERVERANGE 21UL |
| 62 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE 22UL |
| 63 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTMAPPAGES 24UL |
| 64 |
#define PVR_SRV_BRIDGE_MM_DEVMEMINTUNMAPPAGES 25UL |
| 65 |
#define PVR_SRV_BRIDGE_MM_HEAPCFGHEAPCOUNT 30UL |
| 66 |
#define PVR_SRV_BRIDGE_MM_HEAPCFGHEAPDETAILS 32UL |
| 67 |
|
| 68 |
#define PVR_SRV_BRIDGE_DMABUF 11UL |
| 69 |
|
| 70 |
#define PVR_SRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF 0UL |
| 71 |
#define PVR_SRV_BRIDGE_DMABUF_PHYSMEMEXPORTDMABUF 2UL |
| 72 |
|
| 73 |
#define PVR_SRV_BRIDGE_RGXTQ 128UL |
| 74 |
|
| 75 |
#define PVR_SRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT 0UL |
| 76 |
#define PVR_SRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT 1UL |
| 77 |
#define PVR_SRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER2 3UL |
| 78 |
|
| 79 |
#define PVR_SRV_BRIDGE_RGXCMP 129UL |
| 80 |
|
| 81 |
#define PVR_SRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT 0UL |
| 82 |
#define PVR_SRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT 1UL |
| 83 |
#define PVR_SRV_BRIDGE_RGXCMP_RGXKICKCDM2 5UL |
| 84 |
|
| 85 |
#define PVR_SRV_BRIDGE_RGXTA3D 130UL |
| 86 |
|
| 87 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATASET 0UL |
| 88 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATASET 1UL |
| 89 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST 6UL |
| 90 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST 7UL |
| 91 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT 8UL |
| 92 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT 9UL |
| 93 |
#define PVR_SRV_BRIDGE_RGXTA3D_RGXKICKTA3D2 12UL |
| 94 |
|
| 95 |
/****************************************************************************** |
| 96 |
DRM Services specific defines |
| 97 |
******************************************************************************/ |
| 98 |
/* DRM command numbers, relative to DRM_COMMAND_BASE. |
| 99 |
* These defines must be prefixed with "DRM_". |
| 100 |
*/ |
| 101 |
#define DRM_SRVKM_CMD 0U /* PVR Services command. */ |
| 102 |
|
| 103 |
/* PVR Sync commands */ |
| 104 |
#define DRM_SRVKM_SYNC_FORCE_SW_ONLY_CMD 2U |
| 105 |
|
| 106 |
/* PVR Software Sync commands */ |
| 107 |
#define DRM_SRVKM_SW_SYNC_CREATE_FENCE_CMD 3U |
| 108 |
#define DRM_SRVKM_SW_SYNC_INC_CMD 4U |
| 109 |
|
| 110 |
/* PVR Services Render Device Init command */ |
| 111 |
#define DRM_SRVKM_INIT 5U /* PVR Services Render Device Init command. */ |
| 112 |
|
| 113 |
/* These defines must be prefixed with "DRM_IOCTL_". */ |
| 114 |
#define DRM_IOCTL_SRVKM_CMD \ |
| 115 |
DRM_IOWR(DRM_COMMAND_BASE + DRM_SRVKM_CMD, struct drm_srvkm_cmd) |
| 116 |
#define DRM_IOCTL_SRVKM_SYNC_FORCE_SW_ONLY_CMD \ |
| 117 |
DRM_IO(DRM_COMMAND_BASE + DRM_SRVKM_SYNC_FORCE_SW_ONLY_CMD) |
| 118 |
#define DRM_IOCTL_SRVKM_SW_SYNC_CREATE_FENCE_CMD \ |
| 119 |
DRM_IOWR(DRM_COMMAND_BASE + DRM_SRVKM_SW_SYNC_CREATE_FENCE_CMD, \ |
| 120 |
struct drm_srvkm_sw_sync_create_fence_data) |
| 121 |
#define DRM_IOCTL_SRVKM_SW_SYNC_INC_CMD \ |
| 122 |
DRM_IOR(DRM_COMMAND_BASE + DRM_SRVKM_SW_SYNC_INC_CMD, \ |
| 123 |
struct drm_srvkm_sw_timeline_advance_data) |
| 124 |
#define DRM_IOCTL_SRVKM_INIT \ |
| 125 |
DRM_IOWR(DRM_COMMAND_BASE + DRM_SRVKM_INIT, struct drm_srvkm_init_data) |
| 126 |
|
| 127 |
/****************************************************************************** |
| 128 |
Misc defines |
| 129 |
******************************************************************************/ |
| 130 |
|
| 131 |
#define SUPPORT_RGX_SET_OFFSET BITFIELD_BIT(4U) |
| 132 |
#define DEBUG_SET_OFFSET BITFIELD_BIT(10U) |
| 133 |
#define SUPPORT_BUFFER_SYNC_SET_OFFSET BITFIELD_BIT(11U) |
| 134 |
#define OPTIONS_BIT31 BITFIELD_BIT(31U) |
| 135 |
|
| 136 |
#define RGX_BUILD_OPTIONS \ |
| 137 |
(SUPPORT_RGX_SET_OFFSET | DEBUG_SET_OFFSET | \ |
| 138 |
SUPPORT_BUFFER_SYNC_SET_OFFSET | OPTIONS_BIT31) |
| 139 |
|
| 140 |
#define PVR_SRV_VERSION_MAJ 1U |
| 141 |
#define PVR_SRV_VERSION_MIN 17U |
| 142 |
|
| 143 |
#define PVR_SRV_VERSION \ |
| 144 |
(((uint32_t)((uint32_t)(PVR_SRV_VERSION_MAJ) & 0xFFFFU) << 16U) | \ |
| 145 |
(((PVR_SRV_VERSION_MIN) & 0xFFFFU) << 0U)) |
| 146 |
|
| 147 |
#define PVR_SRV_VERSION_BUILD 6256262 |
| 148 |
|
| 149 |
/*! This flags gets set if the client is 64 Bit compatible. */ |
| 150 |
#define PVR_SRV_FLAGS_CLIENT_64BIT_COMPAT BITFIELD_BIT(5U) |
| 151 |
|
| 152 |
#define DEVMEM_ANNOTATION_MAX_LEN 64U |
| 153 |
|
| 154 |
#define PVR_SRV_SYNC_MAX 12U |
| 155 |
|
| 156 |
#define PVR_BUFFER_FLAG_READ BITFIELD_BIT(0U) |
| 157 |
#define PVR_BUFFER_FLAG_WRITE BITFIELD_BIT(1U) |
| 158 |
|
| 159 |
/* clang-format off */ |
| 160 |
#define PVR_U8888_TO_U32(v1, v2, v3, v4) \ |
| 161 |
(((v1) & 0xFFU) | (((v2) & 0xFFU) << 8U) | (((v3) & 0xFFU) << 16U) | \ |
| 162 |
(((v4) & 0xFFU) << 24U)) |
| 163 |
/* clang-format on */ |
| 164 |
|
| 165 |
/****************************************************************************** |
| 166 |
Services Boolean |
| 167 |
******************************************************************************/ |
| 168 |
|
| 169 |
enum pvr_srv_bool { |
| 170 |
PVR_SRV_FALSE = 0, |
| 171 |
PVR_SRV_TRUE = 1, |
| 172 |
PVR_SRV_FORCE_ALIGN = 0x7fffffff |
| 173 |
}; |
| 174 |
|
| 175 |
/****************************************************************************** |
| 176 |
Service Error codes |
| 177 |
******************************************************************************/ |
| 178 |
|
| 179 |
enum pvr_srv_error { |
| 180 |
PVR_SRV_OK, |
| 181 |
PVR_SRV_ERROR_RETRY = 25, |
| 182 |
PVR_SRV_ERROR_BRIDGE_CALL_FAILED = 37, |
| 183 |
PVR_SRV_ERROR_FORCE_I32 = 0x7fffffff |
| 184 |
}; |
| 185 |
|
| 186 |
/****************************************************************************** |
| 187 |
PVR_SRV_BRIDGE_SRVCORE_CONNECT structs |
| 188 |
******************************************************************************/ |
| 189 |
|
| 190 |
struct pvr_srv_bridge_connect_cmd { |
| 191 |
uint32_t build_options; |
| 192 |
uint32_t DDK_build; |
| 193 |
uint32_t DDK_version; |
| 194 |
uint32_t flags; |
| 195 |
} PACKED; |
| 196 |
|
| 197 |
struct pvr_srv_bridge_connect_ret { |
| 198 |
uint64_t bvnc; |
| 199 |
enum pvr_srv_error error; |
| 200 |
uint32_t capability_flags; |
| 201 |
uint8_t kernel_arch; |
| 202 |
} PACKED; |
| 203 |
|
| 204 |
/****************************************************************************** |
| 205 |
PVR_SRV_BRIDGE_SRVCORE_DISCONNECT struct |
| 206 |
******************************************************************************/ |
| 207 |
|
| 208 |
struct pvr_srv_bridge_disconnect_ret { |
| 209 |
enum pvr_srv_error error; |
| 210 |
} PACKED; |
| 211 |
|
| 212 |
/****************************************************************************** |
| 213 |
PVR_SRV_BRIDGE_SRVCORE_GETMULTICOREINFO structs |
| 214 |
******************************************************************************/ |
| 215 |
|
| 216 |
struct pvr_srv_bridge_getmulticoreinfo_cmd { |
| 217 |
uint64_t *caps; |
| 218 |
uint32_t caps_size; |
| 219 |
} PACKED; |
| 220 |
|
| 221 |
struct pvr_srv_bridge_getmulticoreinfo_ret { |
| 222 |
uint64_t *caps; |
| 223 |
enum pvr_srv_error error; |
| 224 |
uint32_t num_cores; |
| 225 |
} PACKED; |
| 226 |
|
| 227 |
/****************************************************************************** |
| 228 |
PVR_SRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK struct |
| 229 |
******************************************************************************/ |
| 230 |
|
| 231 |
struct pvr_srv_bridge_alloc_sync_primitive_block_ret { |
| 232 |
void *handle; |
| 233 |
void *pmr; |
| 234 |
enum pvr_srv_error error; |
| 235 |
uint32_t size; |
| 236 |
uint32_t addr; |
| 237 |
} PACKED; |
| 238 |
|
| 239 |
/****************************************************************************** |
| 240 |
PVR_SRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK structs |
| 241 |
******************************************************************************/ |
| 242 |
|
| 243 |
struct pvr_srv_bridge_free_sync_primitive_block_cmd { |
| 244 |
void *handle; |
| 245 |
} PACKED; |
| 246 |
|
| 247 |
struct pvr_srv_bridge_free_sync_primitive_block_ret { |
| 248 |
enum pvr_srv_error error; |
| 249 |
} PACKED; |
| 250 |
|
| 251 |
/****************************************************************************** |
| 252 |
PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET structs |
| 253 |
******************************************************************************/ |
| 254 |
|
| 255 |
struct pvr_srv_bridge_sync_prim_set_cmd { |
| 256 |
void *handle; |
| 257 |
uint32_t index; |
| 258 |
uint32_t value; |
| 259 |
} PACKED; |
| 260 |
|
| 261 |
struct pvr_srv_bridge_sync_prim_set_ret { |
| 262 |
enum pvr_srv_error error; |
| 263 |
} PACKED; |
| 264 |
|
| 265 |
/****************************************************************************** |
| 266 |
PVR_SRV_BRIDGE_MM_DEVMEMINTCTXCREATE structs |
| 267 |
******************************************************************************/ |
| 268 |
|
| 269 |
struct pvr_srv_devmem_int_ctx_create_cmd { |
| 270 |
uint32_t kernel_memory_ctx; |
| 271 |
} PACKED; |
| 272 |
|
| 273 |
struct pvr_srv_devmem_int_ctx_create_ret { |
| 274 |
void *server_memctx; |
| 275 |
void *server_memctx_data; |
| 276 |
enum pvr_srv_error error; |
| 277 |
uint32_t cpu_cache_line_size; |
| 278 |
} PACKED; |
| 279 |
|
| 280 |
/****************************************************************************** |
| 281 |
PVR_SRV_BRIDGE_MM_DEVMEMINTCTXDESTROY structs |
| 282 |
******************************************************************************/ |
| 283 |
|
| 284 |
struct pvr_srv_devmem_int_ctx_destroy_cmd { |
| 285 |
void *server_memctx; |
| 286 |
} PACKED; |
| 287 |
|
| 288 |
struct pvr_srv_devmem_int_ctx_destroy_ret { |
| 289 |
enum pvr_srv_error error; |
| 290 |
} PACKED; |
| 291 |
|
| 292 |
/****************************************************************************** |
| 293 |
PVR_SRV_BRIDGE_MM_HEAPCFGHEAPCOUNT structs |
| 294 |
******************************************************************************/ |
| 295 |
|
| 296 |
struct pvr_srv_heap_count_cmd { |
| 297 |
uint32_t heap_config_index; |
| 298 |
} PACKED; |
| 299 |
|
| 300 |
struct pvr_srv_heap_count_ret { |
| 301 |
enum pvr_srv_error error; |
| 302 |
uint32_t heap_count; |
| 303 |
} PACKED; |
| 304 |
|
| 305 |
/****************************************************************************** |
| 306 |
PVR_SRV_BRIDGE_MM_HEAPCFGHEAPDETAILS structs |
| 307 |
******************************************************************************/ |
| 308 |
|
| 309 |
struct pvr_srv_heap_cfg_details_cmd { |
| 310 |
char *buffer; |
| 311 |
uint32_t heap_config_index; |
| 312 |
uint32_t heap_index; |
| 313 |
uint32_t buffer_size; |
| 314 |
} PACKED; |
| 315 |
|
| 316 |
struct pvr_srv_heap_cfg_details_ret { |
| 317 |
pvr_dev_addr_t base_addr; |
| 318 |
uint64_t size; |
| 319 |
uint64_t reserved_size; |
| 320 |
char *buffer; |
| 321 |
enum pvr_srv_error error; |
| 322 |
uint32_t log2_page_size; |
| 323 |
uint32_t log2_alignment; |
| 324 |
} PACKED; |
| 325 |
|
| 326 |
/****************************************************************************** |
| 327 |
PVR_SRV_BRIDGE_MM_DEVMEMINTHEAPCREATE structs |
| 328 |
******************************************************************************/ |
| 329 |
|
| 330 |
struct pvr_srv_devmem_int_heap_create_cmd { |
| 331 |
pvr_dev_addr_t base_addr; |
| 332 |
uint64_t size; |
| 333 |
void *server_memctx; |
| 334 |
uint32_t log2_page_size; |
| 335 |
} PACKED; |
| 336 |
|
| 337 |
struct pvr_srv_devmem_int_heap_create_ret { |
| 338 |
void *server_heap; |
| 339 |
enum pvr_srv_error error; |
| 340 |
} PACKED; |
| 341 |
|
| 342 |
/****************************************************************************** |
| 343 |
PVR_SRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY structs |
| 344 |
******************************************************************************/ |
| 345 |
|
| 346 |
struct pvr_srv_devmem_int_heap_destroy_cmd { |
| 347 |
void *server_heap; |
| 348 |
} PACKED; |
| 349 |
|
| 350 |
struct pvr_srv_devmem_int_heap_destroy_ret { |
| 351 |
enum pvr_srv_error error; |
| 352 |
} PACKED; |
| 353 |
|
| 354 |
/****************************************************************************** |
| 355 |
PVR_SRV_BRIDGE_MM_DEVMEMINTRESERVERANGE structs |
| 356 |
******************************************************************************/ |
| 357 |
|
| 358 |
struct pvr_srv_devmem_int_reserve_range_cmd { |
| 359 |
pvr_dev_addr_t addr; |
| 360 |
uint64_t size; |
| 361 |
void *server_heap; |
| 362 |
} PACKED; |
| 363 |
|
| 364 |
struct pvr_srv_devmem_int_reserve_range_ret { |
| 365 |
void *reservation; |
| 366 |
enum pvr_srv_error error; |
| 367 |
} PACKED; |
| 368 |
|
| 369 |
/****************************************************************************** |
| 370 |
PVR_SRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE structs |
| 371 |
******************************************************************************/ |
| 372 |
|
| 373 |
struct pvr_srv_bridge_in_devmem_int_unreserve_range_cmd { |
| 374 |
void *reservation; |
| 375 |
} PACKED; |
| 376 |
|
| 377 |
struct pvr_srv_bridge_in_devmem_int_unreserve_range_ret { |
| 378 |
enum pvr_srv_error error; |
| 379 |
} PACKED; |
| 380 |
|
| 381 |
/****************************************************************************** |
| 382 |
PVR_SRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDLOCKEDPMR structs |
| 383 |
******************************************************************************/ |
| 384 |
|
| 385 |
struct pvr_srv_physmem_new_ram_backed_locked_pmr_cmd { |
| 386 |
uint64_t block_size; |
| 387 |
uint64_t size; |
| 388 |
uint32_t *mapping_table; |
| 389 |
const char *annotation; |
| 390 |
uint32_t annotation_size; |
| 391 |
uint32_t log2_page_size; |
| 392 |
uint32_t phy_blocks; |
| 393 |
uint32_t virt_blocks; |
| 394 |
uint32_t pdump_flags; |
| 395 |
uint32_t pid; |
| 396 |
uint64_t flags; |
| 397 |
} PACKED; |
| 398 |
|
| 399 |
struct pvr_srv_physmem_new_ram_backed_locked_pmr_ret { |
| 400 |
void *pmr; |
| 401 |
enum pvr_srv_error error; |
| 402 |
uint64_t out_flags; |
| 403 |
} PACKED; |
| 404 |
|
| 405 |
/****************************************************************************** |
| 406 |
PVR_SRV_BRIDGE_MM_PMRUNREFUNLOCKPMR structs |
| 407 |
******************************************************************************/ |
| 408 |
|
| 409 |
struct pvr_srv_pmr_unref_unlock_pmr_cmd { |
| 410 |
void *pmr; |
| 411 |
} PACKED; |
| 412 |
|
| 413 |
struct pvr_srv_pmr_unref_unlock_pmr_ret { |
| 414 |
enum pvr_srv_error error; |
| 415 |
} PACKED; |
| 416 |
|
| 417 |
/****************************************************************************** |
| 418 |
PVR_SRV_BRIDGE_MM_DEVMEMINTMAPPAGES structs |
| 419 |
******************************************************************************/ |
| 420 |
|
| 421 |
struct pvr_srv_devmem_int_map_pages_cmd { |
| 422 |
pvr_dev_addr_t addr; |
| 423 |
void *pmr; |
| 424 |
void *reservation; |
| 425 |
uint32_t page_count; |
| 426 |
uint32_t page_offset; |
| 427 |
uint64_t flags; |
| 428 |
} PACKED; |
| 429 |
|
| 430 |
struct pvr_srv_devmem_int_map_pages_ret { |
| 431 |
enum pvr_srv_error error; |
| 432 |
} PACKED; |
| 433 |
|
| 434 |
/****************************************************************************** |
| 435 |
PVR_SRV_BRIDGE_MM_DEVMEMINTUNMAPPAGES structs |
| 436 |
******************************************************************************/ |
| 437 |
|
| 438 |
struct pvr_srv_devmem_int_unmap_pages_cmd { |
| 439 |
pvr_dev_addr_t dev_addr; |
| 440 |
void *reservation; |
| 441 |
uint32_t page_count; |
| 442 |
} PACKED; |
| 443 |
|
| 444 |
struct pvr_srv_devmem_int_unmap_pages_ret { |
| 445 |
enum pvr_srv_error error; |
| 446 |
} PACKED; |
| 447 |
|
| 448 |
/****************************************************************************** |
| 449 |
PVR_SRV_BRIDGE_MM_DEVMEMINTMAPPMR structs |
| 450 |
******************************************************************************/ |
| 451 |
|
| 452 |
struct pvr_srv_devmem_int_map_pmr_cmd { |
| 453 |
void *server_heap; |
| 454 |
void *pmr; |
| 455 |
void *reservation; |
| 456 |
uint64_t flags; |
| 457 |
} PACKED; |
| 458 |
|
| 459 |
struct pvr_srv_devmem_int_map_pmr_ret { |
| 460 |
void *mapping; |
| 461 |
enum pvr_srv_error error; |
| 462 |
} PACKED; |
| 463 |
|
| 464 |
/****************************************************************************** |
| 465 |
PVR_SRV_BRIDGE_MM_DEVMEMINTUNMAPPMR structs |
| 466 |
******************************************************************************/ |
| 467 |
|
| 468 |
struct pvr_srv_devmem_int_unmap_pmr_cmd { |
| 469 |
void *mapping; |
| 470 |
} PACKED; |
| 471 |
|
| 472 |
struct pvr_srv_devmem_int_unmap_pmr_ret { |
| 473 |
enum pvr_srv_error error; |
| 474 |
} PACKED; |
| 475 |
|
| 476 |
/****************************************************************************** |
| 477 |
PVR_SRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF structs |
| 478 |
******************************************************************************/ |
| 479 |
|
| 480 |
struct pvr_srv_phys_mem_import_dmabuf_cmd { |
| 481 |
const char *name; |
| 482 |
int buffer_fd; |
| 483 |
uint32_t name_size; |
| 484 |
uint64_t flags; |
| 485 |
} PACKED; |
| 486 |
|
| 487 |
struct pvr_srv_phys_mem_import_dmabuf_ret { |
| 488 |
uint64_t align; |
| 489 |
uint64_t size; |
| 490 |
void *pmr; |
| 491 |
enum pvr_srv_error error; |
| 492 |
} PACKED; |
| 493 |
|
| 494 |
/****************************************************************************** |
| 495 |
PVR_SRV_BRIDGE_DMABUF_PHYSMEMEXPORTDMABUF structs |
| 496 |
******************************************************************************/ |
| 497 |
|
| 498 |
struct pvr_srv_phys_mem_export_dmabuf_cmd { |
| 499 |
void *pmr; |
| 500 |
} PACKED; |
| 501 |
|
| 502 |
struct pvr_srv_phys_mem_export_dmabuf_ret { |
| 503 |
enum pvr_srv_error error; |
| 504 |
int fd; |
| 505 |
} PACKED; |
| 506 |
|
| 507 |
/****************************************************************************** |
| 508 |
PVR_SRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT structs |
| 509 |
******************************************************************************/ |
| 510 |
|
| 511 |
struct pvr_srv_rgx_create_transfer_context_cmd { |
| 512 |
uint64_t robustness_address; |
| 513 |
void *priv_data; |
| 514 |
uint8_t *reset_framework_cmd; |
| 515 |
uint32_t context_flags; |
| 516 |
uint32_t reset_framework_cmd_size; |
| 517 |
uint32_t packed_ccb_size_u8888; |
| 518 |
uint32_t priority; |
| 519 |
} PACKED; |
| 520 |
|
| 521 |
struct pvr_srv_rgx_create_transfer_context_ret { |
| 522 |
void *cli_pmr_mem; |
| 523 |
void *transfer_context; |
| 524 |
void *usc_pmr_mem; |
| 525 |
enum pvr_srv_error error; |
| 526 |
} PACKED; |
| 527 |
|
| 528 |
/****************************************************************************** |
| 529 |
PVR_SRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT structs |
| 530 |
******************************************************************************/ |
| 531 |
|
| 532 |
struct pvr_srv_rgx_destroy_transfer_context_cmd { |
| 533 |
void *transfer_context; |
| 534 |
} PACKED; |
| 535 |
|
| 536 |
struct pvr_srv_rgx_destroy_transfer_context_ret { |
| 537 |
enum pvr_srv_error error; |
| 538 |
} PACKED; |
| 539 |
|
| 540 |
/****************************************************************************** |
| 541 |
PVR_SRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER2 structs |
| 542 |
******************************************************************************/ |
| 543 |
|
| 544 |
struct pvr_srv_rgx_submit_transfer2_cmd { |
| 545 |
void *transfer_context; |
| 546 |
uint32_t *client_update_count; |
| 547 |
uint32_t *cmd_size; |
| 548 |
uint32_t *sync_pmr_flags; |
| 549 |
uint32_t *tq_prepare_flags; |
| 550 |
uint32_t **update_sync_offset; |
| 551 |
uint32_t **update_value; |
| 552 |
uint8_t **fw_command; |
| 553 |
char *update_fence_name; |
| 554 |
void **sync_pmrs; |
| 555 |
void ***update_ufo_sync_prim_block; |
| 556 |
int32_t update_timeline_2d; |
| 557 |
int32_t update_timeline_3d; |
| 558 |
int32_t check_fence; |
| 559 |
uint32_t ext_job_ref; |
| 560 |
uint32_t prepare_count; |
| 561 |
uint32_t sync_pmr_count; |
| 562 |
} PACKED; |
| 563 |
|
| 564 |
struct pvr_srv_rgx_submit_transfer2_ret { |
| 565 |
enum pvr_srv_error error; |
| 566 |
int32_t update_fence_2d; |
| 567 |
int32_t update_fence_3d; |
| 568 |
} PACKED; |
| 569 |
|
| 570 |
/****************************************************************************** |
| 571 |
PVR_SRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT structs |
| 572 |
******************************************************************************/ |
| 573 |
|
| 574 |
struct pvr_srv_rgx_create_compute_context_cmd { |
| 575 |
uint64_t robustness_address; |
| 576 |
void *priv_data; |
| 577 |
uint8_t *reset_framework_cmd; |
| 578 |
uint8_t *static_compute_context_state; |
| 579 |
uint32_t context_flags; |
| 580 |
uint32_t reset_framework_cmd_size; |
| 581 |
uint32_t max_deadline_ms; |
| 582 |
uint32_t packed_ccb_size; |
| 583 |
/* RGX_CONTEXT_PRIORITY_... flags. */ |
| 584 |
uint32_t priority; |
| 585 |
uint32_t static_compute_context_state_size; |
| 586 |
} PACKED; |
| 587 |
|
| 588 |
struct pvr_srv_rgx_create_compute_context_ret { |
| 589 |
void *compute_context; |
| 590 |
enum pvr_srv_error error; |
| 591 |
} PACKED; |
| 592 |
|
| 593 |
/****************************************************************************** |
| 594 |
PVR_SRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT structs |
| 595 |
******************************************************************************/ |
| 596 |
|
| 597 |
struct pvr_srv_rgx_destroy_compute_context_cmd { |
| 598 |
void *compute_context; |
| 599 |
} PACKED; |
| 600 |
|
| 601 |
struct pvr_srv_rgx_destroy_compute_context_ret { |
| 602 |
enum pvr_srv_error error; |
| 603 |
} PACKED; |
| 604 |
|
| 605 |
/****************************************************************************** |
| 606 |
PVR_SRV_BRIDGE_RGXCMP_RGXKICKCDM2 structs |
| 607 |
******************************************************************************/ |
| 608 |
|
| 609 |
struct pvr_srv_rgx_kick_cdm2_cmd { |
| 610 |
uint64_t max_deadline_us; |
| 611 |
void *compute_context; |
| 612 |
uint32_t *client_update_offset; |
| 613 |
uint32_t *client_update_value; |
| 614 |
uint32_t *sync_pmr_flags; |
| 615 |
uint8_t *cdm_cmd; |
| 616 |
char *update_fence_name; |
| 617 |
void **client_update_ufo_sync_prim_block; |
| 618 |
void **sync_pmrs; |
| 619 |
int32_t check_fence; |
| 620 |
int32_t update_timeline; |
| 621 |
uint32_t client_update_count; |
| 622 |
uint32_t cmd_size; |
| 623 |
uint32_t ext_job_ref; |
| 624 |
uint32_t num_work_groups; |
| 625 |
uint32_t num_work_items; |
| 626 |
uint32_t pdump_flags; |
| 627 |
uint32_t sync_pmr_count; |
| 628 |
} PACKED; |
| 629 |
|
| 630 |
struct pvr_srv_rgx_kick_cdm2_ret { |
| 631 |
enum pvr_srv_error error; |
| 632 |
int32_t update_fence; |
| 633 |
} PACKED; |
| 634 |
|
| 635 |
/****************************************************************************** |
| 636 |
PVR_SRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATASET structs |
| 637 |
******************************************************************************/ |
| 638 |
|
| 639 |
struct pvr_srv_rgx_create_hwrt_dataset_cmd { |
| 640 |
uint64_t flipped_multi_sample_ctl; |
| 641 |
uint64_t multi_sample_ctl; |
| 642 |
/* ROGUE_FWIF_NUM_RTDATAS sized array. */ |
| 643 |
const pvr_dev_addr_t *macrotile_array_dev_addrs; |
| 644 |
/* ROGUE_FWIF_NUM_RTDATAS sized array. */ |
| 645 |
const pvr_dev_addr_t *pm_mlist_dev_addrs; |
| 646 |
/* ROGUE_FWIF_NUM_GEOMDATAS sized array. */ |
| 647 |
const pvr_dev_addr_t *rtc_dev_addrs; |
| 648 |
/* ROGUE_FWIF_NUM_RTDATAS sized array. */ |
| 649 |
const pvr_dev_addr_t *rgn_header_dev_addrs; |
| 650 |
/* ROGUE_FWIF_NUM_GEOMDATAS sized array. */ |
| 651 |
const pvr_dev_addr_t *tail_ptrs_dev_addrs; |
| 652 |
/* ROGUE_FWIF_NUM_GEOMDATAS sized array. */ |
| 653 |
const pvr_dev_addr_t *vheap_table_dev_adds; |
| 654 |
/* ROGUE_FWIF_NUM_RTDATAS sized array of handles. */ |
| 655 |
void **hwrt_dataset; |
| 656 |
/* ROGUE_FW_MAX_FREELISTS size array of handles. */ |
| 657 |
void **free_lists; |
| 658 |
uint32_t isp_merge_lower_x; |
| 659 |
uint32_t isp_merge_lower_y; |
| 660 |
uint32_t isp_merge_scale_x; |
| 661 |
uint32_t isp_merge_scale_y; |
| 662 |
uint32_t isp_merge_upper_x; |
| 663 |
uint32_t isp_merge_upper_y; |
| 664 |
uint32_t isp_mtile_size; |
| 665 |
uint32_t mtile_stride; |
| 666 |
uint32_t ppp_screen; |
| 667 |
uint32_t rgn_header_size; |
| 668 |
uint32_t te_aa; |
| 669 |
uint32_t te_mtile1; |
| 670 |
uint32_t te_mtile2; |
| 671 |
uint32_t te_screen; |
| 672 |
uint32_t tpc_size; |
| 673 |
uint32_t tpc_stride; |
| 674 |
uint16_t max_rts; |
| 675 |
} PACKED; |
| 676 |
|
| 677 |
struct pvr_srv_rgx_create_hwrt_dataset_ret { |
| 678 |
/* ROGUE_FWIF_NUM_RTDATAS sized array of handles. */ |
| 679 |
void **hwrt_dataset; |
| 680 |
enum pvr_srv_error error; |
| 681 |
} PACKED; |
| 682 |
|
| 683 |
/****************************************************************************** |
| 684 |
PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATASET structs |
| 685 |
******************************************************************************/ |
| 686 |
|
| 687 |
struct pvr_srv_rgx_destroy_hwrt_dataset_cmd { |
| 688 |
void *hwrt_dataset; |
| 689 |
} PACKED; |
| 690 |
|
| 691 |
struct pvr_srv_rgx_destroy_hwrt_dataset_ret { |
| 692 |
enum pvr_srv_error error; |
| 693 |
} PACKED; |
| 694 |
|
| 695 |
/****************************************************************************** |
| 696 |
PVR_SRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST structs |
| 697 |
******************************************************************************/ |
| 698 |
|
| 699 |
struct pvr_srv_rgx_create_free_list_cmd { |
| 700 |
pvr_dev_addr_t free_list_dev_addr; |
| 701 |
uint64_t pmr_offset; |
| 702 |
void *mem_ctx_priv_data; |
| 703 |
void *free_list_pmr; |
| 704 |
void *global_free_list; |
| 705 |
enum pvr_srv_bool free_list_check; |
| 706 |
uint32_t grow_free_list_pages; |
| 707 |
uint32_t grow_param_threshold; |
| 708 |
uint32_t init_free_list_pages; |
| 709 |
uint32_t max_free_list_pages; |
| 710 |
} PACKED; |
| 711 |
|
| 712 |
struct pvr_srv_rgx_create_free_list_ret { |
| 713 |
void *cleanup_cookie; |
| 714 |
enum pvr_srv_error error; |
| 715 |
} PACKED; |
| 716 |
|
| 717 |
/****************************************************************************** |
| 718 |
PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST structs |
| 719 |
******************************************************************************/ |
| 720 |
|
| 721 |
struct pvr_srv_rgx_destroy_free_list_cmd { |
| 722 |
void *cleanup_cookie; |
| 723 |
} PACKED; |
| 724 |
|
| 725 |
struct pvr_srv_rgx_destroy_free_list_ret { |
| 726 |
enum pvr_srv_error error; |
| 727 |
} PACKED; |
| 728 |
|
| 729 |
/****************************************************************************** |
| 730 |
PVR_SRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT structs |
| 731 |
******************************************************************************/ |
| 732 |
|
| 733 |
struct pvr_srv_rgx_create_render_context_cmd { |
| 734 |
pvr_dev_addr_t vdm_callstack_addr; |
| 735 |
uint64_t robustness_address; |
| 736 |
void *priv_data; |
| 737 |
uint8_t *reset_framework_cmd; |
| 738 |
uint8_t *static_render_context_state; |
| 739 |
#define RGX_CONTEXT_FLAG_DISABLESLR BITFIELD_BIT(0U) |
| 740 |
uint32_t context_flags; |
| 741 |
uint32_t reset_framework_cmd_size; |
| 742 |
uint32_t max_3d_deadline_ms; |
| 743 |
uint32_t max_ta_deadline_ms; |
| 744 |
uint32_t packed_ccb_size; |
| 745 |
#define RGX_CONTEXT_PRIORITY_REALTIME UINT32_MAX |
| 746 |
#define RGX_CONTEXT_PRIORITY_HIGH 2U |
| 747 |
#define RGX_CONTEXT_PRIORITY_MEDIUM 1U |
| 748 |
#define RGX_CONTEXT_PRIORITY_LOW 0U |
| 749 |
uint32_t priority; |
| 750 |
uint32_t static_render_context_state_size; |
| 751 |
uint32_t call_stack_depth; |
| 752 |
} PACKED; |
| 753 |
|
| 754 |
struct pvr_srv_rgx_create_render_context_ret { |
| 755 |
void *render_context; |
| 756 |
enum pvr_srv_error error; |
| 757 |
} PACKED; |
| 758 |
|
| 759 |
/****************************************************************************** |
| 760 |
PVR_SRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT structs |
| 761 |
******************************************************************************/ |
| 762 |
|
| 763 |
struct pvr_srv_rgx_destroy_render_context_cmd { |
| 764 |
void *render_context; |
| 765 |
} PACKED; |
| 766 |
|
| 767 |
struct pvr_srv_rgx_destroy_render_context_ret { |
| 768 |
enum pvr_srv_error error; |
| 769 |
} PACKED; |
| 770 |
|
| 771 |
/****************************************************************************** |
| 772 |
PVR_SRV_BRIDGE_RGXTA3D_RGXKICKTA3D2 structs |
| 773 |
******************************************************************************/ |
| 774 |
|
| 775 |
struct pvr_srv_rgx_kick_ta3d2_cmd { |
| 776 |
uint64_t deadline; |
| 777 |
void *hw_rt_dataset; |
| 778 |
void *msaa_scratch_buffer; |
| 779 |
void *pr_fence_ufo_sync_prim_block; |
| 780 |
void *render_ctx; |
| 781 |
void *zs_buffer; |
| 782 |
uint32_t *client_3d_update_sync_offset; |
| 783 |
uint32_t *client_3d_update_value; |
| 784 |
uint32_t *client_ta_fence_sync_offset; |
| 785 |
uint32_t *client_ta_fence_value; |
| 786 |
uint32_t *client_ta_update_sync_offset; |
| 787 |
uint32_t *client_ta_update_value; |
| 788 |
uint32_t *sync_pmr_flags; |
| 789 |
uint8_t *cmd_3d; |
| 790 |
uint8_t *cmd_3d_pr; |
| 791 |
uint8_t *cmd_ta; |
| 792 |
char *update_fence_name; |
| 793 |
char *update_fence_name_3d; |
| 794 |
void **client_3d_update_sync_prim_block; |
| 795 |
void **client_ta_fence_sync_prim_block; |
| 796 |
void **client_ta_update_sync_prim_block; |
| 797 |
void **sync_pmrs; |
| 798 |
enum pvr_srv_bool abort; |
| 799 |
enum pvr_srv_bool kick_3d; |
| 800 |
enum pvr_srv_bool kick_pr; |
| 801 |
enum pvr_srv_bool kick_ta; |
| 802 |
int32_t check_fence; |
| 803 |
int32_t check_fence_3d; |
| 804 |
int32_t update_timeline; |
| 805 |
int32_t update_timeline_3d; |
| 806 |
uint32_t cmd_3d_size; |
| 807 |
uint32_t cmd_3d_pr_size; |
| 808 |
uint32_t client_3d_update_count; |
| 809 |
uint32_t client_ta_fence_count; |
| 810 |
uint32_t client_ta_update_count; |
| 811 |
uint32_t ext_job_ref; |
| 812 |
uint32_t num_draw_calls; |
| 813 |
uint32_t num_indices; |
| 814 |
uint32_t num_mrts; |
| 815 |
uint32_t pdump_flags; |
| 816 |
uint32_t client_pr_fence_ufo_sync_offset; |
| 817 |
uint32_t client_pr_fence_value; |
| 818 |
uint32_t render_target_size; |
| 819 |
uint32_t sync_pmr_count; |
| 820 |
uint32_t cmd_ta_size; |
| 821 |
} PACKED; |
| 822 |
|
| 823 |
struct pvr_srv_rgx_kick_ta3d2_ret { |
| 824 |
enum pvr_srv_error error; |
| 825 |
int32_t update_fence; |
| 826 |
int32_t update_fence_3d; |
| 827 |
} PACKED; |
| 828 |
|
| 829 |
/****************************************************************************** |
| 830 |
Ioctl structures |
| 831 |
******************************************************************************/ |
| 832 |
|
| 833 |
/* Ioctl to pass cmd and ret structures. */ |
| 834 |
struct drm_srvkm_cmd { |
| 835 |
uint32_t bridge_id; |
| 836 |
uint32_t bridge_func_id; |
| 837 |
uint64_t in_data_ptr; |
| 838 |
uint64_t out_data_ptr; |
| 839 |
uint32_t in_data_size; |
| 840 |
uint32_t out_data_size; |
| 841 |
}; |
| 842 |
|
| 843 |
/* Ioctl to initialize a module. */ |
| 844 |
struct drm_srvkm_init_data { |
| 845 |
#define PVR_SRVKM_SERVICES_INIT 1U |
| 846 |
#define PVR_SRVKM_SYNC_INIT 2U |
| 847 |
uint32_t init_module; |
| 848 |
}; |
| 849 |
|
| 850 |
struct drm_srvkm_sw_sync_create_fence_data { |
| 851 |
char name[32]; |
| 852 |
__s32 fence; |
| 853 |
__u32 pad; |
| 854 |
__u64 sync_pt_idx; |
| 855 |
}; |
| 856 |
|
| 857 |
struct drm_srvkm_sw_timeline_advance_data { |
| 858 |
__u64 sync_pt_idx; |
| 859 |
}; |
| 860 |
|
| 861 |
/****************************************************************************** |
| 862 |
DRM helper enum |
| 863 |
******************************************************************************/ |
| 864 |
|
| 865 |
enum pvr_srvkm_module_type { |
| 866 |
PVR_SRVKM_MODULE_TYPE_SERVICES = PVR_SRVKM_SERVICES_INIT, |
| 867 |
PVR_SRVKM_MODULE_TYPE_SYNC = PVR_SRVKM_SYNC_INIT, |
| 868 |
}; |
| 869 |
|
| 870 |
/****************************************************************************** |
| 871 |
Ioctl function prototypes |
| 872 |
******************************************************************************/ |
| 873 |
|
| 874 |
VkResult pvr_srv_init_module(int fd, enum pvr_srvkm_module_type module); |
| 875 |
|
| 876 |
VkResult pvr_srv_set_timeline_sw_only(int sw_timeline_fd); |
| 877 |
|
| 878 |
VkResult pvr_srv_create_sw_fence(int sw_timeline_fd, |
| 879 |
int *new_fence_fd, |
| 880 |
uint64_t *sync_pt_idx); |
| 881 |
|
| 882 |
VkResult pvr_srv_sw_sync_timeline_increment(int sw_timeline_fd, |
| 883 |
uint64_t *sync_pt_idx); |
| 884 |
|
| 885 |
/****************************************************************************** |
| 886 |
Bridge function prototypes |
| 887 |
******************************************************************************/ |
| 888 |
|
| 889 |
VkResult pvr_srv_connection_create(int fd, uint64_t *const bvnc_out); |
| 890 |
void pvr_srv_connection_destroy(int fd); |
| 891 |
|
| 892 |
VkResult pvr_srv_get_multicore_info(int fd, |
| 893 |
uint32_t caps_size, |
| 894 |
uint64_t *caps, |
| 895 |
uint32_t *num_cores); |
| 896 |
|
| 897 |
VkResult pvr_srv_alloc_sync_primitive_block(int fd, |
| 898 |
void **const handle_out, |
| 899 |
void **const pmr_out, |
| 900 |
uint32_t *const size_out, |
| 901 |
uint32_t *const addr_out); |
| 902 |
void pvr_srv_free_sync_primitive_block(int fd, void *handle); |
| 903 |
VkResult pvr_srv_set_sync_primitive(int fd, |
| 904 |
void *handle, |
| 905 |
uint32_t index, |
| 906 |
uint32_t value); |
| 907 |
|
| 908 |
VkResult pvr_srv_get_heap_count(int fd, uint32_t *const heap_count_out); |
| 909 |
VkResult pvr_srv_get_heap_details(int fd, |
| 910 |
uint32_t heap_index, |
| 911 |
uint32_t buffer_size, |
| 912 |
char *const buffer_out, |
| 913 |
pvr_dev_addr_t *const base_address_out, |
| 914 |
uint64_t *const size_out, |
| 915 |
uint64_t *const reserved_size_out, |
| 916 |
uint32_t *const log2_page_size_out); |
| 917 |
|
| 918 |
VkResult pvr_srv_int_heap_create(int fd, |
| 919 |
pvr_dev_addr_t base_address, |
| 920 |
uint64_t size, |
| 921 |
uint32_t log2_page_size, |
| 922 |
void *server_memctx, |
| 923 |
void **const server_heap_out); |
| 924 |
void pvr_srv_int_heap_destroy(int fd, void *server_heap); |
| 925 |
|
| 926 |
VkResult pvr_srv_int_ctx_create(int fd, |
| 927 |
void **const server_memctx_out, |
| 928 |
void **const server_memctx_data_out); |
| 929 |
void pvr_srv_int_ctx_destroy(int fd, void *server_memctx); |
| 930 |
|
| 931 |
VkResult pvr_srv_int_reserve_addr(int fd, |
| 932 |
void *server_heap, |
| 933 |
pvr_dev_addr_t addr, |
| 934 |
uint64_t size, |
| 935 |
void **const reservation_out); |
| 936 |
void pvr_srv_int_unreserve_addr(int fd, void *reservation); |
| 937 |
|
| 938 |
VkResult pvr_srv_alloc_pmr(int fd, |
| 939 |
uint64_t size, |
| 940 |
uint64_t block_size, |
| 941 |
uint32_t phy_blocks, |
| 942 |
uint32_t virt_blocks, |
| 943 |
uint32_t log2_page_size, |
| 944 |
uint64_t flags, |
| 945 |
uint32_t pid, |
| 946 |
void **const pmr_out); |
| 947 |
void pvr_srv_free_pmr(int fd, void *pmr); |
| 948 |
|
| 949 |
VkResult pvr_srv_int_map_pages(int fd, |
| 950 |
void *reservation, |
| 951 |
void *pmr, |
| 952 |
uint32_t page_count, |
| 953 |
uint32_t page_offset, |
| 954 |
uint64_t flags, |
| 955 |
pvr_dev_addr_t addr); |
| 956 |
void pvr_srv_int_unmap_pages(int fd, |
| 957 |
void *reservation, |
| 958 |
pvr_dev_addr_t dev_addr, |
| 959 |
uint32_t page_count); |
| 960 |
|
| 961 |
VkResult pvr_srv_int_map_pmr(int fd, |
| 962 |
void *server_heap, |
| 963 |
void *reservation, |
| 964 |
void *pmr, |
| 965 |
uint64_t flags, |
| 966 |
void **const mapping_out); |
| 967 |
void pvr_srv_int_unmap_pmr(int fd, void *mapping); |
| 968 |
|
| 969 |
VkResult pvr_srv_physmem_import_dmabuf(int fd, |
| 970 |
int buffer_fd, |
| 971 |
uint64_t flags, |
| 972 |
void **const pmr_out, |
| 973 |
uint64_t *const size_out, |
| 974 |
uint64_t *const align_out); |
| 975 |
VkResult pvr_srv_physmem_export_dmabuf(int fd, void *pmr, int *const fd_out); |
| 976 |
|
| 977 |
VkResult |
| 978 |
pvr_srv_rgx_create_compute_context(int fd, |
| 979 |
uint32_t priority, |
| 980 |
uint32_t reset_framework_cmd_size, |
| 981 |
uint8_t *reset_framework_cmd, |
| 982 |
void *priv_data, |
| 983 |
uint32_t static_compute_context_state_size, |
| 984 |
uint8_t *static_compute_context_state, |
| 985 |
uint32_t packed_ccb_size, |
| 986 |
uint32_t context_flags, |
| 987 |
uint64_t robustness_address, |
| 988 |
uint32_t max_deadline_ms, |
| 989 |
void **const compute_context_out); |
| 990 |
void pvr_srv_rgx_destroy_compute_context(int fd, void *compute_context); |
| 991 |
|
| 992 |
VkResult pvr_srv_rgx_kick_compute2(int fd, |
| 993 |
void *compute_context, |
| 994 |
uint32_t client_update_count, |
| 995 |
void **client_update_ufo_sync_prim_block, |
| 996 |
uint32_t *client_update_offset, |
| 997 |
uint32_t *client_update_value, |
| 998 |
int32_t check_fence, |
| 999 |
int32_t update_timeline, |
| 1000 |
uint32_t cmd_size, |
| 1001 |
uint8_t *cdm_cmd, |
| 1002 |
uint32_t ext_job_ref, |
| 1003 |
uint32_t sync_pmr_count, |
| 1004 |
uint32_t *sync_pmr_flags, |
| 1005 |
void **sync_pmrs, |
| 1006 |
uint32_t num_work_groups, |
| 1007 |
uint32_t num_work_items, |
| 1008 |
uint32_t pdump_flags, |
| 1009 |
uint64_t max_deadline_us, |
| 1010 |
char *update_fence_name, |
| 1011 |
int32_t *const update_fence_out); |
| 1012 |
|
| 1013 |
VkResult pvr_srv_rgx_create_transfer_context(int fd, |
| 1014 |
uint32_t priority, |
| 1015 |
uint32_t reset_framework_cmd_size, |
| 1016 |
uint8_t *reset_framework_cmd, |
| 1017 |
void *priv_data, |
| 1018 |
uint32_t packed_ccb_size_u8888, |
| 1019 |
uint32_t context_flags, |
| 1020 |
uint64_t robustness_address, |
| 1021 |
void **const cli_pmr_out, |
| 1022 |
void **const usc_pmr_out, |
| 1023 |
void **const transfer_context_out); |
| 1024 |
void pvr_srv_rgx_destroy_transfer_context(int fd, void *transfer_context); |
| 1025 |
VkResult pvr_srv_rgx_submit_transfer2(int fd, |
| 1026 |
void *transfer_context, |
| 1027 |
uint32_t prepare_count, |
| 1028 |
uint32_t *client_update_count, |
| 1029 |
void ***update_ufo_sync_prim_block, |
| 1030 |
uint32_t **update_sync_offset, |
| 1031 |
uint32_t **update_value, |
| 1032 |
int32_t check_fence, |
| 1033 |
int32_t update_timeline_2d, |
| 1034 |
int32_t update_timeline_3d, |
| 1035 |
char *update_fence_name, |
| 1036 |
uint32_t *cmd_size, |
| 1037 |
uint8_t **fw_command, |
| 1038 |
uint32_t *tq_prepare_flags, |
| 1039 |
uint32_t ext_job_ref, |
| 1040 |
uint32_t sync_pmr_count, |
| 1041 |
uint32_t *sync_pmr_flags, |
| 1042 |
void **sync_pmrs, |
| 1043 |
int32_t *update_fence_2d_out, |
| 1044 |
int32_t *update_fence_3d_out); |
| 1045 |
|
| 1046 |
VkResult |
| 1047 |
pvr_srv_rgx_create_hwrt_dataset(int fd, |
| 1048 |
uint64_t flipped_multi_sample_ctl, |
| 1049 |
uint64_t multi_sample_ctl, |
| 1050 |
const pvr_dev_addr_t *macrotile_array_dev_addrs, |
| 1051 |
const pvr_dev_addr_t *pm_mlist_dev_addrs, |
| 1052 |
const pvr_dev_addr_t *rtc_dev_addrs, |
| 1053 |
const pvr_dev_addr_t *rgn_header_dev_addrs, |
| 1054 |
const pvr_dev_addr_t *tail_ptrs_dev_addrs, |
| 1055 |
const pvr_dev_addr_t *vheap_table_dev_adds, |
| 1056 |
void **free_lists, |
| 1057 |
uint32_t isp_merge_lower_x, |
| 1058 |
uint32_t isp_merge_lower_y, |
| 1059 |
uint32_t isp_merge_scale_x, |
| 1060 |
uint32_t isp_merge_scale_y, |
| 1061 |
uint32_t isp_merge_upper_x, |
| 1062 |
uint32_t isp_merge_upper_y, |
| 1063 |
uint32_t isp_mtile_size, |
| 1064 |
uint32_t mtile_stride, |
| 1065 |
uint32_t ppp_screen, |
| 1066 |
uint32_t rgn_header_size, |
| 1067 |
uint32_t te_aa, |
| 1068 |
uint32_t te_mtile1, |
| 1069 |
uint32_t te_mtile2, |
| 1070 |
uint32_t te_screen, |
| 1071 |
uint32_t tpc_size, |
| 1072 |
uint32_t tpc_stride, |
| 1073 |
uint16_t max_rts, |
| 1074 |
void **hwrt_dataset_out); |
| 1075 |
|
| 1076 |
void pvr_srv_rgx_destroy_hwrt_dataset(int fd, void *hwrt_dataset); |
| 1077 |
|
| 1078 |
VkResult pvr_srv_rgx_create_free_list(int fd, |
| 1079 |
void *mem_ctx_priv_data, |
| 1080 |
uint32_t max_free_list_pages, |
| 1081 |
uint32_t init_free_list_pages, |
| 1082 |
uint32_t grow_free_list_pages, |
| 1083 |
uint32_t grow_param_threshold, |
| 1084 |
void *global_free_list, |
| 1085 |
enum pvr_srv_bool free_list_check, |
| 1086 |
pvr_dev_addr_t free_list_dev_addr, |
| 1087 |
void *free_list_pmr, |
| 1088 |
uint64_t pmr_offset, |
| 1089 |
void **const cleanup_cookie_out); |
| 1090 |
|
| 1091 |
void pvr_srv_rgx_destroy_free_list(int fd, void *cleanup_cookie); |
| 1092 |
|
| 1093 |
VkResult |
| 1094 |
pvr_srv_rgx_create_render_context(int fd, |
| 1095 |
uint32_t priority, |
| 1096 |
pvr_dev_addr_t vdm_callstack_addr, |
| 1097 |
uint32_t call_stack_depth, |
| 1098 |
uint32_t reset_framework_cmd_size, |
| 1099 |
uint8_t *reset_framework_cmd, |
| 1100 |
void *priv_data, |
| 1101 |
uint32_t static_render_context_state_size, |
| 1102 |
uint8_t *static_render_context_state, |
| 1103 |
uint32_t packed_ccb_size, |
| 1104 |
uint32_t context_flags, |
| 1105 |
uint64_t robustness_address, |
| 1106 |
uint32_t max_geom_deadline_ms, |
| 1107 |
uint32_t max_frag_deadline_ms, |
| 1108 |
void **const render_context_out); |
| 1109 |
|
| 1110 |
void pvr_srv_rgx_destroy_render_context(int fd, void *render_context); |
| 1111 |
|
| 1112 |
VkResult pvr_srv_rgx_kick_render2(int fd, |
| 1113 |
void *render_ctx, |
| 1114 |
uint32_t client_geom_fence_count, |
| 1115 |
void **client_geom_fence_sync_prim_block, |
| 1116 |
uint32_t *client_geom_fence_sync_offset, |
| 1117 |
uint32_t *client_geom_fence_value, |
| 1118 |
uint32_t client_geom_update_count, |
| 1119 |
void **client_geom_update_sync_prim_block, |
| 1120 |
uint32_t *client_geom_update_sync_offset, |
| 1121 |
uint32_t *client_geom_update_value, |
| 1122 |
uint32_t client_frag_update_count, |
| 1123 |
void **client_frag_update_sync_prim_block, |
| 1124 |
uint32_t *client_frag_update_sync_offset, |
| 1125 |
uint32_t *client_frag_update_value, |
| 1126 |
void *client_pr_fence_ufo_sync_prim_block, |
| 1127 |
uint32_t client_pr_fence_ufo_sync_offset, |
| 1128 |
uint32_t client_pr_fence_value, |
| 1129 |
int32_t check_fence, |
| 1130 |
int32_t update_timeline, |
| 1131 |
int32_t *const update_fence_out, |
| 1132 |
char *update_fence_name, |
| 1133 |
int32_t check_fence_frag, |
| 1134 |
int32_t update_timeline_frag, |
| 1135 |
int32_t *const update_fence_frag_out, |
| 1136 |
char *update_fence_name_frag, |
| 1137 |
uint32_t cmd_geom_size, |
| 1138 |
uint8_t *cmd_geom, |
| 1139 |
uint32_t cmd_frag_pr_size, |
| 1140 |
uint8_t *cmd_frag_pr, |
| 1141 |
uint32_t cmd_frag_size, |
| 1142 |
uint8_t *cmd_frag, |
| 1143 |
uint32_t ext_job_ref, |
| 1144 |
bool kick_geom, |
| 1145 |
bool kick_pr, |
| 1146 |
bool kick_frag, |
| 1147 |
bool abort, |
| 1148 |
uint32_t pdump_flags, |
| 1149 |
void *hw_rt_dataset, |
| 1150 |
void *zs_buffer, |
| 1151 |
void *msaa_scratch_buffer, |
| 1152 |
uint32_t sync_pmr_count, |
| 1153 |
uint32_t *sync_pmr_flags, |
| 1154 |
void **sync_pmrs, |
| 1155 |
uint32_t render_target_size, |
| 1156 |
uint32_t num_draw_calls, |
| 1157 |
uint32_t num_indices, |
| 1158 |
uint32_t num_mrts, |
| 1159 |
uint64_t deadline); |
| 1160 |
|
| 1161 |
#endif /* PVR_SRV_BRIDGE_H */ |