| @@ -83,6 +83,7 @@ extern "C" { · 82 unmodified lines |
| 83 | * - &DRM_IOCTL_XE_OBSERVATION | 83 | * - &DRM_IOCTL_XE_OBSERVATION |
| 84 | * - &DRM_IOCTL_XE_MADVISE | 84 | * - &DRM_IOCTL_XE_MADVISE |
| 85 | * - &DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS | 85 | * - &DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS |
| | 86 | * - &DRM_IOCTL_XE_EXEC_QUEUE_SET_PROPERTY |
| 86 | * - &DRM_IOCTL_XE_VM_GET_PROPERTY | 87 | * - &DRM_IOCTL_XE_VM_GET_PROPERTY |
| 87 | */ | 88 | */ |
| 88 | | 89 | |
| @@ -167,7 +168,7 @@ extern "C" { · 78 unmodified lines |
| 167 | * Typically the struct drm_xe_user_extension would be embedded in some uAPI | 168 | * Typically the struct drm_xe_user_extension would be embedded in some uAPI |
| 168 | * struct, and in this case we would feed it the head of the chain(i.e ext1), | 169 | * struct, and in this case we would feed it the head of the chain(i.e ext1), |
| 169 | * which would then apply all of the above extensions. | 170 | * which would then apply all of the above extensions. |
| 170 | */ | 171 | */ |
| 171 | | 172 | |
| 172 | /** | 173 | /** |
| 173 | * struct drm_xe_user_extension - Base class for defining a chain of extensions | 174 | * struct drm_xe_user_extension - Base class for defining a chain of extensions |
| @@ -229,9 +230,9 @@ struct drm_xe_ext_set_property { · 55 unmodified lines |
| 229 | /** | 230 | /** |
| 230 | * struct drm_xe_engine_class_instance - instance of an engine class | 231 | * struct drm_xe_engine_class_instance - instance of an engine class |
| 231 | * | 232 | * |
| 232 | * It is returned as part of the @drm_xe_engine, but it also is used as | 233 | * It is returned as part of the &struct drm_xe_engine, but it also is used as |
| 233 | * the input of engine selection for both @drm_xe_exec_queue_create and | 234 | * the input of engine selection for both &struct drm_xe_exec_queue_create and |
| 234 | * @drm_xe_query_engine_cycles | 235 | * &struct drm_xe_query_engine_cycles |
| 235 | * | 236 | * |
| 236 | * The @engine_class can be: | 237 | * The @engine_class can be: |
| 237 | * - %DRM_XE_ENGINE_CLASS_RENDER | 238 | * - %DRM_XE_ENGINE_CLASS_RENDER |
| @@ -264,7 +265,7 @@ struct drm_xe_engine_class_instance { · 26 unmodified lines |
| 264 | * struct drm_xe_engine - describe hardware engine | 265 | * struct drm_xe_engine - describe hardware engine |
| 265 | */ | 266 | */ |
| 266 | struct drm_xe_engine { | 267 | struct drm_xe_engine { |
| 267 | /** @instance: The @drm_xe_engine_class_instance */ | 268 | /** @instance: The &struct drm_xe_engine_class_instance */ |
| 268 | struct drm_xe_engine_class_instance instance; | 269 | struct drm_xe_engine_class_instance instance; |
| 269 | | 270 | |
| 270 | /** @reserved: Reserved */ | 271 | /** @reserved: Reserved */ |
| @@ -274,9 +275,9 @@ struct drm_xe_engine { · 3 unmodified lines |
| 274 | /** | 275 | /** |
| 275 | * struct drm_xe_query_engines - describe engines | 276 | * struct drm_xe_query_engines - describe engines |
| 276 | * | 277 | * |
| 277 | * If a query is made with a struct @drm_xe_device_query where .query | 278 | * If a query is made with a &struct drm_xe_device_query where .query |
| 278 | * is equal to %DRM_XE_DEVICE_QUERY_ENGINES, then the reply uses an array of | 279 | * is equal to %DRM_XE_DEVICE_QUERY_ENGINES, then the reply uses an array of |
| 279 | * struct @drm_xe_query_engines in .data. | 280 | * &struct drm_xe_query_engines in .data. |
| 280 | */ | 281 | */ |
| 281 | struct drm_xe_query_engines { | 282 | struct drm_xe_query_engines { |
| 282 | /** @num_engines: number of engines returned in @engines */ | 283 | /** @num_engines: number of engines returned in @engines */ |
| @@ -349,7 +350,7 @@ struct drm_xe_mem_region { · 66 unmodified lines |
| 349 | * is smaller than @total_size then this is referred to as a | 350 | * is smaller than @total_size then this is referred to as a |
| 350 | * small BAR system. | 351 | * small BAR system. |
| 351 | * | 352 | * |
| 352 | * On systems without small BAR (full BAR), the probed_size will | 353 | * On systems without small BAR (full BAR), the @cpu_visible_size will |
| 353 | * always equal the @total_size, since all of it will be CPU | 354 | * always equal the @total_size, since all of it will be CPU |
| 354 | * accessible. | 355 | * accessible. |
| 355 | * | 356 | * |
| @@ -410,7 +411,7 @@ struct drm_xe_query_mem_regions { · 54 unmodified lines |
| 410 | * device supports the userspace hint %DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION. | 411 | * device supports the userspace hint %DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION. |
| 411 | * This is exposed only on Xe2+. | 412 | * This is exposed only on Xe2+. |
| 412 | * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_DISABLE_STATE_CACHE_PERF_FIX - Flag is set | 413 | * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_DISABLE_STATE_CACHE_PERF_FIX - Flag is set |
| 413 | * if a queue can be creaed with | 414 | * if a queue can be created with |
| 414 | * %DRM_XE_EXEC_QUEUE_SET_DISABLE_STATE_CACHE_PERF_FIX | 415 | * %DRM_XE_EXEC_QUEUE_SET_DISABLE_STATE_CACHE_PERF_FIX |
| 415 | * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment | 416 | * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment |
| 416 | * required by this device, typically SZ_4K or SZ_64K | 417 | * required by this device, typically SZ_4K or SZ_64K |
| @@ -705,7 +706,10 @@ struct drm_xe_query_pxp_status { · 288 unmodified lines |
| 705 | * attributes. | 706 | * attributes. |
| 706 | * - %DRM_XE_DEVICE_QUERY_GT_TOPOLOGY | 707 | * - %DRM_XE_DEVICE_QUERY_GT_TOPOLOGY |
| 707 | * - %DRM_XE_DEVICE_QUERY_ENGINE_CYCLES | 708 | * - %DRM_XE_DEVICE_QUERY_ENGINE_CYCLES |
| | 709 | * - %DRM_XE_DEVICE_QUERY_UC_FW_VERSION |
| | 710 | * - %DRM_XE_DEVICE_QUERY_OA_UNITS |
| 708 | * - %DRM_XE_DEVICE_QUERY_PXP_STATUS | 711 | * - %DRM_XE_DEVICE_QUERY_PXP_STATUS |
| | 712 | * - %DRM_XE_DEVICE_QUERY_EU_STALL |
| 709 | * | 713 | * |
| 710 | * If size is set to 0, the driver fills it with the required size for | 714 | * If size is set to 0, the driver fills it with the required size for |
| 711 | * the requested type of data to query. If size is equal to the required | 715 | * the requested type of data to query. If size is equal to the required |
| @@ -825,7 +829,7 @@ struct drm_xe_device_query { · 113 unmodified lines |
| 825 | * | 829 | * |
| 826 | * This ioctl supports setting the following properties via the | 830 | * This ioctl supports setting the following properties via the |
| 827 | * %DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY extension, which uses the | 831 | * %DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY extension, which uses the |
| 828 | * generic @drm_xe_ext_set_property struct: | 832 | * generic &struct drm_xe_ext_set_property: |
| 829 | * | 833 | * |
| 830 | * - %DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE - set the type of PXP session | 834 | * - %DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE - set the type of PXP session |
| 831 | * this object will be used with. Valid values are listed in enum | 835 | * this object will be used with. Valid values are listed in enum |
| @@ -862,8 +866,7 @@ struct drm_xe_gem_create { · 30 unmodified lines |
| 862 | #define DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM (1 << 2) | 866 | #define DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM (1 << 2) |
| 863 | #define DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION (1 << 3) | 867 | #define DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION (1 << 3) |
| 864 | /** | 868 | /** |
| 865 | * @flags: Flags, currently a mask of memory instances of where BO can | 869 | * @flags: Flags for the GEM object, see DRM_XE_GEM_CREATE_FLAG_* |
| 866 | * be placed | | |
| 867 | */ | 870 | */ |
| 868 | __u32 flags; | 871 | __u32 flags; |
| 869 | | 872 | |
| @@ -888,7 +891,7 @@ struct drm_xe_gem_create { · 18 unmodified lines |
| 888 | #define DRM_XE_GEM_CPU_CACHING_WC 2 | 891 | #define DRM_XE_GEM_CPU_CACHING_WC 2 |
| 889 | /** | 892 | /** |
| 890 | * @cpu_caching: The CPU caching mode to select for this object. If | 893 | * @cpu_caching: The CPU caching mode to select for this object. If |
| 891 | * mmaping the object the mode selected here will also be used. The | 894 | * mmapping the object the mode selected here will also be used. The |
| 892 | * exception is when mapping system memory (including data evicted | 895 | * exception is when mapping system memory (including data evicted |
| 893 | * to system) on discrete GPUs. The caching mode selected will | 896 | * to system) on discrete GPUs. The caching mode selected will |
| 894 | * then be overridden to DRM_XE_GEM_CPU_CACHING_WB, and coherency | 897 | * then be overridden to DRM_XE_GEM_CPU_CACHING_WB, and coherency |
| @@ -931,7 +934,7 @@ struct drm_xe_gem_create { · 36 unmodified lines |
| 931 | * | 934 | * |
| 932 | * err = ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo); | 935 | * err = ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo); |
| 933 | * map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo.offset); | 936 | * map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo.offset); |
| 934 | * map[i] = 0xdeadbeaf; // issue barrier | 937 | * map[i] = 0xdeadbeef; // issue barrier |
| 935 | */ | 938 | */ |
| 936 | struct drm_xe_gem_mmap_offset { | 939 | struct drm_xe_gem_mmap_offset { |
| 937 | /** @extensions: Pointer to the first extension struct, if any */ | 940 | /** @extensions: Pointer to the first extension struct, if any */ |
| @@ -958,8 +961,8 @@ struct drm_xe_gem_mmap_offset { · 20 unmodified lines |
| 958 | * - %DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE - Map the whole virtual address | 961 | * - %DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE - Map the whole virtual address |
| 959 | * space of the VM to scratch page. A vm_bind would overwrite the scratch | 962 | * space of the VM to scratch page. A vm_bind would overwrite the scratch |
| 960 | * page mapping. This flag is mutually exclusive with the | 963 | * page mapping. This flag is mutually exclusive with the |
| 961 | * %DRM_XE_VM_CREATE_FLAG_FAULT_MODE flag, with an exception of on x2 and | 964 | * %DRM_XE_VM_CREATE_FLAG_FAULT_MODE flag, with an exception on Xe2 and |
| 962 | * xe3 platform. | 965 | * Xe3 platforms. |
| 963 | * - %DRM_XE_VM_CREATE_FLAG_LR_MODE - An LR, or Long Running VM accepts | 966 | * - %DRM_XE_VM_CREATE_FLAG_LR_MODE - An LR, or Long Running VM accepts |
| 964 | * exec submissions to its exec_queues that don't have an upper time | 967 | * exec submissions to its exec_queues that don't have an upper time |
| 965 | * limit on the job execution time. But exec submissions to these | 968 | * limit on the job execution time. But exec submissions to these |
| @@ -1045,7 +1048,7 @@ struct drm_xe_vm_destroy { · 79 unmodified lines |
| 1045 | * set, no mappings are created rather the range is reserved for CPU address | 1048 | * set, no mappings are created rather the range is reserved for CPU address |
| 1046 | * mirroring which will be populated on GPU page faults or prefetches. Only | 1049 | * mirroring which will be populated on GPU page faults or prefetches. Only |
| 1047 | * valid on VMs with DRM_XE_VM_CREATE_FLAG_FAULT_MODE set. The CPU address | 1050 | * valid on VMs with DRM_XE_VM_CREATE_FLAG_FAULT_MODE set. The CPU address |
| 1048 | * mirror flag are only valid for DRM_XE_VM_BIND_OP_MAP operations, the BO | 1051 | * mirror flag is only valid for DRM_XE_VM_BIND_OP_MAP operations, the BO |
| 1049 | * handle MBZ, and the BO offset MBZ. | 1052 | * handle MBZ, and the BO offset MBZ. |
| 1050 | * - %DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET - Can be used in combination with | 1053 | * - %DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET - Can be used in combination with |
| 1051 | * %DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR to reset madvises when the underlying | 1054 | * %DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR to reset madvises when the underlying |
| @@ -1061,6 +1064,7 @@ struct drm_xe_vm_destroy { · 9 unmodified lines |
| 1061 | * not invoke autoreset. Neither will stack variables going out of scope. | 1064 | * not invoke autoreset. Neither will stack variables going out of scope. |
| 1062 | * Therefore it's recommended to always explicitly reset the madvises when | 1065 | * Therefore it's recommended to always explicitly reset the madvises when |
| 1063 | * freeing the memory backing a region used in a &DRM_IOCTL_XE_MADVISE call. | 1066 | * freeing the memory backing a region used in a &DRM_IOCTL_XE_MADVISE call. |
| | 1067 | * |
| 1064 | * - %DRM_XE_VM_BIND_FLAG_DECOMPRESS - Request on-device decompression for a MAP. | 1068 | * - %DRM_XE_VM_BIND_FLAG_DECOMPRESS - Request on-device decompression for a MAP. |
| 1065 | * When set on a MAP bind operation, request the driver schedule an on-device | 1069 | * When set on a MAP bind operation, request the driver schedule an on-device |
| 1066 | * in-place decompression (via the migrate/resolve path) for the GPU mapping | 1070 | * in-place decompression (via the migrate/resolve path) for the GPU mapping |
| @@ -1109,7 +1113,7 @@ struct drm_xe_vm_bind_op { · 42 unmodified lines |
| 1109 | * ppGTT WT -> COH_NONE | 1113 | * ppGTT WT -> COH_NONE |
| 1110 | * ppGTT WB -> COH_AT_LEAST_1WAY | 1114 | * ppGTT WB -> COH_AT_LEAST_1WAY |
| 1111 | * | 1115 | * |
| 1112 | * In practice UC/WC/WT should only ever used for scanout surfaces on | 1116 | * In practice UC/WC/WT should only ever be used for scanout surfaces on |
| 1113 | * such platforms (or perhaps in general for dma-buf if shared with | 1117 | * such platforms (or perhaps in general for dma-buf if shared with |
| 1114 | * another device) since it is only the display engine that is actually | 1118 | * another device) since it is only the display engine that is actually |
| 1115 | * incoherent. Everything else should typically use WB given that we | 1119 | * incoherent. Everything else should typically use WB given that we |
| @@ -1199,10 +1203,10 @@ struct drm_xe_vm_bind_op { · 83 unmodified lines |
| 1199 | /** | 1203 | /** |
| 1200 | * struct drm_xe_vm_bind - Input of &DRM_IOCTL_XE_VM_BIND | 1204 | * struct drm_xe_vm_bind - Input of &DRM_IOCTL_XE_VM_BIND |
| 1201 | * | 1205 | * |
| 1202 | * Below is an example of a minimal use of @drm_xe_vm_bind to | 1206 | * Below is an example of a minimal use of &struct drm_xe_vm_bind to |
| 1203 | * asynchronously bind the buffer `data` at address `BIND_ADDRESS` to | 1207 | * asynchronously bind the buffer `data` at address `BIND_ADDRESS` to |
| 1204 | * illustrate `userptr`. It can be synchronized by using the example | 1208 | * illustrate `userptr`. It can be synchronized by using the example |
| 1205 | * provided for @drm_xe_sync. | 1209 | * provided for &struct drm_xe_sync. |
| 1206 | * | 1210 | * |
| 1207 | * .. code-block:: C | 1211 | * .. code-block:: C |
| 1208 | * | 1212 | * |
| @@ -1355,7 +1359,7 @@ struct drm_xe_vm_get_property { · 146 unmodified lines |
| 1355 | * | 1359 | * |
| 1356 | * This ioctl supports setting the following properties via the | 1360 | * This ioctl supports setting the following properties via the |
| 1357 | * %DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY extension, which uses the | 1361 | * %DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY extension, which uses the |
| 1358 | * generic @drm_xe_ext_set_property struct: | 1362 | * generic &struct drm_xe_ext_set_property: |
| 1359 | * | 1363 | * |
| 1360 | * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY - set the queue priority. | 1364 | * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY - set the queue priority. |
| 1361 | * CAP_SYS_NICE is required to set a value above normal. | 1365 | * CAP_SYS_NICE is required to set a value above normal. |
| @@ -1366,7 +1370,7 @@ struct drm_xe_vm_get_property { · 4 unmodified lines |
| 1366 | * drm_xe_pxp_session_type. %DRM_XE_PXP_TYPE_NONE is the default behavior, so | 1370 | * drm_xe_pxp_session_type. %DRM_XE_PXP_TYPE_NONE is the default behavior, so |
| 1367 | * there is no need to explicitly set that. When a queue of type | 1371 | * there is no need to explicitly set that. When a queue of type |
| 1368 | * %DRM_XE_PXP_TYPE_HWDRM is created, the PXP default HWDRM session | 1372 | * %DRM_XE_PXP_TYPE_HWDRM is created, the PXP default HWDRM session |
| 1369 | * (%XE_PXP_HWDRM_DEFAULT_SESSION) will be started, if isn't already running. | 1373 | * (%DRM_XE_PXP_HWDRM_DEFAULT_SESSION) will be started, if it isn't already running. |
| 1370 | * The user is expected to query the PXP status via the query ioctl (see | 1374 | * The user is expected to query the PXP status via the query ioctl (see |
| 1371 | * %DRM_XE_DEVICE_QUERY_PXP_STATUS) and to wait for PXP to be ready before | 1375 | * %DRM_XE_DEVICE_QUERY_PXP_STATUS) and to wait for PXP to be ready before |
| 1372 | * attempting to create a queue with this property. When a queue is created | 1376 | * attempting to create a queue with this property. When a queue is created |
| @@ -1390,9 +1394,9 @@ struct drm_xe_vm_get_property { · 17 unmodified lines |
| 1390 | * enable render color cache keying on BTP+BTI instead of just BTI | 1394 | * enable render color cache keying on BTP+BTI instead of just BTI |
| 1391 | * (only valid for render queues). | 1395 | * (only valid for render queues). |
| 1392 | * | 1396 | * |
| 1393 | * The example below shows how to use @drm_xe_exec_queue_create to create | 1397 | * The example below shows how to use &struct drm_xe_exec_queue_create to create |
| 1394 | * a simple exec_queue (no parallel submission) of class | 1398 | * a simple exec_queue (no parallel submission) of class |
| 1395 | * &DRM_XE_ENGINE_CLASS_RENDER. | 1399 | * %DRM_XE_ENGINE_CLASS_RENDER. |
| 1396 | * | 1400 | * |
| 1397 | * .. code-block:: C | 1401 | * .. code-block:: C |
| 1398 | * | 1402 | * |
| @@ -1402,23 +1406,25 @@ struct drm_xe_vm_get_property { · 3 unmodified lines |
| 1402 | * struct drm_xe_exec_queue_create exec_queue_create = { | 1406 | * struct drm_xe_exec_queue_create exec_queue_create = { |
| 1403 | * .extensions = 0, | 1407 | * .extensions = 0, |
| 1404 | * .vm_id = vm, | 1408 | * .vm_id = vm, |
| 1405 | * .num_bb_per_exec = 1, | 1409 | * .width = 1, |
| 1406 | * .num_eng_per_bb = 1, | 1410 | * .num_placements = 1, |
| 1407 | * .instances = to_user_pointer(&instance), | 1411 | * .instances = to_user_pointer(&instance), |
| 1408 | * }; | 1412 | * }; |
| 1409 | * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create); | 1413 | * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create); |
| 1410 | * | 1414 | * |
| 1411 | * Allow users to provide a hint to kernel for cases demanding low latency | 1415 | * Allow users to provide a hint to kernel for cases demanding low latency |
| 1412 | * profile. Please note it will have impact on power consumption. User can | 1416 | * profile. Please note it will have impact on power consumption. User can |
| 1413 | * indicate low latency hint with flag while creating exec queue as | 1417 | * indicate low latency hint with flag while creating exec queue as |
| 1414 | * mentioned below, | 1418 | * mentioned below: |
| | 1419 | * |
| | 1420 | * .. code-block:: C |
| 1415 | * | 1421 | * |
| 1416 | * struct drm_xe_exec_queue_create exec_queue_create = { | 1422 | * struct drm_xe_exec_queue_create exec_queue_create = { |
| 1417 | * .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT, | 1423 | * .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT, |
| 1418 | * .extensions = 0, | 1424 | * .extensions = 0, |
| 1419 | * .vm_id = vm, | 1425 | * .vm_id = vm, |
| 1420 | * .num_bb_per_exec = 1, | 1426 | * .width = 1, |
| 1421 | * .num_eng_per_bb = 1, | 1427 | * .num_placements = 1, |
| 1422 | * .instances = to_user_pointer(&instance), | 1428 | * .instances = to_user_pointer(&instance), |
| 1423 | * }; | 1429 | * }; |
| 1424 | * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create); | 1430 | * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create); |
| @@ -1515,7 +1521,7 @@ struct drm_xe_exec_queue_get_property { · 90 unmodified lines |
| 1515 | * and the @flags can be: | 1521 | * and the @flags can be: |
| 1516 | * - %DRM_XE_SYNC_FLAG_SIGNAL | 1522 | * - %DRM_XE_SYNC_FLAG_SIGNAL |
| 1517 | * | 1523 | * |
| 1518 | * A minimal use of @drm_xe_sync looks like this: | 1524 | * A minimal use of &struct drm_xe_sync looks like this: |
| 1519 | * | 1525 | * |
| 1520 | * .. code-block:: C | 1526 | * .. code-block:: C |
| 1521 | * | 1527 | * |
| @@ -1546,7 +1552,7 @@ struct drm_xe_sync { · 24 unmodified lines |
| 1546 | #define DRM_XE_SYNC_TYPE_SYNCOBJ 0x0 | 1552 | #define DRM_XE_SYNC_TYPE_SYNCOBJ 0x0 |
| 1547 | #define DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ 0x1 | 1553 | #define DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ 0x1 |
| 1548 | #define DRM_XE_SYNC_TYPE_USER_FENCE 0x2 | 1554 | #define DRM_XE_SYNC_TYPE_USER_FENCE 0x2 |
| 1549 | /** @type: Type of the this sync object */ | 1555 | /** @type: Type of this sync object */ |
| 1550 | __u32 type; | 1556 | __u32 type; |
| 1551 | | 1557 | |
| 1552 | #define DRM_XE_SYNC_FLAG_SIGNAL (1 << 0) | 1558 | #define DRM_XE_SYNC_FLAG_SIGNAL (1 << 0) |
| @@ -1559,9 +1565,9 @@ struct drm_xe_sync { · 6 unmodified lines |
| 1559 | | 1565 | |
| 1560 | /** | 1566 | /** |
| 1561 | * @addr: Address of user fence. When sync is passed in via exec | 1567 | * @addr: Address of user fence. When sync is passed in via exec |
| 1562 | * IOCTL this is a GPU address in the VM. When sync passed in via | 1568 | * IOCTL this is a GPU address in the VM. When sync is passed in via |
| 1563 | * VM bind IOCTL this is a user pointer. In either case, it is | 1569 | * VM bind IOCTL this is a user pointer. In either case, it is |
| 1564 | * the users responsibility that this address is present and | 1570 | * the user's responsibility that this address is present and |
| 1565 | * mapped when the user fence is signalled. Must be qword | 1571 | * mapped when the user fence is signalled. Must be qword |
| 1566 | * aligned. | 1572 | * aligned. |
| 1567 | */ | 1573 | */ |
| @@ -1581,10 +1587,10 @@ struct drm_xe_sync { · 13 unmodified lines |
| 1581 | /** | 1587 | /** |
| 1582 | * struct drm_xe_exec - Input of &DRM_IOCTL_XE_EXEC | 1588 | * struct drm_xe_exec - Input of &DRM_IOCTL_XE_EXEC |
| 1583 | * | 1589 | * |
| 1584 | * This is an example to use @drm_xe_exec for execution of the object | 1590 | * This is an example to use &struct drm_xe_exec for execution of the object |
| 1585 | * at BIND_ADDRESS (see example in @drm_xe_vm_bind) by an exec_queue | 1591 | * at BIND_ADDRESS (see example in &struct drm_xe_vm_bind) by an exec_queue |
| 1586 | * (see example in @drm_xe_exec_queue_create). It can be synchronized | 1592 | * (see example in &struct drm_xe_exec_queue_create). It can be synchronized |
| 1587 | * by using the example provided for @drm_xe_sync. | 1593 | * by using the example provided for &struct drm_xe_sync. |
| 1588 | * | 1594 | * |
| 1589 | * .. code-block:: C | 1595 | * .. code-block:: C |
| 1590 | * | 1596 | * |
| @@ -1651,7 +1657,6 @@ struct drm_xe_exec { · 60 unmodified lines |
| 1651 | * | 1657 | * |
| 1652 | * and the @flags can be: | 1658 | * and the @flags can be: |
| 1653 | * - %DRM_XE_UFENCE_WAIT_FLAG_ABSTIME | 1659 | * - %DRM_XE_UFENCE_WAIT_FLAG_ABSTIME |
| 1654 | * - %DRM_XE_UFENCE_WAIT_FLAG_SOFT_OP | | |
| 1655 | * | 1660 | * |
| 1656 | * The @mask values can be for example: | 1661 | * The @mask values can be for example: |
| 1657 | * - 0xffu for u8 | 1662 | * - 0xffu for u8 |
| @@ -1664,7 +1669,7 @@ struct drm_xe_wait_user_fence { · 6 unmodified lines |
| 1664 | __u64 extensions; | 1669 | __u64 extensions; |
| 1665 | | 1670 | |
| 1666 | /** | 1671 | /** |
| 1667 | * @addr: user pointer address to wait on, must qword aligned | 1672 | * @addr: user pointer address to wait on, must be qword aligned |
| 1668 | */ | 1673 | */ |
| 1669 | __u64 addr; | 1674 | __u64 addr; |
| 1670 | | 1675 | |
| @@ -1695,9 +1700,9 @@ struct drm_xe_wait_user_fence { · 24 unmodified lines |
| 1695 | * Without DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flag set (relative timeout) | 1700 | * Without DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flag set (relative timeout) |
| 1696 | * it contains timeout expressed in nanoseconds to wait (fence will | 1701 | * it contains timeout expressed in nanoseconds to wait (fence will |
| 1697 | * expire at now() + timeout). | 1702 | * expire at now() + timeout). |
| 1698 | * When DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flat is set (absolute timeout) wait | 1703 | * When DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flag is set (absolute timeout) wait |
| 1699 | * will end at timeout (uses system MONOTONIC_CLOCK). | 1704 | * will end at timeout (uses system CLOCK_MONOTONIC). |
| 1700 | * Passing negative timeout leads to neverending wait. | 1705 | * Passing negative timeout leads to never ending wait. |
| 1701 | * | 1706 | * |
| 1702 | * On relative timeout this value is updated with timeout left | 1707 | * On relative timeout this value is updated with timeout left |
| 1703 | * (for restarting the call in case of signal delivery). | 1708 | * (for restarting the call in case of signal delivery). |
| @@ -1741,7 +1746,7 @@ enum drm_xe_observation_op { · 37 unmodified lines |
| 1741 | }; | 1746 | }; |
| 1742 | | 1747 | |
| 1743 | /** | 1748 | /** |
| 1744 | * struct drm_xe_observation_param - Input of &DRM_XE_OBSERVATION | 1749 | * struct drm_xe_observation_param - Input of &DRM_IOCTL_XE_OBSERVATION |
| 1745 | * | 1750 | * |
| 1746 | * The observation layer enables multiplexing observation streams of | 1751 | * The observation layer enables multiplexing observation streams of |
| 1747 | * multiple types. The actual params for a particular stream operation are | 1752 | * multiple types. The actual params for a particular stream operation are |
| @@ -1751,25 +1756,25 @@ enum drm_xe_observation_op { · 3 unmodified lines |
| 1751 | struct drm_xe_observation_param { | 1756 | struct drm_xe_observation_param { |
| 1752 | /** @extensions: Pointer to the first extension struct, if any */ | 1757 | /** @extensions: Pointer to the first extension struct, if any */ |
| 1753 | __u64 extensions; | 1758 | __u64 extensions; |
| 1754 | /** @observation_type: observation stream type, of enum @drm_xe_observation_type */ | 1759 | /** @observation_type: observation stream type, of &enum drm_xe_observation_type */ |
| 1755 | __u64 observation_type; | 1760 | __u64 observation_type; |
| 1756 | /** @observation_op: observation stream op, of enum @drm_xe_observation_op */ | 1761 | /** @observation_op: observation stream op, of &enum drm_xe_observation_op */ |
| 1757 | __u64 observation_op; | 1762 | __u64 observation_op; |
| 1758 | /** @param: Pointer to actual stream params */ | 1763 | /** @param: Pointer to actual stream params */ |
| 1759 | __u64 param; | 1764 | __u64 param; |
| 1760 | }; | 1765 | }; |
| 1761 | | 1766 | |
| 1762 | /** | 1767 | /** |
| 1763 | * enum drm_xe_observation_ioctls - Observation stream fd ioctl's | 1768 | * enum drm_xe_observation_ioctls - Observation stream fd ioctls |
| 1764 | * | 1769 | * |
| 1765 | * Information exchanged between userspace and kernel for observation fd | 1770 | * Information exchanged between userspace and kernel for observation fd |
| 1766 | * ioctl's is stream type specific | 1771 | * ioctls is stream type specific |
| 1767 | */ | 1772 | */ |
| 1768 | enum drm_xe_observation_ioctls { | 1773 | enum drm_xe_observation_ioctls { |
| 1769 | /** @DRM_XE_OBSERVATION_IOCTL_ENABLE: Enable data capture for an observation stream */ | 1774 | /** @DRM_XE_OBSERVATION_IOCTL_ENABLE: Enable data capture for an observation stream */ |
| 1770 | DRM_XE_OBSERVATION_IOCTL_ENABLE = _IO('i', 0x0), | 1775 | DRM_XE_OBSERVATION_IOCTL_ENABLE = _IO('i', 0x0), |
| 1771 | | 1776 | |
| 1772 | /** @DRM_XE_OBSERVATION_IOCTL_DISABLE: Disable data capture for a observation stream */ | 1777 | /** @DRM_XE_OBSERVATION_IOCTL_DISABLE: Disable data capture for an observation stream */ |
| 1773 | DRM_XE_OBSERVATION_IOCTL_DISABLE = _IO('i', 0x1), | 1778 | DRM_XE_OBSERVATION_IOCTL_DISABLE = _IO('i', 0x1), |
| 1774 | | 1779 | |
| 1775 | /** @DRM_XE_OBSERVATION_IOCTL_CONFIG: Change observation stream configuration */ | 1780 | /** @DRM_XE_OBSERVATION_IOCTL_CONFIG: Change observation stream configuration */ |
| @@ -1812,7 +1817,7 @@ struct drm_xe_oa_unit { · 36 unmodified lines |
| 1812 | /** @oa_unit_id: OA unit ID */ | 1817 | /** @oa_unit_id: OA unit ID */ |
| 1813 | __u32 oa_unit_id; | 1818 | __u32 oa_unit_id; |
| 1814 | | 1819 | |
| 1815 | /** @oa_unit_type: OA unit type of @drm_xe_oa_unit_type */ | 1820 | /** @oa_unit_type: OA unit type of &enum drm_xe_oa_unit_type */ |
| 1816 | __u32 oa_unit_type; | 1821 | __u32 oa_unit_type; |
| 1817 | | 1822 | |
| 1818 | /** @capabilities: OA capabilities bit-mask */ | 1823 | /** @capabilities: OA capabilities bit-mask */ |
| @@ -1875,7 +1880,7 @@ struct drm_xe_query_oa_units { · 56 unmodified lines |
| 1875 | /** @pad: MBZ */ | 1880 | /** @pad: MBZ */ |
| 1876 | __u32 pad; | 1881 | __u32 pad; |
| 1877 | /** | 1882 | /** |
| 1878 | * @oa_units: struct @drm_xe_oa_unit array returned for this device. | 1883 | * @oa_units: &struct drm_xe_oa_unit array returned for this device. |
| 1879 | * Written below as a u64 array to avoid problems with nested flexible | 1884 | * Written below as a u64 array to avoid problems with nested flexible |
| 1880 | * arrays with some compilers | 1885 | * arrays with some compilers |
| 1881 | */ | 1886 | */ |
| @@ -1902,24 +1907,24 @@ enum drm_xe_oa_format_type { · 20 unmodified lines |
| 1902 | }; | 1907 | }; |
| 1903 | | 1908 | |
| 1904 | /** | 1909 | /** |
| 1905 | * enum drm_xe_oa_property_id - OA stream property id's | 1910 | * enum drm_xe_oa_property_id - OA stream property IDs |
| 1906 | * | 1911 | * |
| 1907 | * Stream params are specified as a chain of @drm_xe_ext_set_property | 1912 | * Stream params are specified as a chain of &struct drm_xe_ext_set_property |
| 1908 | * struct's, with @property values from enum @drm_xe_oa_property_id and | 1913 | * structs, with property values from &enum drm_xe_oa_property_id and |
| 1909 | * @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY. | 1914 | * &struct drm_xe_user_extension base.name set to %DRM_XE_OA_EXTENSION_SET_PROPERTY. |
| 1910 | * @param field in struct @drm_xe_observation_param points to the first | 1915 | * The param field in &struct drm_xe_observation_param points to the first |
| 1911 | * @drm_xe_ext_set_property struct. | 1916 | * &struct drm_xe_ext_set_property struct. |
| 1912 | * | 1917 | * |
| 1913 | * Exactly the same mechanism is also used for stream reconfiguration using the | 1918 | * Exactly the same mechanism is also used for stream reconfiguration using the |
| 1914 | * @DRM_XE_OBSERVATION_IOCTL_CONFIG observation stream fd ioctl, though only a | 1919 | * %DRM_XE_OBSERVATION_IOCTL_CONFIG observation stream fd ioctl, though only a |
| 1915 | * subset of properties below can be specified for stream reconfiguration. | 1920 | * subset of properties below can be specified for stream reconfiguration. |
| 1916 | */ | 1921 | */ |
| 1917 | enum drm_xe_oa_property_id { | 1922 | enum drm_xe_oa_property_id { |
| 1918 | #define DRM_XE_OA_EXTENSION_SET_PROPERTY 0 | 1923 | #define DRM_XE_OA_EXTENSION_SET_PROPERTY 0 |
| 1919 | /** | 1924 | /** |
| 1920 | * @DRM_XE_OA_PROPERTY_OA_UNIT_ID: ID of the OA unit on which to open | 1925 | * @DRM_XE_OA_PROPERTY_OA_UNIT_ID: ID of the OA unit on which to open |
| 1921 | * the OA stream, see @oa_unit_id in 'struct | 1926 | * the OA stream, see oa_unit_id in &struct drm_xe_oa_unit. |
| 1922 | * drm_xe_query_oa_units'. Defaults to 0 if not provided. | 1927 | * Defaults to 0 if not provided. |
| 1923 | */ | 1928 | */ |
| 1924 | DRM_XE_OA_PROPERTY_OA_UNIT_ID = 1, | 1929 | DRM_XE_OA_PROPERTY_OA_UNIT_ID = 1, |
| 1925 | | 1930 | |
| @@ -1932,7 +1937,7 @@ enum drm_xe_oa_property_id { · 6 unmodified lines |
| 1932 | | 1937 | |
| 1933 | /** | 1938 | /** |
| 1934 | * @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA | 1939 | * @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA |
| 1935 | * reports, previously added via @DRM_XE_OBSERVATION_OP_ADD_CONFIG. | 1940 | * reports, previously added via %DRM_XE_OBSERVATION_OP_ADD_CONFIG. |
| 1936 | */ | 1941 | */ |
| 1937 | DRM_XE_OA_PROPERTY_OA_METRIC_SET, | 1942 | DRM_XE_OA_PROPERTY_OA_METRIC_SET, |
| 1938 | | 1943 | |
| @@ -1940,7 +1945,7 @@ enum drm_xe_oa_property_id { · 1 unmodified line |
| 1940 | DRM_XE_OA_PROPERTY_OA_FORMAT, | 1945 | DRM_XE_OA_PROPERTY_OA_FORMAT, |
| 1941 | /* | 1946 | /* |
| 1942 | * OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942, | 1947 | * OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942, |
| 1943 | * in terms of the following quantities: a. enum @drm_xe_oa_format_type | 1948 | * in terms of the following quantities: a. &enum drm_xe_oa_format_type |
| 1944 | * b. Counter select c. Counter size and d. BC report. Also refer to the | 1949 | * b. Counter select c. Counter size and d. BC report. Also refer to the |
| 1945 | * oa_formats array in drivers/gpu/drm/xe/xe_oa.c. | 1950 | * oa_formats array in drivers/gpu/drm/xe/xe_oa.c. |
| 1946 | */ | 1951 | */ |
| @@ -1957,19 +1962,19 @@ enum drm_xe_oa_property_id { · 10 unmodified lines |
| 1957 | | 1962 | |
| 1958 | /** | 1963 | /** |
| 1959 | * @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA | 1964 | * @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA |
| 1960 | * stream in a DISABLED state (see @DRM_XE_OBSERVATION_IOCTL_ENABLE). | 1965 | * stream in a DISABLED state (see %DRM_XE_OBSERVATION_IOCTL_ENABLE). |
| 1961 | */ | 1966 | */ |
| 1962 | DRM_XE_OA_PROPERTY_OA_DISABLED, | 1967 | DRM_XE_OA_PROPERTY_OA_DISABLED, |
| 1963 | | 1968 | |
| 1964 | /** | 1969 | /** |
| 1965 | * @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific | 1970 | * @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific |
| 1966 | * @exec_queue_id. OA queries can be executed on this exec queue. | 1971 | * exec_queue_id. OA queries can be executed on this exec queue. |
| 1967 | */ | 1972 | */ |
| 1968 | DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID, | 1973 | DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID, |
| 1969 | | 1974 | |
| 1970 | /** | 1975 | /** |
| 1971 | * @DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE: Optional engine instance to | 1976 | * @DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE: Optional engine instance to |
| 1972 | * pass along with @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID or will default to 0. | 1977 | * pass along with %DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID or will default to 0. |
| 1973 | */ | 1978 | */ |
| 1974 | DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE, | 1979 | DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE, |
| 1975 | | 1980 | |
| @@ -1981,16 +1986,16 @@ enum drm_xe_oa_property_id { · 5 unmodified lines |
| 1981 | | 1986 | |
| 1982 | /** | 1987 | /** |
| 1983 | * @DRM_XE_OA_PROPERTY_NUM_SYNCS: Number of syncs in the sync array | 1988 | * @DRM_XE_OA_PROPERTY_NUM_SYNCS: Number of syncs in the sync array |
| 1984 | * specified in @DRM_XE_OA_PROPERTY_SYNCS | 1989 | * specified in %DRM_XE_OA_PROPERTY_SYNCS |
| 1985 | */ | 1990 | */ |
| 1986 | DRM_XE_OA_PROPERTY_NUM_SYNCS, | 1991 | DRM_XE_OA_PROPERTY_NUM_SYNCS, |
| 1987 | | 1992 | |
| 1988 | /** | 1993 | /** |
| 1989 | * @DRM_XE_OA_PROPERTY_SYNCS: Pointer to struct @drm_xe_sync array | 1994 | * @DRM_XE_OA_PROPERTY_SYNCS: Pointer to &struct drm_xe_sync array |
| 1990 | * with array size specified via @DRM_XE_OA_PROPERTY_NUM_SYNCS. OA | 1995 | * with array size specified via %DRM_XE_OA_PROPERTY_NUM_SYNCS. OA |
| 1991 | * configuration will wait till input fences signal. Output fences | 1996 | * configuration will wait till input fences signal. Output fences |
| 1992 | * will signal after the new OA configuration takes effect. For | 1997 | * will signal after the new OA configuration takes effect. For |
| 1993 | * @DRM_XE_SYNC_TYPE_USER_FENCE, @addr is a user pointer, similar | 1998 | * %DRM_XE_SYNC_TYPE_USER_FENCE, addr is a user pointer, similar |
| 1994 | * to the VM bind case. | 1999 | * to the VM bind case. |
| 1995 | */ | 2000 | */ |
| 1996 | DRM_XE_OA_PROPERTY_SYNCS, | 2001 | DRM_XE_OA_PROPERTY_SYNCS, |
| @@ -2013,15 +2018,15 @@ enum drm_xe_oa_property_id { · 16 unmodified lines |
| 2013 | /** | 2018 | /** |
| 2014 | * struct drm_xe_oa_config - OA metric configuration | 2019 | * struct drm_xe_oa_config - OA metric configuration |
| 2015 | * | 2020 | * |
| 2016 | * Multiple OA configs can be added using @DRM_XE_OBSERVATION_OP_ADD_CONFIG. A | 2021 | * Multiple OA configs can be added using %DRM_XE_OBSERVATION_OP_ADD_CONFIG. A |
| 2017 | * particular config can be specified when opening an OA stream using | 2022 | * particular config can be specified when opening an OA stream using |
| 2018 | * @DRM_XE_OA_PROPERTY_OA_METRIC_SET property. | 2023 | * %DRM_XE_OA_PROPERTY_OA_METRIC_SET property. |
| 2019 | */ | 2024 | */ |
| 2020 | struct drm_xe_oa_config { | 2025 | struct drm_xe_oa_config { |
| 2021 | /** @extensions: Pointer to the first extension struct, if any */ | 2026 | /** @extensions: Pointer to the first extension struct, if any */ |
| 2022 | __u64 extensions; | 2027 | __u64 extensions; |
| 2023 | | 2028 | |
| 2024 | /** @uuid: String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x" */ | 2029 | /** @uuid: String formatted like "%08x-%04x-%04x-%04x-%012x" */ |
| 2025 | char uuid[36]; | 2030 | char uuid[36]; |
| 2026 | | 2031 | |
| 2027 | /** @n_regs: Number of regs in @regs_ptr */ | 2032 | /** @n_regs: Number of regs in @regs_ptr */ |
| @@ -2036,7 +2041,7 @@ struct drm_xe_oa_config { · 8 unmodified lines |
| 2036 | | 2041 | |
| 2037 | /** | 2042 | /** |
| 2038 | * struct drm_xe_oa_stream_status - OA stream status returned from | 2043 | * struct drm_xe_oa_stream_status - OA stream status returned from |
| 2039 | * @DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl. Userspace can | 2044 | * %DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl. Userspace can |
| 2040 | * call the ioctl to query stream status in response to EIO errno from | 2045 | * call the ioctl to query stream status in response to EIO errno from |
| 2041 | * observation fd read(). | 2046 | * observation fd read(). |
| 2042 | */ | 2047 | */ |
| @@ -2057,7 +2062,7 @@ struct drm_xe_oa_stream_status { · 14 unmodified lines |
| 2057 | | 2062 | |
| 2058 | /** | 2063 | /** |
| 2059 | * struct drm_xe_oa_stream_info - OA stream info returned from | 2064 | * struct drm_xe_oa_stream_info - OA stream info returned from |
| 2060 | * @DRM_XE_OBSERVATION_IOCTL_INFO observation stream fd ioctl | 2065 | * %DRM_XE_OBSERVATION_IOCTL_INFO observation stream fd ioctl |
| 2061 | */ | 2066 | */ |
| 2062 | struct drm_xe_oa_stream_info { | 2067 | struct drm_xe_oa_stream_info { |
| 2063 | /** @extensions: Pointer to the first extension struct, if any */ | 2068 | /** @extensions: Pointer to the first extension struct, if any */ |
| @@ -2094,27 +2099,27 @@ enum drm_xe_pxp_session_type { · 30 unmodified lines |
| 2094 | * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids. | 2099 | * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids. |
| 2095 | * | 2100 | * |
| 2096 | * These properties are passed to the driver at open as a chain of | 2101 | * These properties are passed to the driver at open as a chain of |
| 2097 | * @drm_xe_ext_set_property structures with @property set to these | 2102 | * &struct drm_xe_ext_set_property structures with property set to these |
| 2098 | * properties' enums and @value set to the corresponding values of these | 2103 | * properties' enums and value set to the corresponding values of these |
| 2099 | * properties. @drm_xe_user_extension base.name should be set to | 2104 | * properties. &struct drm_xe_user_extension base.name should be set to |
| 2100 | * @DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY. | 2105 | * %DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY. |
| 2101 | * | 2106 | * |
| 2102 | * With the file descriptor obtained from open, user space must enable | 2107 | * With the file descriptor obtained from open, user space must enable |
| 2103 | * the EU stall stream fd with @DRM_XE_OBSERVATION_IOCTL_ENABLE before | 2108 | * the EU stall stream fd with %DRM_XE_OBSERVATION_IOCTL_ENABLE before |
| 2104 | * calling read(). EIO errno from read() indicates HW dropped data | 2109 | * calling read(). EIO errno from read() indicates HW dropped data |
| 2105 | * due to full buffer. | 2110 | * due to full buffer. |
| 2106 | */ | 2111 | */ |
| 2107 | enum drm_xe_eu_stall_property_id { | 2112 | enum drm_xe_eu_stall_property_id { |
| 2108 | #define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY 0 | 2113 | #define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY 0 |
| 2109 | /** | 2114 | /** |
| 2110 | * @DRM_XE_EU_STALL_PROP_GT_ID: @gt_id of the GT on which | 2115 | * @DRM_XE_EU_STALL_PROP_GT_ID: gt_id of the GT on which |
| 2111 | * EU stall data will be captured. | 2116 | * EU stall data will be captured. |
| 2112 | */ | 2117 | */ |
| 2113 | DRM_XE_EU_STALL_PROP_GT_ID = 1, | 2118 | DRM_XE_EU_STALL_PROP_GT_ID = 1, |
| 2114 | | 2119 | |
| 2115 | /** | 2120 | /** |
| 2116 | * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate in | 2121 | * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate in |
| 2117 | * GPU cycles from @sampling_rates in struct @drm_xe_query_eu_stall | 2122 | * GPU cycles from sampling_rates in &struct drm_xe_query_eu_stall |
| 2118 | */ | 2123 | */ |
| 2119 | DRM_XE_EU_STALL_PROP_SAMPLE_RATE, | 2124 | DRM_XE_EU_STALL_PROP_SAMPLE_RATE, |
| 2120 | | 2125 | |
| @@ -2129,9 +2134,9 @@ enum drm_xe_eu_stall_property_id { · 8 unmodified lines |
| 2129 | /** | 2134 | /** |
| 2130 | * struct drm_xe_query_eu_stall - Information about EU stall sampling. | 2135 | * struct drm_xe_query_eu_stall - Information about EU stall sampling. |
| 2131 | * | 2136 | * |
| 2132 | * If a query is made with a struct @drm_xe_device_query where .query | 2137 | * If a query is made with a &struct drm_xe_device_query where .query |
| 2133 | * is equal to @DRM_XE_DEVICE_QUERY_EU_STALL, then the reply uses | 2138 | * is equal to %DRM_XE_DEVICE_QUERY_EU_STALL, then the reply uses |
| 2134 | * struct @drm_xe_query_eu_stall in .data. | 2139 | * &struct drm_xe_query_eu_stall in .data. |
| 2135 | */ | 2140 | */ |
| 2136 | struct drm_xe_query_eu_stall { | 2141 | struct drm_xe_query_eu_stall { |
| 2137 | /** @extensions: Pointer to the first extension struct, if any */ | 2142 | /** @extensions: Pointer to the first extension struct, if any */ |
| @@ -2183,7 +2188,7 @@ struct drm_xe_query_eu_stall { · 45 unmodified lines |
| 2183 | * .start = 0x100000, | 2188 | * .start = 0x100000, |
| 2184 | * .range = 0x2000, | 2189 | * .range = 0x2000, |
| 2185 | * .type = DRM_XE_MEM_RANGE_ATTR_ATOMIC, | 2190 | * .type = DRM_XE_MEM_RANGE_ATTR_ATOMIC, |
| 2186 | * .atomic_val = DRM_XE_ATOMIC_DEVICE, | 2191 | * .atomic.val = DRM_XE_ATOMIC_DEVICE, |
| 2187 | * }; | 2192 | * }; |
| 2188 | * | 2193 | * |
| 2189 | * ioctl(fd, DRM_IOCTL_XE_MADVISE, &madvise); | 2194 | * ioctl(fd, DRM_IOCTL_XE_MADVISE, &madvise); |
| @@ -2242,7 +2247,7 @@ struct drm_xe_madvise { · 52 unmodified lines |
| 2242 | | 2247 | |
| 2243 | /** | 2248 | /** |
| 2244 | * @preferred_mem_loc.region_instance : Region instance. | 2249 | * @preferred_mem_loc.region_instance : Region instance. |
| 2245 | * MBZ if @devmem_fd <= &DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE. | 2250 | * MBZ if @devmem_fd <= %DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE. |
| 2246 | * Otherwise should point to the desired device | 2251 | * Otherwise should point to the desired device |
| 2247 | * VRAM instance of the device indicated by | 2252 | * VRAM instance of the device indicated by |
| 2248 | * @preferred_mem_loc.devmem_fd. | 2253 | * @preferred_mem_loc.devmem_fd. |
| @@ -2369,24 +2374,19 @@ struct drm_xe_madvise { · 120 unmodified lines |
| 2369 | }; | 2374 | }; |
| 2370 | | 2375 | |
| 2371 | /** | 2376 | /** |
| 2372 | * struct drm_xe_mem_range_attr - Output of &DRM_IOCTL_XE_VM_QUERY_MEM_RANGES_ATTRS | 2377 | * struct drm_xe_mem_range_attr - Output of &DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS |
| 2373 | * | 2378 | * |
| 2374 | * This structure is provided by userspace and filled by KMD in response to the | 2379 | * This structure is provided by userspace and filled by KMD in response to the |
| 2375 | * DRM_IOCTL_XE_VM_QUERY_MEM_RANGES_ATTRS ioctl. It describes memory attributes of | 2380 | * DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS ioctl. It describes memory attributes of |
| 2376 | * a memory ranges within a user specified address range in a VM. | 2381 | * memory ranges within a user specified address range in a VM. |
| 2377 | * | 2382 | * |
| 2378 | * The structure includes information such as atomic access policy, | 2383 | * The structure includes information such as atomic access policy, |
| 2379 | * page attribute table (PAT) index, and preferred memory location. | 2384 | * page attribute table (PAT) index, and preferred memory location. |
| 2380 | * Userspace allocates an array of these structures and passes a pointer to the | 2385 | * Userspace allocates an array of these structures and passes a pointer to the |
| 2381 | * ioctl to retrieve attributes for each memory ranges | 2386 | * ioctl to retrieve attributes for each memory range. |
| 2382 | * | | |
| 2383 | * @extensions: Pointer to the first extension struct, if any | | |
| 2384 | * @start: Start address of the memory range | | |
| 2385 | * @end: End address of the virtual memory range | | |
| 2386 | * | | |
| 2387 | */ | 2387 | */ |
| 2388 | struct drm_xe_mem_range_attr { | 2388 | struct drm_xe_mem_range_attr { |
| 2389 | /** @extensions: Pointer to the first extension struct, if any */ | 2389 | /** @extensions: Pointer to the first extension struct, if any */ |
| 2390 | __u64 extensions; | 2390 | __u64 extensions; |
| 2391 | | 2391 | |
| 2392 | /** @start: start of the memory range */ | 2392 | /** @start: start of the memory range */ |
| @@ -2413,7 +2413,7 @@ struct drm_xe_mem_range_attr { · 20 unmodified lines |
| 2413 | __u32 reserved; | 2413 | __u32 reserved; |
| 2414 | } atomic; | 2414 | } atomic; |
| 2415 | | 2415 | |
| 2416 | /** @pat_index: Page attribute table index */ | 2416 | /** @pat_index: Page attribute table index */ |
| 2417 | struct { | 2417 | struct { |
| 2418 | /** @pat_index.val: PAT index */ | 2418 | /** @pat_index.val: PAT index */ |
| 2419 | __u32 val; | 2419 | __u32 val; |
| @@ -2427,7 +2427,7 @@ struct drm_xe_mem_range_attr { · 7 unmodified lines |
| 2427 | }; | 2427 | }; |
| 2428 | | 2428 | |
| 2429 | /** | 2429 | /** |
| 2430 | * struct drm_xe_vm_query_mem_range_attr - Input of &DRM_IOCTL_XE_VM_QUERY_MEM_ATTRIBUTES | 2430 | * struct drm_xe_vm_query_mem_range_attr - Input of &DRM_IOCTL_XE_VM_QUERY_MEM_RANGE_ATTRS |
| 2431 | * | 2431 | * |
| 2432 | * This structure is used to query memory attributes of memory regions | 2432 | * This structure is used to query memory attributes of memory regions |
| 2433 | * within a user specified address range in a VM. It provides detailed | 2433 | * within a user specified address range in a VM. It provides detailed |
| @@ -2435,15 +2435,15 @@ struct drm_xe_mem_range_attr { · 1 unmodified line |
| 2435 | * page attribute table (PAT) index, and preferred memory location. | 2435 | * page attribute table (PAT) index, and preferred memory location. |
| 2436 | * | 2436 | * |
| 2437 | * Userspace first calls the ioctl with @num_mem_ranges = 0, | 2437 | * Userspace first calls the ioctl with @num_mem_ranges = 0, |
| 2438 | * @sizeof_mem_ranges_attr = 0 and @vector_of_vma_mem_attr = NULL to retrieve | 2438 | * @sizeof_mem_range_attr = 0 and @vector_of_mem_attr = NULL to retrieve |
| 2439 | * the number of memory regions and size of each memory range attribute. | 2439 | * the number of memory regions and size of each memory range attribute. |
| 2440 | * Then, it allocates a buffer of that size and calls the ioctl again to fill | 2440 | * Then, it allocates a buffer of that size and calls the ioctl again to fill |
| 2441 | * the buffer with memory range attributes. | 2441 | * the buffer with memory range attributes. |
| 2442 | * | 2442 | * |
| 2443 | * If second call fails with -ENOSPC, it means memory ranges changed between | 2443 | * If second call fails with -ENOSPC, it means memory ranges changed between |
| 2444 | * first call and now, retry IOCTL again with @num_mem_ranges = 0, | 2444 | * first call and now, retry IOCTL again with @num_mem_ranges = 0, |
| 2445 | * @sizeof_mem_ranges_attr = 0 and @vector_of_vma_mem_attr = NULL followed by | 2445 | * @sizeof_mem_range_attr = 0 and @vector_of_mem_attr = NULL followed by |
| 2446 | * Second ioctl call. | 2446 | * second ioctl call. |
| 2447 | * | 2447 | * |
| 2448 | * Example: | 2448 | * Example: |
| 2449 | * | 2449 | * |