History

drm/xe/uapi: Add missing DRM_ prefix in uAPI constants

Most constants defined in xe_drm.h use DRM_XE_ as prefix which is helpful to identify the name space. Make this systematic and add this prefix where it was missing. v2: - fix vertical alignment of define values - remove double DRM_ in some variables (José Roberto de Souza) v3: Rebase

Francois Dugast committed 3 years ago

Commit d5dc73d1 parent b646ce98 files · +140 −140Browse files

Showing the changes to include/uapi/drm (1 of 8 files). Show all

Unified · Split

include/uapi/drm/xe_drm.h+62−62
@@ -19,12 +19,12 @@ extern "C" { · 18 unmodified lines
1919 /**
2020 * DOC: uevent generated by xe on it's pci node.
2121 *
22− * XE_RESET_FAILED_UEVENT - Event is generated when attempt to reset gt
22+ * DRM_XE_RESET_FAILED_UEVENT - Event is generated when attempt to reset gt
2323 * fails. The value supplied with the event is always "NEEDS_RESET".
2424 * Additional information supplied is tile id and gt id of the gt unit for
2525 * which reset has failed.
2626 */
27−#define XE_RESET_FAILED_UEVENT "DEVICE_STATUS"
27+#define DRM_XE_RESET_FAILED_UEVENT "DEVICE_STATUS"
2828
2929 /**
3030 * struct xe_user_extension - Base class for defining a chain of extensions
@@ -148,14 +148,14 @@ struct drm_xe_engine_class_instance { · 117 unmodified lines
148148 * enum drm_xe_memory_class - Supported memory classes.
149149 */
150150 enum drm_xe_memory_class {
151− /** @XE_MEM_REGION_CLASS_SYSMEM: Represents system memory. */
152− XE_MEM_REGION_CLASS_SYSMEM = 0,
151+ /** @DRM_XE_MEM_REGION_CLASS_SYSMEM: Represents system memory. */
152+ DRM_XE_MEM_REGION_CLASS_SYSMEM = 0,
153153 /**
154− * @XE_MEM_REGION_CLASS_VRAM: On discrete platforms, this
154+ * @DRM_XE_MEM_REGION_CLASS_VRAM: On discrete platforms, this
155155 * represents the memory that is local to the device, which we
156156 * call VRAM. Not valid on integrated platforms.
157157 */
158− XE_MEM_REGION_CLASS_VRAM
158+ DRM_XE_MEM_REGION_CLASS_VRAM
159159 };
160160
161161 /**
@@ -215,7 +215,7 @@ struct drm_xe_query_mem_region { · 53 unmodified lines
215215 * always equal the @total_size, since all of it will be CPU
216216 * accessible.
217217 *
218− * Note this is only tracked for XE_MEM_REGION_CLASS_VRAM
218+ * Note this is only tracked for DRM_XE_MEM_REGION_CLASS_VRAM
219219 * regions (for other types the value here will always equal
220220 * zero).
221221 */
@@ -227,7 +227,7 @@ struct drm_xe_query_mem_region { · 5 unmodified lines
227227 * Requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable
228228 * accounting. Without this the value here will always equal
229229 * zero. Note this is only currently tracked for
230− * XE_MEM_REGION_CLASS_VRAM regions (for other types the value
230+ * DRM_XE_MEM_REGION_CLASS_VRAM regions (for other types the value
231231 * here will always be zero).
232232 */
233233 __u64 cpu_visible_used;
@@ -320,12 +320,12 @@ struct drm_xe_query_config { · 86 unmodified lines
320320 /** @pad: MBZ */
321321 __u32 pad;
322322
323−#define XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0
324−#define XE_QUERY_CONFIG_FLAGS 1
325− #define XE_QUERY_CONFIG_FLAGS_HAS_VRAM (0x1 << 0)
326−#define XE_QUERY_CONFIG_MIN_ALIGNMENT 2
327−#define XE_QUERY_CONFIG_VA_BITS 3
328−#define XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
323+#define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0
324+#define DRM_XE_QUERY_CONFIG_FLAGS 1
325+ #define DRM_XE_QUERY_CONFIG_FLAGS_HAS_VRAM (0x1 << 0)
326+#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2
327+#define DRM_XE_QUERY_CONFIG_VA_BITS 3
328+#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
329329 /** @info: array of elements containing the config info */
330330 __u64 info[];
331331 };
@@ -339,8 +339,8 @@ struct drm_xe_query_config { · 7 unmodified lines
339339 * implementing graphics and/or media operations.
340340 */
341341 struct drm_xe_query_gt {
342−#define XE_QUERY_GT_TYPE_MAIN 0
343−#define XE_QUERY_GT_TYPE_MEDIA 1
342+#define DRM_XE_QUERY_GT_TYPE_MAIN 0
343+#define DRM_XE_QUERY_GT_TYPE_MEDIA 1
344344 /** @type: GT type: Main or Media */
345345 __u16 type;
346346 /** @gt_id: Unique ID of this GT within the PCI Device */
@@ -400,7 +400,7 @@ struct drm_xe_query_topology_mask { · 53 unmodified lines
400400 * DSS_GEOMETRY ff ff ff ff 00 00 00 00
401401 * means 32 DSS are available for geometry.
402402 */
403−#define XE_TOPO_DSS_GEOMETRY (1 << 0)
403+#define DRM_XE_TOPO_DSS_GEOMETRY (1 << 0)
404404 /*
405405 * To query the mask of Dual Sub Slices (DSS) available for compute
406406 * operations. For example a query response containing the following
@@ -408,7 +408,7 @@ struct drm_xe_query_topology_mask { · 1 unmodified line
408408 * DSS_COMPUTE ff ff ff ff 00 00 00 00
409409 * means 32 DSS are available for compute.
410410 */
411−#define XE_TOPO_DSS_COMPUTE (1 << 1)
411+#define DRM_XE_TOPO_DSS_COMPUTE (1 << 1)
412412 /*
413413 * To query the mask of Execution Units (EU) available per Dual Sub
414414 * Slices (DSS). For example a query response containing the following
@@ -416,7 +416,7 @@ struct drm_xe_query_topology_mask { · 1 unmodified line
416416 * EU_PER_DSS ff ff 00 00 00 00 00 00
417417 * means each DSS has 16 EU.
418418 */
419−#define XE_TOPO_EU_PER_DSS (1 << 2)
419+#define DRM_XE_TOPO_EU_PER_DSS (1 << 2)
420420 /** @type: type of mask */
421421 __u16 type;
422422
@@ -497,8 +497,8 @@ struct drm_xe_gem_create { · 74 unmodified lines
497497 */
498498 __u64 size;
499499
500−#define XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
501−#define XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
500+#define DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING (0x1 << 24)
501+#define DRM_XE_GEM_CREATE_FLAG_SCANOUT (0x1 << 25)
502502 /*
503503 * When using VRAM as a possible placement, ensure that the corresponding VRAM
504504 * allocation will always use the CPU accessible part of VRAM. This is important
@@ -514,7 +514,7 @@ struct drm_xe_gem_create { · 9 unmodified lines
514514 * display surfaces, therefore the kernel requires setting this flag for such
515515 * objects, otherwise an error is thrown on small-bar systems.
516516 */
517−#define XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM (0x1 << 26)
517+#define DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM (0x1 << 26)
518518 /**
519519 * @flags: Flags, currently a mask of memory instances of where BO can
520520 * be placed
@@ -581,14 +581,14 @@ struct drm_xe_ext_set_property { · 60 unmodified lines
581581 };
582582
583583 struct drm_xe_vm_create {
584−#define XE_VM_EXTENSION_SET_PROPERTY 0
584+#define DRM_XE_VM_EXTENSION_SET_PROPERTY 0
585585 /** @extensions: Pointer to the first extension struct, if any */
586586 __u64 extensions;
587587
588−#define DRM_XE_VM_CREATE_SCRATCH_PAGE (0x1 << 0)
589−#define DRM_XE_VM_CREATE_COMPUTE_MODE (0x1 << 1)
590−#define DRM_XE_VM_CREATE_ASYNC_DEFAULT (0x1 << 2)
591−#define DRM_XE_VM_CREATE_FAULT_MODE (0x1 << 3)
588+#define DRM_XE_VM_CREATE_SCRATCH_PAGE (0x1 << 0)
589+#define DRM_XE_VM_CREATE_COMPUTE_MODE (0x1 << 1)
590+#define DRM_XE_VM_CREATE_ASYNC_DEFAULT (0x1 << 2)
591+#define DRM_XE_VM_CREATE_FAULT_MODE (0x1 << 3)
592592 /** @flags: Flags */
593593 __u32 flags;
594594
@@ -644,29 +644,29 @@ struct drm_xe_vm_bind_op { · 49 unmodified lines
644644 */
645645 __u64 tile_mask;
646646
647−#define XE_VM_BIND_OP_MAP 0x0
648−#define XE_VM_BIND_OP_UNMAP 0x1
649−#define XE_VM_BIND_OP_MAP_USERPTR 0x2
650−#define XE_VM_BIND_OP_UNMAP_ALL 0x3
651−#define XE_VM_BIND_OP_PREFETCH 0x4
647+#define DRM_XE_VM_BIND_OP_MAP 0x0
648+#define DRM_XE_VM_BIND_OP_UNMAP 0x1
649+#define DRM_XE_VM_BIND_OP_MAP_USERPTR 0x2
650+#define DRM_XE_VM_BIND_OP_UNMAP_ALL 0x3
651+#define DRM_XE_VM_BIND_OP_PREFETCH 0x4
652652 /** @op: Bind operation to perform */
653653 __u32 op;
654654
655−#define XE_VM_BIND_FLAG_READONLY (0x1 << 0)
656−#define XE_VM_BIND_FLAG_ASYNC (0x1 << 1)
655+#define DRM_XE_VM_BIND_FLAG_READONLY (0x1 << 0)
656+#define DRM_XE_VM_BIND_FLAG_ASYNC (0x1 << 1)
657657 /*
658658 * Valid on a faulting VM only, do the MAP operation immediately rather
659659 * than deferring the MAP to the page fault handler.
660660 */
661−#define XE_VM_BIND_FLAG_IMMEDIATE (0x1 << 2)
661+#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (0x1 << 2)
662662 /*
663663 * When the NULL flag is set, the page tables are setup with a special
664664 * bit which indicates writes are dropped and all reads return zero. In
665− * the future, the NULL flags will only be valid for XE_VM_BIND_OP_MAP
665+ * the future, the NULL flags will only be valid for DRM_XE_VM_BIND_OP_MAP
666666 * operations, the BO handle MBZ, and the BO offset MBZ. This flag is
667667 * intended to implement VK sparse bindings.
668668 */
669−#define XE_VM_BIND_FLAG_NULL (0x1 << 3)
669+#define DRM_XE_VM_BIND_FLAG_NULL (0x1 << 3)
670670 /** @flags: Bind flags */
671671 __u32 flags;
672672
@@ -721,19 +721,19 @@ struct drm_xe_vm_bind { · 48 unmodified lines
721721 __u64 reserved[2];
722722 };
723723
724−/* For use with XE_EXEC_QUEUE_SET_PROPERTY_ACC_GRANULARITY */
724+/* For use with DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_GRANULARITY */
725725
726726 /* Monitor 128KB contiguous region with 4K sub-granularity */
727−#define XE_ACC_GRANULARITY_128K 0
727+#define DRM_XE_ACC_GRANULARITY_128K 0
728728
729729 /* Monitor 2MB contiguous region with 64KB sub-granularity */
730−#define XE_ACC_GRANULARITY_2M 1
730+#define DRM_XE_ACC_GRANULARITY_2M 1
731731
732732 /* Monitor 16MB contiguous region with 512KB sub-granularity */
733−#define XE_ACC_GRANULARITY_16M 2
733+#define DRM_XE_ACC_GRANULARITY_16M 2
734734
735735 /* Monitor 64MB contiguous region with 2M sub-granularity */
736−#define XE_ACC_GRANULARITY_64M 3
736+#define DRM_XE_ACC_GRANULARITY_64M 3
737737
738738 /**
739739 * struct drm_xe_exec_queue_set_property - exec queue set property
@@ -747,14 +747,14 @@ struct drm_xe_exec_queue_set_property { · 7 unmodified lines
747747 /** @exec_queue_id: Exec queue ID */
748748 __u32 exec_queue_id;
749749
750−#define XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY 0
751−#define XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE 1
752−#define XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT 2
753−#define XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE 3
754−#define XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT 4
755−#define XE_EXEC_QUEUE_SET_PROPERTY_ACC_TRIGGER 5
756−#define XE_EXEC_QUEUE_SET_PROPERTY_ACC_NOTIFY 6
757−#define XE_EXEC_QUEUE_SET_PROPERTY_ACC_GRANULARITY 7
750+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY 0
751+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE 1
752+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT 2
753+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE 3
754+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT 4
755+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_TRIGGER 5
756+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_NOTIFY 6
757+#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_GRANULARITY 7
758758 /** @property: property to set */
759759 __u32 property;
760760
@@ -766,7 +766,7 @@ struct drm_xe_exec_queue_set_property { · 5 unmodified lines
766766 };
767767
768768 struct drm_xe_exec_queue_create {
769−#define XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
769+#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
770770 /** @extensions: Pointer to the first extension struct, if any */
771771 __u64 extensions;
772772
@@ -805,7 +805,7 @@ struct drm_xe_exec_queue_get_property { · 32 unmodified lines
805805 /** @exec_queue_id: Exec queue ID */
806806 __u32 exec_queue_id;
807807
808−#define XE_EXEC_QUEUE_GET_PROPERTY_BAN 0
808+#define DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN 0
809809 /** @property: property to get */
810810 __u32 property;
811811
@@ -973,11 +973,11 @@ struct drm_xe_wait_user_fence { · 161 unmodified lines
973973 /**
974974 * DOC: XE PMU event config IDs
975975 *
976− * Check 'man perf_event_open' to use the ID's XE_PMU_XXXX listed in xe_drm.h
976+ * Check 'man perf_event_open' to use the ID's DRM_XE_PMU_XXXX listed in xe_drm.h
977977 * in 'struct perf_event_attr' as part of perf_event_open syscall to read a
978978 * particular event.
979979 *
980− * For example to open the XE_PMU_RENDER_GROUP_BUSY(0):
980+ * For example to open the DRMXE_PMU_RENDER_GROUP_BUSY(0):
981981 *
982982 * .. code-block:: C
983983 *
@@ -991,7 +991,7 @@ struct drm_xe_wait_user_fence { · 7 unmodified lines
991991 * attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED;
992992 * attr.use_clockid = 1;
993993 * attr.clockid = CLOCK_MONOTONIC;
994− * attr.config = XE_PMU_RENDER_GROUP_BUSY(0);
994+ * attr.config = DRM_XE_PMU_RENDER_GROUP_BUSY(0);
995995 *
996996 * fd = syscall(__NR_perf_event_open, &attr, -1, cpu, -1, 0);
997997 */
@@ -999,15 +999,15 @@ struct drm_xe_wait_user_fence { · 1 unmodified line
999999 /*
10001000 * Top bits of every counter are GT id.
10011001 */
1002−#define __XE_PMU_GT_SHIFT (56)
1002+#define __DRM_XE_PMU_GT_SHIFT (56)
10031003
1004−#define ___XE_PMU_OTHER(gt, x) \
1005− (((__u64)(x)) | ((__u64)(gt) << __XE_PMU_GT_SHIFT))
1004+#define ___DRM_XE_PMU_OTHER(gt, x) \
1005+ (((__u64)(x)) | ((__u64)(gt) << __DRM_XE_PMU_GT_SHIFT))
10061006
1007−#define XE_PMU_RENDER_GROUP_BUSY(gt) ___XE_PMU_OTHER(gt, 0)
1008−#define XE_PMU_COPY_GROUP_BUSY(gt) ___XE_PMU_OTHER(gt, 1)
1009−#define XE_PMU_MEDIA_GROUP_BUSY(gt) ___XE_PMU_OTHER(gt, 2)
1010−#define XE_PMU_ANY_ENGINE_GROUP_BUSY(gt) ___XE_PMU_OTHER(gt, 3)
1007+#define DRM_XE_PMU_RENDER_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 0)
1008+#define DRM_XE_PMU_COPY_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 1)
1009+#define DRM_XE_PMU_MEDIA_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 2)
1010+#define DRM_XE_PMU_ANY_ENGINE_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 3)
10111011
10121012 #if defined(__cplusplus)
10131013 }