History

drm/xe: Move defines before relevant fields

Align on same rule in the whole file: defines then doc then relevant field, with an empty line to separate fields. v2: - Rebase on drm-xe-next - Fix ordering of defines and fields in uAPI (Lucas De Marchi) v3: Remove useless empty lines (Lucas De Marchi) v4: Move changelog to commit v5: Rebase

Francois Dugast committed 3 years ago

Commit 4f082f21 parent ffd66201 file · +42 −31Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/drm/xe_drm.h+42−31
@@ -60,6 +60,7 @@ struct xe_user_extension { · 59 unmodified lines
60 * Pointer to the next struct xe_user_extension, or zero if the end.60 * Pointer to the next struct xe_user_extension, or zero if the end.
61 */61 */
62 __u64 next_extension;62 __u64 next_extension;
63
63 /**64 /**
64 * @name: Name of the extension.65 * @name: Name of the extension.
65 *66 *
@@ -70,6 +71,7 @@ struct xe_user_extension { · 4 unmodified lines
70 * of uAPI which has embedded the struct xe_user_extension.71 * of uAPI which has embedded the struct xe_user_extension.
71 */72 */
72 __u32 name;73 __u32 name;
74
73 /**75 /**
74 * @pad: MBZ76 * @pad: MBZ
75 *77 *
@@ -218,11 +220,11 @@ struct drm_xe_query_topology_mask { · 142 unmodified lines
218 /** @gt_id: GT ID the mask is associated with */220 /** @gt_id: GT ID the mask is associated with */
219 __u16 gt_id;221 __u16 gt_id;
220 222
221 /** @type: type of mask */
222 __u16 type;
223#define XE_TOPO_DSS_GEOMETRY (1 << 0)223#define XE_TOPO_DSS_GEOMETRY (1 << 0)
224#define XE_TOPO_DSS_COMPUTE (1 << 1)224#define XE_TOPO_DSS_COMPUTE (1 << 1)
225#define XE_TOPO_EU_PER_DSS (1 << 2)225#define XE_TOPO_EU_PER_DSS (1 << 2)
226 /** @type: type of mask */
227 __u16 type;
226 228
227 /** @num_bytes: number of bytes in requested mask */229 /** @num_bytes: number of bytes in requested mask */
228 __u32 num_bytes;230 __u32 num_bytes;
@@ -270,15 +272,14 @@ struct drm_xe_device_query { · 41 unmodified lines
270 /** @extensions: Pointer to the first extension struct, if any */272 /** @extensions: Pointer to the first extension struct, if any */
271 __u64 extensions;273 __u64 extensions;
272 274
273 /** @query: The type of data to query */
274 __u32 query;
275
276#define DRM_XE_DEVICE_QUERY_ENGINES 0275#define DRM_XE_DEVICE_QUERY_ENGINES 0
277#define DRM_XE_DEVICE_QUERY_MEM_USAGE 1276#define DRM_XE_DEVICE_QUERY_MEM_USAGE 1
278#define DRM_XE_DEVICE_QUERY_CONFIG 2277#define DRM_XE_DEVICE_QUERY_CONFIG 2
279#define DRM_XE_DEVICE_QUERY_GTS 3278#define DRM_XE_DEVICE_QUERY_GTS 3
280#define DRM_XE_DEVICE_QUERY_HWCONFIG 4279#define DRM_XE_DEVICE_QUERY_HWCONFIG 4
281#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5280#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5
281 /** @query: The type of data to query */
282 __u32 query;
282 283
283 /** @size: Size of the queried data */284 /** @size: Size of the queried data */
284 __u32 size;285 __u32 size;
@@ -301,12 +302,12 @@ struct drm_xe_gem_create { · 16 unmodified lines
301 */302 */
302 __u64 size;303 __u64 size;
303 304
305#define XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
306#define XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
304 /**307 /**
305 * @flags: Flags, currently a mask of memory instances of where BO can308 * @flags: Flags, currently a mask of memory instances of where BO can
306 * be placed309 * be placed
307 */310 */
308#define XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
309#define XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
310 __u32 flags;311 __u32 flags;
311 312
312 /**313 /**
@@ -357,10 +358,13 @@ struct drm_xe_gem_mmap_offset { · 44 unmodified lines
357struct drm_xe_vm_bind_op_error_capture {358struct drm_xe_vm_bind_op_error_capture {
358 /** @error: errno that occured */359 /** @error: errno that occured */
359 __s32 error;360 __s32 error;
361
360 /** @op: operation that encounter an error */362 /** @op: operation that encounter an error */
361 __u32 op;363 __u32 op;
364
362 /** @addr: address of bind op */365 /** @addr: address of bind op */
363 __u64 addr;366 __u64 addr;
367
364 /** @size: size of bind */368 /** @size: size of bind */
365 __u64 size;369 __u64 size;
366};370};
@@ -370,8 +374,8 @@ struct drm_xe_ext_vm_set_property { · 3 unmodified lines
370 /** @base: base user extension */374 /** @base: base user extension */
371 struct xe_user_extension base;375 struct xe_user_extension base;
372 376
373 /** @property: property to set */
374#define XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS 0377#define XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS 0
378 /** @property: property to set */
375 __u32 property;379 __u32 property;
376 380
377 /** @pad: MBZ */381 /** @pad: MBZ */
@@ -385,17 +389,16 @@ struct drm_xe_ext_vm_set_property { · 7 unmodified lines
385};389};
386 390
387struct drm_xe_vm_create {391struct drm_xe_vm_create {
388 /** @extensions: Pointer to the first extension struct, if any */
389#define XE_VM_EXTENSION_SET_PROPERTY 0392#define XE_VM_EXTENSION_SET_PROPERTY 0
393 /** @extensions: Pointer to the first extension struct, if any */
390 __u64 extensions;394 __u64 extensions;
391 395
392 /** @flags: Flags */
393 __u32 flags;
394
395#define DRM_XE_VM_CREATE_SCRATCH_PAGE (0x1 << 0)396#define DRM_XE_VM_CREATE_SCRATCH_PAGE (0x1 << 0)
396#define DRM_XE_VM_CREATE_COMPUTE_MODE (0x1 << 1)397#define DRM_XE_VM_CREATE_COMPUTE_MODE (0x1 << 1)
397#define DRM_XE_VM_CREATE_ASYNC_BIND_OPS (0x1 << 2)398#define DRM_XE_VM_CREATE_ASYNC_BIND_OPS (0x1 << 2)
398#define DRM_XE_VM_CREATE_FAULT_MODE (0x1 << 3)399#define DRM_XE_VM_CREATE_FAULT_MODE (0x1 << 3)
400 /** @flags: Flags */
401 __u32 flags;
399 402
400 /** @vm_id: Returned VM ID */403 /** @vm_id: Returned VM ID */
401 __u32 vm_id;404 __u32 vm_id;
@@ -430,6 +433,7 @@ struct drm_xe_vm_bind_op { · 28 unmodified lines
430 * ignored for unbind433 * ignored for unbind
431 */434 */
432 __u64 obj_offset;435 __u64 obj_offset;
436
433 /** @userptr: user pointer to bind on */437 /** @userptr: user pointer to bind on */
434 __u64 userptr;438 __u64 userptr;
435 };439 };
@@ -448,12 +452,6 @@ struct drm_xe_vm_bind_op { · 12 unmodified lines
448 */452 */
449 __u64 tile_mask;453 __u64 tile_mask;
450 454
451 /** @op: Operation to perform (lower 16 bits) and flags (upper 16 bits) */
452 __u32 op;
453
454 /** @mem_region: Memory region to prefetch VMA to, instance not a mask */
455 __u32 region;
456
457#define XE_VM_BIND_OP_MAP 0x0455#define XE_VM_BIND_OP_MAP 0x0
458#define XE_VM_BIND_OP_UNMAP 0x1456#define XE_VM_BIND_OP_UNMAP 0x1
459#define XE_VM_BIND_OP_MAP_USERPTR 0x2457#define XE_VM_BIND_OP_MAP_USERPTR 0x2
@@ -500,6 +498,11 @@ struct drm_xe_vm_bind_op { · 40 unmodified lines
500 * intended to implement VK sparse bindings.498 * intended to implement VK sparse bindings.
501 */499 */
502#define XE_VM_BIND_FLAG_NULL (0x1 << 19)500#define XE_VM_BIND_FLAG_NULL (0x1 << 19)
501 /** @op: Operation to perform (lower 16 bits) and flags (upper 16 bits) */
502 __u32 op;
503
504 /** @mem_region: Memory region to prefetch VMA to, instance not a mask */
505 __u32 region;
503 506
504 /** @reserved: Reserved */507 /** @reserved: Reserved */
505 __u64 reserved[2];508 __u64 reserved[2];
@@ -528,6 +531,7 @@ struct drm_xe_vm_bind { · 22 unmodified lines
528 union {531 union {
529 /** @bind: used if num_binds == 1 */532 /** @bind: used if num_binds == 1 */
530 struct drm_xe_vm_bind_op bind;533 struct drm_xe_vm_bind_op bind;
534
531 /**535 /**
532 * @vector_of_binds: userptr to array of struct536 * @vector_of_binds: userptr to array of struct
533 * drm_xe_vm_bind_op if num_binds > 1537 * drm_xe_vm_bind_op if num_binds > 1
@@ -575,7 +579,6 @@ struct drm_xe_engine_set_property { · 41 unmodified lines
575 /** @engine_id: Engine ID */579 /** @engine_id: Engine ID */
576 __u32 engine_id;580 __u32 engine_id;
577 581
578 /** @property: property to set */
579#define XE_ENGINE_SET_PROPERTY_PRIORITY 0582#define XE_ENGINE_SET_PROPERTY_PRIORITY 0
580#define XE_ENGINE_SET_PROPERTY_TIMESLICE 1583#define XE_ENGINE_SET_PROPERTY_TIMESLICE 1
581#define XE_ENGINE_SET_PROPERTY_PREEMPTION_TIMEOUT 2584#define XE_ENGINE_SET_PROPERTY_PREEMPTION_TIMEOUT 2
@@ -591,6 +594,7 @@ struct drm_xe_engine_set_property { · 9 unmodified lines
591#define XE_ENGINE_SET_PROPERTY_ACC_TRIGGER 6594#define XE_ENGINE_SET_PROPERTY_ACC_TRIGGER 6
592#define XE_ENGINE_SET_PROPERTY_ACC_NOTIFY 7595#define XE_ENGINE_SET_PROPERTY_ACC_NOTIFY 7
593#define XE_ENGINE_SET_PROPERTY_ACC_GRANULARITY 8596#define XE_ENGINE_SET_PROPERTY_ACC_GRANULARITY 8
597 /** @property: property to set */
594 __u32 property;598 __u32 property;
595 599
596 /** @value: property value */600 /** @value: property value */
@@ -602,8 +606,6 @@ struct drm_xe_engine_set_property { · 5 unmodified lines
602 606
603/** struct drm_xe_engine_class_instance - instance of an engine class */607/** struct drm_xe_engine_class_instance - instance of an engine class */
604struct drm_xe_engine_class_instance {608struct drm_xe_engine_class_instance {
605 __u16 engine_class;
606
607#define DRM_XE_ENGINE_CLASS_RENDER 0609#define DRM_XE_ENGINE_CLASS_RENDER 0
608#define DRM_XE_ENGINE_CLASS_COPY 1610#define DRM_XE_ENGINE_CLASS_COPY 1
609#define DRM_XE_ENGINE_CLASS_VIDEO_DECODE 2611#define DRM_XE_ENGINE_CLASS_VIDEO_DECODE 2
@@ -614,14 +616,15 @@ struct drm_xe_engine_class_instance { · 4 unmodified lines
614 * creating ordered queues of VM bind operations.616 * creating ordered queues of VM bind operations.
615 */617 */
616#define DRM_XE_ENGINE_CLASS_VM_BIND 5618#define DRM_XE_ENGINE_CLASS_VM_BIND 5
619 __u16 engine_class;
617 620
618 __u16 engine_instance;621 __u16 engine_instance;
619 __u16 gt_id;622 __u16 gt_id;
620};623};
621 624
622struct drm_xe_engine_create {625struct drm_xe_engine_create {
623 /** @extensions: Pointer to the first extension struct, if any */
624#define XE_ENGINE_EXTENSION_SET_PROPERTY 0626#define XE_ENGINE_EXTENSION_SET_PROPERTY 0
627 /** @extensions: Pointer to the first extension struct, if any */
625 __u64 extensions;628 __u64 extensions;
626 629
627 /** @width: submission width (number BB per exec) for this engine */630 /** @width: submission width (number BB per exec) for this engine */
@@ -659,8 +662,8 @@ struct drm_xe_engine_get_property { · 31 unmodified lines
659 /** @engine_id: Engine ID */662 /** @engine_id: Engine ID */
660 __u32 engine_id;663 __u32 engine_id;
661 664
662 /** @property: property to get */
663#define XE_ENGINE_GET_PROPERTY_BAN 0665#define XE_ENGINE_GET_PROPERTY_BAN 0
666 /** @property: property to get */
664 __u32 property;667 __u32 property;
665 668
666 /** @value: property value */669 /** @value: property value */
@@ -685,19 +688,19 @@ struct drm_xe_sync { · 18 unmodified lines
685 /** @extensions: Pointer to the first extension struct, if any */688 /** @extensions: Pointer to the first extension struct, if any */
686 __u64 extensions;689 __u64 extensions;
687 690
688 __u32 flags;
689
690#define DRM_XE_SYNC_SYNCOBJ 0x0691#define DRM_XE_SYNC_SYNCOBJ 0x0
691#define DRM_XE_SYNC_TIMELINE_SYNCOBJ 0x1692#define DRM_XE_SYNC_TIMELINE_SYNCOBJ 0x1
692#define DRM_XE_SYNC_DMA_BUF 0x2693#define DRM_XE_SYNC_DMA_BUF 0x2
693#define DRM_XE_SYNC_USER_FENCE 0x3694#define DRM_XE_SYNC_USER_FENCE 0x3
694#define DRM_XE_SYNC_SIGNAL 0x10695#define DRM_XE_SYNC_SIGNAL 0x10
696 __u32 flags;
695 697
696 /** @pad: MBZ */698 /** @pad: MBZ */
697 __u32 pad;699 __u32 pad;
698 700
699 union {701 union {
700 __u32 handle;702 __u32 handle;
703
701 /**704 /**
702 * @addr: Address of user fence. When sync passed in via exec705 * @addr: Address of user fence. When sync passed in via exec
703 * IOCTL this a GPU address in the VM. When sync passed in via706 * IOCTL this a GPU address in the VM. When sync passed in via
@@ -753,8 +756,6 @@ struct drm_xe_mmio { · 49 unmodified lines
753 756
754 __u32 addr;757 __u32 addr;
755 758
756 __u32 flags;
757
758#define DRM_XE_MMIO_8BIT 0x0759#define DRM_XE_MMIO_8BIT 0x0
759#define DRM_XE_MMIO_16BIT 0x1760#define DRM_XE_MMIO_16BIT 0x1
760#define DRM_XE_MMIO_32BIT 0x2761#define DRM_XE_MMIO_32BIT 0x2
@@ -762,6 +763,7 @@ struct drm_xe_mmio { · 1 unmodified line
762#define DRM_XE_MMIO_BITS_MASK 0x3763#define DRM_XE_MMIO_BITS_MASK 0x3
763#define DRM_XE_MMIO_READ 0x4764#define DRM_XE_MMIO_READ 0x4
764#define DRM_XE_MMIO_WRITE 0x8765#define DRM_XE_MMIO_WRITE 0x8
766 __u32 flags;
765 767
766 __u64 value;768 __u64 value;
767 769
@@ -781,47 +783,57 @@ struct drm_xe_mmio { · 13 unmodified lines
781struct drm_xe_wait_user_fence {783struct drm_xe_wait_user_fence {
782 /** @extensions: Pointer to the first extension struct, if any */784 /** @extensions: Pointer to the first extension struct, if any */
783 __u64 extensions;785 __u64 extensions;
786
784 union {787 union {
785 /**788 /**
786 * @addr: user pointer address to wait on, must qword aligned789 * @addr: user pointer address to wait on, must qword aligned
787 */790 */
788 __u64 addr;791 __u64 addr;
792
789 /**793 /**
790 * @vm_id: The ID of the VM which encounter an error used with794 * @vm_id: The ID of the VM which encounter an error used with
791 * DRM_XE_UFENCE_WAIT_VM_ERROR. Upper 32 bits must be clear.795 * DRM_XE_UFENCE_WAIT_VM_ERROR. Upper 32 bits must be clear.
792 */796 */
793 __u64 vm_id;797 __u64 vm_id;
794 };798 };
795 /** @op: wait operation (type of comparison) */799
796#define DRM_XE_UFENCE_WAIT_EQ 0800#define DRM_XE_UFENCE_WAIT_EQ 0
797#define DRM_XE_UFENCE_WAIT_NEQ 1801#define DRM_XE_UFENCE_WAIT_NEQ 1
798#define DRM_XE_UFENCE_WAIT_GT 2802#define DRM_XE_UFENCE_WAIT_GT 2
799#define DRM_XE_UFENCE_WAIT_GTE 3803#define DRM_XE_UFENCE_WAIT_GTE 3
800#define DRM_XE_UFENCE_WAIT_LT 4804#define DRM_XE_UFENCE_WAIT_LT 4
801#define DRM_XE_UFENCE_WAIT_LTE 5805#define DRM_XE_UFENCE_WAIT_LTE 5
806 /** @op: wait operation (type of comparison) */
802 __u16 op;807 __u16 op;
803 /** @flags: wait flags */808
804#define DRM_XE_UFENCE_WAIT_SOFT_OP (1 << 0) /* e.g. Wait on VM bind */809#define DRM_XE_UFENCE_WAIT_SOFT_OP (1 << 0) /* e.g. Wait on VM bind */
805#define DRM_XE_UFENCE_WAIT_ABSTIME (1 << 1)810#define DRM_XE_UFENCE_WAIT_ABSTIME (1 << 1)
806#define DRM_XE_UFENCE_WAIT_VM_ERROR (1 << 2)811#define DRM_XE_UFENCE_WAIT_VM_ERROR (1 << 2)
812 /** @flags: wait flags */
807 __u16 flags;813 __u16 flags;
814
808 /** @pad: MBZ */815 /** @pad: MBZ */
809 __u32 pad;816 __u32 pad;
817
810 /** @value: compare value */818 /** @value: compare value */
811 __u64 value;819 __u64 value;
812 /** @mask: comparison mask */820
813#define DRM_XE_UFENCE_WAIT_U8 0xffu821#define DRM_XE_UFENCE_WAIT_U8 0xffu
814#define DRM_XE_UFENCE_WAIT_U16 0xffffu822#define DRM_XE_UFENCE_WAIT_U16 0xffffu
815#define DRM_XE_UFENCE_WAIT_U32 0xffffffffu823#define DRM_XE_UFENCE_WAIT_U32 0xffffffffu
816#define DRM_XE_UFENCE_WAIT_U64 0xffffffffffffffffu824#define DRM_XE_UFENCE_WAIT_U64 0xffffffffffffffffu
825 /** @mask: comparison mask */
817 __u64 mask;826 __u64 mask;
827
818 /** @timeout: how long to wait before bailing, value in jiffies */828 /** @timeout: how long to wait before bailing, value in jiffies */
819 __s64 timeout;829 __s64 timeout;
830
820 /**831 /**
821 * @num_engines: number of engine instances to wait on, must be zero832 * @num_engines: number of engine instances to wait on, must be zero
822 * when DRM_XE_UFENCE_WAIT_SOFT_OP set833 * when DRM_XE_UFENCE_WAIT_SOFT_OP set
823 */834 */
824 __u64 num_engines;835 __u64 num_engines;
836
825 /**837 /**
826 * @instances: user pointer to array of drm_xe_engine_class_instance to838 * @instances: user pointer to array of drm_xe_engine_class_instance to
827 * wait on, must be NULL when DRM_XE_UFENCE_WAIT_SOFT_OP set839 * wait on, must be NULL when DRM_XE_UFENCE_WAIT_SOFT_OP set
@@ -882,7 +894,6 @@ struct drm_xe_vm_madvise { · 54 unmodified lines
882#define DRM_XE_VMA_PRIORITY_HIGH 2 /* Must be elevated user */894#define DRM_XE_VMA_PRIORITY_HIGH 2 /* Must be elevated user */
883 /* Pin the VMA in memory, must be elevated user */895 /* Pin the VMA in memory, must be elevated user */
884#define DRM_XE_VM_MADVISE_PIN 6896#define DRM_XE_VM_MADVISE_PIN 6
885
886 /** @property: property to set */897 /** @property: property to set */
887 __u32 property;898 __u32 property;
888 899

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t