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
6060 * Pointer to the next struct xe_user_extension, or zero if the end.
6161 */
6262 __u64 next_extension;
63+
6364 /**
6465 * @name: Name of the extension.
6566 *
@@ -70,6 +71,7 @@ struct xe_user_extension { · 4 unmodified lines
7071 * of uAPI which has embedded the struct xe_user_extension.
7172 */
7273 __u32 name;
74+
7375 /**
7476 * @pad: MBZ
7577 *
@@ -218,11 +220,11 @@ struct drm_xe_query_topology_mask { · 142 unmodified lines
218220 /** @gt_id: GT ID the mask is associated with */
219221 __u16 gt_id;
220222
221− /** @type: type of mask */
222− __u16 type;
223223 #define XE_TOPO_DSS_GEOMETRY (1 << 0)
224224 #define XE_TOPO_DSS_COMPUTE (1 << 1)
225225 #define XE_TOPO_EU_PER_DSS (1 << 2)
226+ /** @type: type of mask */
227+ __u16 type;
226228
227229 /** @num_bytes: number of bytes in requested mask */
228230 __u32 num_bytes;
@@ -270,15 +272,14 @@ struct drm_xe_device_query { · 41 unmodified lines
270272 /** @extensions: Pointer to the first extension struct, if any */
271273 __u64 extensions;
272274
273− /** @query: The type of data to query */
274− __u32 query;
275−
276275 #define DRM_XE_DEVICE_QUERY_ENGINES 0
277276 #define DRM_XE_DEVICE_QUERY_MEM_USAGE 1
278277 #define DRM_XE_DEVICE_QUERY_CONFIG 2
279278 #define DRM_XE_DEVICE_QUERY_GTS 3
280279 #define DRM_XE_DEVICE_QUERY_HWCONFIG 4
281280 #define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5
281+ /** @query: The type of data to query */
282+ __u32 query;
282283
283284 /** @size: Size of the queried data */
284285 __u32 size;
@@ -301,12 +302,12 @@ struct drm_xe_gem_create { · 16 unmodified lines
301302 */
302303 __u64 size;
303304
305+#define XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
306+#define XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
304307 /**
305308 * @flags: Flags, currently a mask of memory instances of where BO can
306309 * be placed
307310 */
308−#define XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
309−#define XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
310311 __u32 flags;
311312
312313 /**
@@ -357,10 +358,13 @@ struct drm_xe_gem_mmap_offset { · 44 unmodified lines
357358 struct drm_xe_vm_bind_op_error_capture {
358359 /** @error: errno that occured */
359360 __s32 error;
361+
360362 /** @op: operation that encounter an error */
361363 __u32 op;
364+
362365 /** @addr: address of bind op */
363366 __u64 addr;
367+
364368 /** @size: size of bind */
365369 __u64 size;
366370 };
@@ -370,8 +374,8 @@ struct drm_xe_ext_vm_set_property { · 3 unmodified lines
370374 /** @base: base user extension */
371375 struct xe_user_extension base;
372376
373− /** @property: property to set */
374377 #define XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS 0
378+ /** @property: property to set */
375379 __u32 property;
376380
377381 /** @pad: MBZ */
@@ -385,17 +389,16 @@ struct drm_xe_ext_vm_set_property { · 7 unmodified lines
385389 };
386390
387391 struct drm_xe_vm_create {
388− /** @extensions: Pointer to the first extension struct, if any */
389392 #define XE_VM_EXTENSION_SET_PROPERTY 0
393+ /** @extensions: Pointer to the first extension struct, if any */
390394 __u64 extensions;
391395
392− /** @flags: Flags */
393− __u32 flags;
394−
395396 #define DRM_XE_VM_CREATE_SCRATCH_PAGE (0x1 << 0)
396397 #define DRM_XE_VM_CREATE_COMPUTE_MODE (0x1 << 1)
397398 #define DRM_XE_VM_CREATE_ASYNC_BIND_OPS (0x1 << 2)
398399 #define DRM_XE_VM_CREATE_FAULT_MODE (0x1 << 3)
400+ /** @flags: Flags */
401+ __u32 flags;
399402
400403 /** @vm_id: Returned VM ID */
401404 __u32 vm_id;
@@ -430,6 +433,7 @@ struct drm_xe_vm_bind_op { · 28 unmodified lines
430433 * ignored for unbind
431434 */
432435 __u64 obj_offset;
436+
433437 /** @userptr: user pointer to bind on */
434438 __u64 userptr;
435439 };
@@ -448,12 +452,6 @@ struct drm_xe_vm_bind_op { · 12 unmodified lines
448452 */
449453 __u64 tile_mask;
450454
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−
457455 #define XE_VM_BIND_OP_MAP 0x0
458456 #define XE_VM_BIND_OP_UNMAP 0x1
459457 #define XE_VM_BIND_OP_MAP_USERPTR 0x2
@@ -500,6 +498,11 @@ struct drm_xe_vm_bind_op { · 40 unmodified lines
500498 * intended to implement VK sparse bindings.
501499 */
502500 #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;
503506
504507 /** @reserved: Reserved */
505508 __u64 reserved[2];
@@ -528,6 +531,7 @@ struct drm_xe_vm_bind { · 22 unmodified lines
528531 union {
529532 /** @bind: used if num_binds == 1 */
530533 struct drm_xe_vm_bind_op bind;
534+
531535 /**
532536 * @vector_of_binds: userptr to array of struct
533537 * drm_xe_vm_bind_op if num_binds > 1
@@ -575,7 +579,6 @@ struct drm_xe_engine_set_property { · 41 unmodified lines
575579 /** @engine_id: Engine ID */
576580 __u32 engine_id;
577581
578− /** @property: property to set */
579582 #define XE_ENGINE_SET_PROPERTY_PRIORITY 0
580583 #define XE_ENGINE_SET_PROPERTY_TIMESLICE 1
581584 #define XE_ENGINE_SET_PROPERTY_PREEMPTION_TIMEOUT 2
@@ -591,6 +594,7 @@ struct drm_xe_engine_set_property { · 9 unmodified lines
591594 #define XE_ENGINE_SET_PROPERTY_ACC_TRIGGER 6
592595 #define XE_ENGINE_SET_PROPERTY_ACC_NOTIFY 7
593596 #define XE_ENGINE_SET_PROPERTY_ACC_GRANULARITY 8
597+ /** @property: property to set */
594598 __u32 property;
595599
596600 /** @value: property value */
@@ -602,8 +606,6 @@ struct drm_xe_engine_set_property { · 5 unmodified lines
602606
603607 /** struct drm_xe_engine_class_instance - instance of an engine class */
604608 struct drm_xe_engine_class_instance {
605− __u16 engine_class;
606−
607609 #define DRM_XE_ENGINE_CLASS_RENDER 0
608610 #define DRM_XE_ENGINE_CLASS_COPY 1
609611 #define DRM_XE_ENGINE_CLASS_VIDEO_DECODE 2
@@ -614,14 +616,15 @@ struct drm_xe_engine_class_instance { · 4 unmodified lines
614616 * creating ordered queues of VM bind operations.
615617 */
616618 #define DRM_XE_ENGINE_CLASS_VM_BIND 5
619+ __u16 engine_class;
617620
618621 __u16 engine_instance;
619622 __u16 gt_id;
620623 };
621624
622625 struct drm_xe_engine_create {
623− /** @extensions: Pointer to the first extension struct, if any */
624626 #define XE_ENGINE_EXTENSION_SET_PROPERTY 0
627+ /** @extensions: Pointer to the first extension struct, if any */
625628 __u64 extensions;
626629
627630 /** @width: submission width (number BB per exec) for this engine */
@@ -659,8 +662,8 @@ struct drm_xe_engine_get_property { · 31 unmodified lines
659662 /** @engine_id: Engine ID */
660663 __u32 engine_id;
661664
662− /** @property: property to get */
663665 #define XE_ENGINE_GET_PROPERTY_BAN 0
666+ /** @property: property to get */
664667 __u32 property;
665668
666669 /** @value: property value */
@@ -685,19 +688,19 @@ struct drm_xe_sync { · 18 unmodified lines
685688 /** @extensions: Pointer to the first extension struct, if any */
686689 __u64 extensions;
687690
688− __u32 flags;
689−
690691 #define DRM_XE_SYNC_SYNCOBJ 0x0
691692 #define DRM_XE_SYNC_TIMELINE_SYNCOBJ 0x1
692693 #define DRM_XE_SYNC_DMA_BUF 0x2
693694 #define DRM_XE_SYNC_USER_FENCE 0x3
694695 #define DRM_XE_SYNC_SIGNAL 0x10
696+ __u32 flags;
695697
696698 /** @pad: MBZ */
697699 __u32 pad;
698700
699701 union {
700702 __u32 handle;
703+
701704 /**
702705 * @addr: Address of user fence. When sync passed in via exec
703706 * IOCTL this a GPU address in the VM. When sync passed in via
@@ -753,8 +756,6 @@ struct drm_xe_mmio { · 49 unmodified lines
753756
754757 __u32 addr;
755758
756− __u32 flags;
757−
758759 #define DRM_XE_MMIO_8BIT 0x0
759760 #define DRM_XE_MMIO_16BIT 0x1
760761 #define DRM_XE_MMIO_32BIT 0x2
@@ -762,6 +763,7 @@ struct drm_xe_mmio { · 1 unmodified line
762763 #define DRM_XE_MMIO_BITS_MASK 0x3
763764 #define DRM_XE_MMIO_READ 0x4
764765 #define DRM_XE_MMIO_WRITE 0x8
766+ __u32 flags;
765767
766768 __u64 value;
767769
@@ -781,47 +783,57 @@ struct drm_xe_mmio { · 13 unmodified lines
781783 struct drm_xe_wait_user_fence {
782784 /** @extensions: Pointer to the first extension struct, if any */
783785 __u64 extensions;
786+
784787 union {
785788 /**
786789 * @addr: user pointer address to wait on, must qword aligned
787790 */
788791 __u64 addr;
792+
789793 /**
790794 * @vm_id: The ID of the VM which encounter an error used with
791795 * DRM_XE_UFENCE_WAIT_VM_ERROR. Upper 32 bits must be clear.
792796 */
793797 __u64 vm_id;
794798 };
795− /** @op: wait operation (type of comparison) */
799+
796800 #define DRM_XE_UFENCE_WAIT_EQ 0
797801 #define DRM_XE_UFENCE_WAIT_NEQ 1
798802 #define DRM_XE_UFENCE_WAIT_GT 2
799803 #define DRM_XE_UFENCE_WAIT_GTE 3
800804 #define DRM_XE_UFENCE_WAIT_LT 4
801805 #define DRM_XE_UFENCE_WAIT_LTE 5
806+ /** @op: wait operation (type of comparison) */
802807 __u16 op;
803− /** @flags: wait flags */
808+
804809 #define DRM_XE_UFENCE_WAIT_SOFT_OP (1 << 0) /* e.g. Wait on VM bind */
805810 #define DRM_XE_UFENCE_WAIT_ABSTIME (1 << 1)
806811 #define DRM_XE_UFENCE_WAIT_VM_ERROR (1 << 2)
812+ /** @flags: wait flags */
807813 __u16 flags;
814+
808815 /** @pad: MBZ */
809816 __u32 pad;
817+
810818 /** @value: compare value */
811819 __u64 value;
812− /** @mask: comparison mask */
820+
813821 #define DRM_XE_UFENCE_WAIT_U8 0xffu
814822 #define DRM_XE_UFENCE_WAIT_U16 0xffffu
815823 #define DRM_XE_UFENCE_WAIT_U32 0xffffffffu
816824 #define DRM_XE_UFENCE_WAIT_U64 0xffffffffffffffffu
825+ /** @mask: comparison mask */
817826 __u64 mask;
827+
818828 /** @timeout: how long to wait before bailing, value in jiffies */
819829 __s64 timeout;
830+
820831 /**
821832 * @num_engines: number of engine instances to wait on, must be zero
822833 * when DRM_XE_UFENCE_WAIT_SOFT_OP set
823834 */
824835 __u64 num_engines;
836+
825837 /**
826838 * @instances: user pointer to array of drm_xe_engine_class_instance to
827839 * 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
882894 #define DRM_XE_VMA_PRIORITY_HIGH 2 /* Must be elevated user */
883895 /* Pin the VMA in memory, must be elevated user */
884896 #define DRM_XE_VM_MADVISE_PIN 6
885−
886897 /** @property: property to set */
887898 __u32 property;
888899

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