XenevaOS
Loading...
Searching...
No Matches
panthor_drm.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/* Copyright (C) 2023 Collabora ltd. */
3#ifndef _PANTHOR_DRM_H_
4#define _PANTHOR_DRM_H_
5
6#include "drm.h"
7
8#if defined(__cplusplus)
9extern "C" {
10#endif
11
68#define DRM_PANTHOR_USER_MMIO_OFFSET_32BIT (1ull << 43)
69#define DRM_PANTHOR_USER_MMIO_OFFSET_64BIT (1ull << 56)
70#define DRM_PANTHOR_USER_MMIO_OFFSET (sizeof(unsigned long) < 8 ? \
71 DRM_PANTHOR_USER_MMIO_OFFSET_32BIT : \
72 DRM_PANTHOR_USER_MMIO_OFFSET_64BIT)
73#define DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET (DRM_PANTHOR_USER_MMIO_OFFSET | 0)
74
158
184
193#define DRM_PANTHOR_OBJ_ARRAY(cnt, ptr) \
194 { .stride = sizeof((ptr)[0]), .count = (cnt), .array = (__u64)(uintptr_t)(ptr) }
195
218
236
257
277
286#define DRM_PANTHOR_ARCH_MAJOR(x) ((x) >> 28)
287#define DRM_PANTHOR_ARCH_MINOR(x) (((x) >> 24) & 0xf)
288#define DRM_PANTHOR_ARCH_REV(x) (((x) >> 20) & 0xf)
289#define DRM_PANTHOR_PRODUCT_MAJOR(x) (((x) >> 16) & 0xf)
290#define DRM_PANTHOR_VERSION_MAJOR(x) (((x) >> 12) & 0xf)
291#define DRM_PANTHOR_VERSION_MINOR(x) (((x) >> 4) & 0xff)
292#define DRM_PANTHOR_VERSION_STATUS(x) ((x) & 0xf)
293
296
299#define DRM_PANTHOR_CSHW_MAJOR(x) (((x) >> 26) & 0x3f)
300#define DRM_PANTHOR_CSHW_MINOR(x) (((x) >> 20) & 0x3f)
301#define DRM_PANTHOR_CSHW_REV(x) (((x) >> 16) & 0xf)
302#define DRM_PANTHOR_MCU_MAJOR(x) (((x) >> 10) & 0x3f)
303#define DRM_PANTHOR_MCU_MINOR(x) (((x) >> 4) & 0x3f)
304#define DRM_PANTHOR_MCU_REV(x) ((x) & 0xf)
305
308
311
314
317#define DRM_PANTHOR_MMU_VA_BITS(x) ((x) & 0xff)
318
321
324
327
333
345
348
351
358
361
364
367
370
373
376};
377
411
443
489
506
534
567
578
625
669
680
694
721
736
753
789
803
820
845
923
934
986
1000
1028
1051
1098
1113
1131
1153
1164
1190
1200
1224
1248
1260#define DRM_IOCTL_PANTHOR(__access, __id, __type) \
1261 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_PANTHOR_ ## __id, \
1262 struct drm_panthor_ ## __type)
1263
1264enum {
1266 DRM_IOCTL_PANTHOR(WR, DEV_QUERY, dev_query),
1268 DRM_IOCTL_PANTHOR(WR, VM_CREATE, vm_create),
1270 DRM_IOCTL_PANTHOR(WR, VM_DESTROY, vm_destroy),
1272 DRM_IOCTL_PANTHOR(WR, VM_BIND, vm_bind),
1274 DRM_IOCTL_PANTHOR(WR, VM_GET_STATE, vm_get_state),
1276 DRM_IOCTL_PANTHOR(WR, BO_CREATE, bo_create),
1278 DRM_IOCTL_PANTHOR(WR, BO_MMAP_OFFSET, bo_mmap_offset),
1280 DRM_IOCTL_PANTHOR(WR, GROUP_CREATE, group_create),
1282 DRM_IOCTL_PANTHOR(WR, GROUP_DESTROY, group_destroy),
1284 DRM_IOCTL_PANTHOR(WR, GROUP_SUBMIT, group_submit),
1286 DRM_IOCTL_PANTHOR(WR, GROUP_GET_STATE, group_get_state),
1288 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create),
1290 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy),
1292 DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),
1294 DRM_IOCTL_PANTHOR(WR, SET_USER_MMIO_OFFSET, set_user_mmio_offset),
1296 DRM_IOCTL_PANTHOR(WR, BO_SYNC, bo_sync),
1298 DRM_IOCTL_PANTHOR(WR, BO_QUERY_INFO, bo_query_info),
1299};
1300
1301#if defined(__cplusplus)
1302}
1303#endif
1304
1305#endif /* _PANTHOR_DRM_H_ */
uint32_t __u32
Definition drm.h:42
uint8_t __u8
Definition drm.h:38
uint64_t __u64
Definition drm.h:44
drm_panthor_timestamp_info_flags
Definition panthor_drm.h:415
@ DRM_PANTHOR_TIMESTAMP_CPU_NONE
Definition panthor_drm.h:420
@ DRM_PANTHOR_TIMESTAMP_DURATION
Definition panthor_drm.h:441
@ DRM_PANTHOR_TIMESTAMP_CPU_TYPE_MASK
Definition panthor_drm.h:429
@ DRM_PANTHOR_TIMESTAMP_FREQ
Definition panthor_drm.h:438
@ DRM_PANTHOR_TIMESTAMP_CPU_MONOTONIC_RAW
Definition panthor_drm.h:426
@ DRM_PANTHOR_TIMESTAMP_CPU_MONOTONIC
Definition panthor_drm.h:423
@ DRM_PANTHOR_TIMESTAMP_GPU_OFFSET
Definition panthor_drm.h:432
@ DRM_PANTHOR_TIMESTAMP_GPU_CYCLE_COUNT
Definition panthor_drm.h:435
@ DRM_PANTHOR_TIMESTAMP_GPU
Definition panthor_drm.h:417
drm_panthor_bo_extra_flags
Definition panthor_drm.h:1207
@ DRM_PANTHOR_BO_IS_IMPORTED
Definition panthor_drm.h:1222
drm_panthor_group_state_flags
Definition panthor_drm.h:1004
@ DRM_PANTHOR_GROUP_STATE_FATAL_FAULT
Definition panthor_drm.h:1017
@ DRM_PANTHOR_GROUP_STATE_TIMEDOUT
Definition panthor_drm.h:1010
@ DRM_PANTHOR_GROUP_STATE_INNOCENT
Definition panthor_drm.h:1026
drm_panthor_ioctl_id
Definition panthor_drm.h:85
@ DRM_PANTHOR_SET_USER_MMIO_OFFSET
Definition panthor_drm.h:146
@ DRM_PANTHOR_VM_GET_STATE
Definition panthor_drm.h:99
@ DRM_PANTHOR_GROUP_CREATE
Definition panthor_drm.h:111
@ DRM_PANTHOR_VM_CREATE
Definition panthor_drm.h:90
@ DRM_PANTHOR_TILER_HEAP_CREATE
Definition panthor_drm.h:126
@ DRM_PANTHOR_TILER_HEAP_DESTROY
Definition panthor_drm.h:129
@ DRM_PANTHOR_BO_SET_LABEL
Definition panthor_drm.h:132
@ DRM_PANTHOR_BO_CREATE
Definition panthor_drm.h:102
@ DRM_PANTHOR_BO_SYNC
Definition panthor_drm.h:149
@ DRM_PANTHOR_GROUP_GET_STATE
Definition panthor_drm.h:123
@ DRM_PANTHOR_GROUP_DESTROY
Definition panthor_drm.h:114
@ DRM_PANTHOR_VM_DESTROY
Definition panthor_drm.h:93
@ DRM_PANTHOR_VM_BIND
Definition panthor_drm.h:96
@ DRM_PANTHOR_DEV_QUERY
Definition panthor_drm.h:87
@ DRM_PANTHOR_BO_QUERY_INFO
Definition panthor_drm.h:156
@ DRM_PANTHOR_BO_MMAP_OFFSET
Definition panthor_drm.h:108
@ DRM_PANTHOR_GROUP_SUBMIT
Definition panthor_drm.h:120
#define DRM_IOCTL_PANTHOR(__access, __id, __type)
Definition panthor_drm.h:1260
drm_panthor_vm_state
Definition panthor_drm.h:698
@ DRM_PANTHOR_VM_STATE_UNUSABLE
Definition panthor_drm.h:719
@ DRM_PANTHOR_VM_STATE_USABLE
Definition panthor_drm.h:704
drm_panthor_sync_op_flags
Definition panthor_drm.h:199
@ DRM_PANTHOR_SYNC_OP_WAIT
Definition panthor_drm.h:213
@ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_SYNCOBJ
Definition panthor_drm.h:204
@ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_TIMELINE_SYNCOBJ
Definition panthor_drm.h:210
@ DRM_PANTHOR_SYNC_OP_SIGNAL
Definition panthor_drm.h:216
@ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_MASK
Definition panthor_drm.h:201
drm_panthor_bo_flags
Definition panthor_drm.h:740
@ DRM_PANTHOR_BO_NO_MMAP
Definition panthor_drm.h:742
@ DRM_PANTHOR_BO_WB_MMAP
Definition panthor_drm.h:751
drm_panthor_vm_bind_flags
Definition panthor_drm.h:673
@ DRM_PANTHOR_VM_BIND_ASYNC
Definition panthor_drm.h:678
drm_panthor_vm_bind_op_flags
Definition panthor_drm.h:582
@ DRM_PANTHOR_VM_BIND_OP_TYPE_MASK
Definition panthor_drm.h:607
@ DRM_PANTHOR_VM_BIND_OP_TYPE_UNMAP
Definition panthor_drm.h:613
@ DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED
Definition panthor_drm.h:602
@ DRM_PANTHOR_VM_BIND_OP_MAP_READONLY
Definition panthor_drm.h:588
@ DRM_PANTHOR_VM_BIND_OP_TYPE_SYNC_ONLY
Definition panthor_drm.h:623
@ DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC
Definition panthor_drm.h:595
@ DRM_PANTHOR_VM_BIND_OP_TYPE_MAP
Definition panthor_drm.h:610
drm_panthor_bo_sync_op_type
Definition panthor_drm.h:1157
@ DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH
Definition panthor_drm.h:1159
@ DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE
Definition panthor_drm.h:1162
drm_panthor_dev_query_type
Definition panthor_drm.h:242
@ DRM_PANTHOR_DEV_QUERY_TIMESTAMP_INFO
Definition panthor_drm.h:250
@ DRM_PANTHOR_DEV_QUERY_CSIF_INFO
Definition panthor_drm.h:247
@ DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO
Definition panthor_drm.h:255
@ DRM_PANTHOR_DEV_QUERY_GPU_INFO
Definition panthor_drm.h:244
drm_panthor_gpu_coherency
Definition panthor_drm.h:261
@ DRM_PANTHOR_GPU_COHERENCY_NONE
Definition panthor_drm.h:275
@ DRM_PANTHOR_GPU_COHERENCY_ACE
Definition panthor_drm.h:270
@ DRM_PANTHOR_GPU_COHERENCY_ACE_LITE
Definition panthor_drm.h:265
@ DRM_IOCTL_PANTHOR_GROUP_SUBMIT
Definition panthor_drm.h:1283
@ DRM_IOCTL_PANTHOR_BO_SYNC
Definition panthor_drm.h:1295
@ DRM_IOCTL_PANTHOR_BO_CREATE
Definition panthor_drm.h:1275
@ DRM_IOCTL_PANTHOR_VM_GET_STATE
Definition panthor_drm.h:1273
@ DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET
Definition panthor_drm.h:1277
@ DRM_IOCTL_PANTHOR_VM_CREATE
Definition panthor_drm.h:1267
@ DRM_IOCTL_PANTHOR_VM_BIND
Definition panthor_drm.h:1271
@ DRM_IOCTL_PANTHOR_BO_QUERY_INFO
Definition panthor_drm.h:1297
@ DRM_IOCTL_PANTHOR_BO_SET_LABEL
Definition panthor_drm.h:1291
@ DRM_IOCTL_PANTHOR_DEV_QUERY
Definition panthor_drm.h:1265
@ DRM_IOCTL_PANTHOR_VM_DESTROY
Definition panthor_drm.h:1269
@ DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET
Definition panthor_drm.h:1293
@ DRM_IOCTL_PANTHOR_GROUP_CREATE
Definition panthor_drm.h:1279
@ DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE
Definition panthor_drm.h:1287
@ DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY
Definition panthor_drm.h:1289
@ DRM_IOCTL_PANTHOR_GROUP_GET_STATE
Definition panthor_drm.h:1285
@ DRM_IOCTL_PANTHOR_GROUP_DESTROY
Definition panthor_drm.h:1281
drm_panthor_group_priority
Definition panthor_drm.h:824
@ PANTHOR_GROUP_PRIORITY_LOW
Definition panthor_drm.h:826
@ PANTHOR_GROUP_PRIORITY_MEDIUM
Definition panthor_drm.h:829
@ PANTHOR_GROUP_PRIORITY_REALTIME
Definition panthor_drm.h:843
@ PANTHOR_GROUP_PRIORITY_HIGH
Definition panthor_drm.h:836
Definition panthor_drm.h:757
__u32 pad
Definition panthor_drm.h:787
__u64 size
Definition panthor_drm.h:763
__u32 flags
Definition panthor_drm.h:768
__u32 exclusive_vm_id
Definition panthor_drm.h:777
__u32 handle
Definition panthor_drm.h:784
Definition panthor_drm.h:793
__u64 offset
Definition panthor_drm.h:801
__u32 handle
Definition panthor_drm.h:795
__u32 pad
Definition panthor_drm.h:798
Definition panthor_drm.h:1228
__u32 create_flags
Definition panthor_drm.h:1243
__u32 extra_flags
Definition panthor_drm.h:1235
__u32 pad
Definition panthor_drm.h:1246
__u32 handle
Definition panthor_drm.h:1230
Definition panthor_drm.h:1117
__u32 pad
Definition panthor_drm.h:1122
__u32 handle
Definition panthor_drm.h:1119
__u64 label
Definition panthor_drm.h:1129
Definition panthor_drm.h:1168
__u64 size
Definition panthor_drm.h:1188
__u64 offset
Definition panthor_drm.h:1180
__u32 handle
Definition panthor_drm.h:1170
__u32 type
Definition panthor_drm.h:1173
Definition panthor_drm.h:1194
struct drm_panthor_obj_array ops
Definition panthor_drm.h:1198
Definition panthor_drm.h:383
__u32 csg_slot_count
Definition panthor_drm.h:385
__u32 cs_reg_count
Definition panthor_drm.h:391
__u32 scoreboard_slot_count
Definition panthor_drm.h:394
__u32 pad
Definition panthor_drm.h:409
__u32 cs_slot_count
Definition panthor_drm.h:388
__u32 unpreserved_cs_reg_count
Definition panthor_drm.h:404
Definition panthor_drm.h:510
__u64 pointer
Definition panthor_drm.h:532
__u32 type
Definition panthor_drm.h:512
__u32 size
Definition panthor_drm.h:523
Definition panthor_drm.h:283
__u32 coherency_features
Definition panthor_drm.h:344
__u64 shader_present
Definition panthor_drm.h:360
__u32 as_present
Definition panthor_drm.h:350
__u32 texture_features[4]
Definition panthor_drm.h:347
__u64 tiler_present
Definition panthor_drm.h:366
__u64 l2_present
Definition panthor_drm.h:363
__u32 gpu_rev
Definition panthor_drm.h:295
__u32 core_features
Definition panthor_drm.h:369
__u32 thread_max_workgroup_size
Definition panthor_drm.h:326
__u64 gpu_features
Definition panthor_drm.h:375
__u32 max_threads
Definition panthor_drm.h:323
__u32 pad
Definition panthor_drm.h:372
__u32 thread_features
Definition panthor_drm.h:320
__u32 gpu_id
Definition panthor_drm.h:285
__u32 tiler_features
Definition panthor_drm.h:310
__u32 thread_max_barrier_size
Definition panthor_drm.h:332
__u32 selected_coherency
Definition panthor_drm.h:357
__u32 mem_features
Definition panthor_drm.h:313
__u32 l2_features
Definition panthor_drm.h:307
__u32 csf_id
Definition panthor_drm.h:298
__u32 mmu_features
Definition panthor_drm.h:316
Definition panthor_drm.h:849
__u64 compute_core_mask
Definition panthor_drm.h:890
__u32 group_handle
Definition panthor_drm.h:921
__u32 vm_id
Definition panthor_drm.h:915
__u8 priority
Definition panthor_drm.h:878
__u64 tiler_core_mask
Definition panthor_drm.h:908
__u32 pad
Definition panthor_drm.h:881
struct drm_panthor_obj_array queues
Definition panthor_drm.h:851
__u8 max_tiler_cores
Definition panthor_drm.h:875
__u8 max_compute_cores
Definition panthor_drm.h:859
__u8 max_fragment_cores
Definition panthor_drm.h:867
__u64 fragment_core_mask
Definition panthor_drm.h:899
Definition panthor_drm.h:927
__u32 group_handle
Definition panthor_drm.h:929
__u32 pad
Definition panthor_drm.h:932
Definition panthor_drm.h:1035
__u32 state
Definition panthor_drm.h:1043
__u32 fatal_queues
Definition panthor_drm.h:1046
__u32 pad
Definition panthor_drm.h:1049
__u32 group_handle
Definition panthor_drm.h:1037
Definition panthor_drm.h:495
__u8 allowed_mask
Definition panthor_drm.h:501
__u8 pad[3]
Definition panthor_drm.h:504
Definition panthor_drm.h:990
__u32 group_handle
Definition panthor_drm.h:992
__u32 pad
Definition panthor_drm.h:995
struct drm_panthor_obj_array queue_submits
Definition panthor_drm.h:998
Definition panthor_drm.h:174
__u32 count
Definition panthor_drm.h:179
__u64 array
Definition panthor_drm.h:182
__u32 stride
Definition panthor_drm.h:176
Definition panthor_drm.h:807
__u32 ringbuf_size
Definition panthor_drm.h:818
__u8 priority
Definition panthor_drm.h:812
__u8 pad[3]
Definition panthor_drm.h:815
Definition panthor_drm.h:942
struct drm_panthor_obj_array syncs
Definition panthor_drm.h:984
__u32 stream_size
Definition panthor_drm.h:956
__u32 queue_index
Definition panthor_drm.h:944
__u64 stream_addr
Definition panthor_drm.h:965
__u32 latest_flush
Definition panthor_drm.h:978
__u32 pad
Definition panthor_drm.h:981
Definition panthor_drm.h:1140
__u64 offset
Definition panthor_drm.h:1151
Definition panthor_drm.h:222
__u32 flags
Definition panthor_drm.h:224
__u64 timeline_value
Definition panthor_drm.h:234
__u32 handle
Definition panthor_drm.h:227
Definition panthor_drm.h:1055
__u32 handle
Definition panthor_drm.h:1085
__u32 vm_id
Definition panthor_drm.h:1057
__u32 initial_chunk_count
Definition panthor_drm.h:1060
__u32 target_in_flight
Definition panthor_drm.h:1082
__u32 chunk_size
Definition panthor_drm.h:1067
__u64 tiler_heap_ctx_gpu_va
Definition panthor_drm.h:1088
__u64 first_heap_chunk_gpu_va
Definition panthor_drm.h:1096
__u32 max_chunks
Definition panthor_drm.h:1074
Definition panthor_drm.h:1102
__u32 pad
Definition panthor_drm.h:1111
__u32 handle
Definition panthor_drm.h:1108
Definition panthor_drm.h:449
__u64 cpu_timestamp_sec
Definition panthor_drm.h:484
__u64 cpu_timestamp_nsec
Definition panthor_drm.h:487
__u64 current_timestamp
Definition panthor_drm.h:457
__u32 flags
Definition panthor_drm.h:475
__u64 timestamp_frequency
Definition panthor_drm.h:454
__u32 duration_nsec
Definition panthor_drm.h:478
__u64 cycle_count
Definition panthor_drm.h:481
__u64 timestamp_offset
Definition panthor_drm.h:460
Definition panthor_drm.h:629
__u64 va
Definition panthor_drm.h:649
__u64 bo_offset
Definition panthor_drm.h:643
__u64 size
Definition panthor_drm.h:655
struct drm_panthor_obj_array syncs
Definition panthor_drm.h:666
__u32 flags
Definition panthor_drm.h:631
__u32 bo_handle
Definition panthor_drm.h:637
Definition panthor_drm.h:684
struct drm_panthor_obj_array ops
Definition panthor_drm.h:692
__u32 flags
Definition panthor_drm.h:689
__u32 vm_id
Definition panthor_drm.h:686
Definition panthor_drm.h:538
__u32 id
Definition panthor_drm.h:543
__u32 flags
Definition panthor_drm.h:540
__u64 user_va_range
Definition panthor_drm.h:565
Definition panthor_drm.h:571
__u32 pad
Definition panthor_drm.h:576
__u32 id
Definition panthor_drm.h:573
Definition panthor_drm.h:725
__u32 state
Definition panthor_drm.h:734
__u32 vm_id
Definition panthor_drm.h:727