Pull drm updates from Dave Airlie: "Lots of work all over, Intel improving DG2 support, amdkfd CRIU support, msm new hw support, and faster fbdev support. dma-buf: - rename dma-buf-map to iosys-map core: - move buddy allocator to core - add pci/platform init macros - improve EDID parser deep color handling - EDID timing type 7 support - add GPD Win Max quirk - add yes/no helpers to string_helpers - flatten syncobj chains - add nomodeset support to lots of drivers - improve fb-helper clipping support - add default property value interface fbdev: - improve fbdev ops speed ttm: - add a backpointer from ttm bo->ttm resource dp: - move displayport headers - add a dp helper module bridge: - anx7625 atomic support, HDCP support panel: - split out panel-lvds and lvds bindings - find panels in OF subnodes privacy: - add chromeos privacy screen support fb: - hot unplug fw fb on forced removal simpledrm: - request region instead of marking ioresource busy - add panel oreintation property udmabuf: - fix oops with 0 pages amdgpu: - power management code cleanup - Enable freesync video mode by default - RAS code cleanup - Improve VRAM access for debug using SDMA - SR-IOV rework special register access and fixes - profiling power state request ioctl - expose IP discovery via sysfs - Cyan skillfish updates - GC 10.3.7, SDMA 5.2.7, DCN 3.1.6 updates - expose benchmark tests via debugfs - add module param to disable XGMI for testing - GPU reset debugfs register dumping support amdkfd: - CRIU support - SDMA queue fixes radeon: - UVD suspend fix - iMac backlight fix i915: - minimal parallel submission for execlists - DG2-G12 subplatform added - DG2 programming workarounds - DG2 accelerated migration support - flat CCS and CCS engine support for XeHP - initial small BAR support - drop fake LMEM support - ADL-N PCH support - bigjoiner updates - introduce VMA resources and async unbinding - register definitions cleanups - multi-FBC refactoring - DG1 OPROM over SPI support - ADL-N platform enabling - opregion mailbox #5 support - DP MST ESI improvements - drm device based logging - async flip optimisation for DG2 - CPU arch abstraction fixes - improve GuC ADS init to work on aarch64 - tweak TTM LRU priority hint - GuC 69.0.3 support - remove short term execbuf pins nouveau: - higher DP/eDP bitrates - backlight fixes msm: - dpu + dp support for sc8180x - dp support for sm8350 - dpu + dsi support for qcm2290 - 10nm dsi phy tuning support - bridge support for dp encoder - gpu support for additional 7c3 SKUs ingenic: - HDMI support for JZ4780 - aux channel EDID support ast: - AST2600 support - add wide screen support - create DP/DVI connectors omapdrm: - fix implicit dma_buf fencing vc4: - add CSC + full range support - better display firmware handoff panfrost: - add initial dual-core GPU support stm: - new revision support - fb handover support mediatek: - transfer display binding document to yaml format. - add mt8195 display device binding. - allow commands to be sent during video mode. - add wait_for_event for crtc disable by cmdq. tegra: - YUV format support rcar-du: - LVDS support for M3-W+ (R8A77961) exynos: - BGR pixel format for FIMD device" * tag 'drm-next-2022-03-24' of git://anongit.freedesktop.org/drm/drm: (1529 commits) drm/i915/display: Do not re-enable PSR after it was marked as not reliable drm/i915/display: Fix HPD short pulse handling for eDP drm/amdgpu: Use drm_mode_copy() drm/radeon: Use drm_mode_copy() drm/amdgpu: Use ternary operator in `vcn_v1_0_start()` drm/amdgpu: Remove pointless on stack mode copies drm/amd/pm: fix indenting in __smu_cmn_reg_print_error() drm/amdgpu/dc: fix typos in comments drm/amdgpu: fix typos in comments drm/amd/pm: fix typos in comments drm/amdgpu: Add stolen reserved memory for MI25 SRIOV. drm/amdgpu: Merge get_reserved_allocation to get_vbios_allocations. drm/amdkfd: evict svm bo worker handle error drm/amdgpu/vcn: fix vcn ring test failure in igt reload test drm/amdgpu: only allow secure submission on rings which support that drm/amdgpu: fixed the warnings reported by kernel test robot drm/amd/display: 3.2.177 drm/amd/display: [FW Promotion] Release 0.0.108.0 drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2 drm/amd/display: Wait for hubp read line for Pollock ...
Showing the changes to include/uapi (6 of 1466 files). Show all
Unified · Split
| @@ -206,6 +206,8 @@ union drm_amdgpu_bo_list { · 205 unmodified lines | |||
| 206 | #define AMDGPU_CTX_OP_FREE_CTX 2 | 206 | #define AMDGPU_CTX_OP_FREE_CTX 2 |
| 207 | #define AMDGPU_CTX_OP_QUERY_STATE 3 | 207 | #define AMDGPU_CTX_OP_QUERY_STATE 3 |
| 208 | #define AMDGPU_CTX_OP_QUERY_STATE2 4 | 208 | #define AMDGPU_CTX_OP_QUERY_STATE2 4 |
| 209 | #define AMDGPU_CTX_OP_GET_STABLE_PSTATE 5 | ||
| 210 | #define AMDGPU_CTX_OP_SET_STABLE_PSTATE 6 | ||
| 209 | 211 | ||
| 210 | /* GPU reset status */ | 212 | /* GPU reset status */ |
| 211 | #define AMDGPU_CTX_NO_RESET 0 | 213 | #define AMDGPU_CTX_NO_RESET 0 |
| @@ -238,10 +240,18 @@ union drm_amdgpu_bo_list { · 26 unmodified lines | |||
| 238 | #define AMDGPU_CTX_PRIORITY_HIGH 512 | 240 | #define AMDGPU_CTX_PRIORITY_HIGH 512 |
| 239 | #define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023 | 241 | #define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023 |
| 240 | 242 | ||
| 243 | /* select a stable profiling pstate for perfmon tools */ | ||
| 244 | #define AMDGPU_CTX_STABLE_PSTATE_FLAGS_MASK 0xf | ||
| 245 | #define AMDGPU_CTX_STABLE_PSTATE_NONE 0 | ||
| 246 | #define AMDGPU_CTX_STABLE_PSTATE_STANDARD 1 | ||
| 247 | #define AMDGPU_CTX_STABLE_PSTATE_MIN_SCLK 2 | ||
| 248 | #define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK 3 | ||
| 249 | #define AMDGPU_CTX_STABLE_PSTATE_PEAK 4 | ||
| 250 | |||
| 241 | struct drm_amdgpu_ctx_in { | 251 | struct drm_amdgpu_ctx_in { |
| 242 | /** AMDGPU_CTX_OP_* */ | 252 | /** AMDGPU_CTX_OP_* */ |
| 243 | __u32 op; | 253 | __u32 op; |
| 244 | /** For future use, no flags defined so far */ | 254 | /** Flags */ |
| 245 | __u32 flags; | 255 | __u32 flags; |
| 246 | __u32 ctx_id; | 256 | __u32 ctx_id; |
| 247 | /** AMDGPU_CTX_PRIORITY_* */ | 257 | /** AMDGPU_CTX_PRIORITY_* */ |
| @@ -262,6 +272,11 @@ union drm_amdgpu_ctx_out { · 14 unmodified lines | |||
| 262 | /** Reset status since the last call of the ioctl. */ | 272 | /** Reset status since the last call of the ioctl. */ |
| 263 | __u32 reset_status; | 273 | __u32 reset_status; |
| 264 | } state; | 274 | } state; |
| 275 | |||
| 276 | struct { | ||
| 277 | __u32 flags; | ||
| 278 | __u32 _pad; | ||
| 279 | } pstate; | ||
| 265 | }; | 280 | }; |
| 266 | 281 | ||
| 267 | union drm_amdgpu_ctx { | 282 | union drm_amdgpu_ctx { |
| @@ -728,6 +743,8 @@ struct drm_amdgpu_cs_chunk_data { · 460 unmodified lines | |||
| 728 | #define AMDGPU_INFO_FW_DMCUB 0x14 | 743 | #define AMDGPU_INFO_FW_DMCUB 0x14 |
| 729 | /* Subquery id: Query TOC firmware version */ | 744 | /* Subquery id: Query TOC firmware version */ |
| 730 | #define AMDGPU_INFO_FW_TOC 0x15 | 745 | #define AMDGPU_INFO_FW_TOC 0x15 |
| 746 | /* Subquery id: Query CAP firmware version */ | ||
| 747 | #define AMDGPU_INFO_FW_CAP 0x16 | ||
| 731 | 748 | ||
| 732 | /* number of bytes moved for TTM migration */ | 749 | /* number of bytes moved for TTM migration */ |
| 733 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f | 750 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f |
| @@ -1134,6 +1151,8 @@ struct drm_amdgpu_info_video_caps { · 400 unmodified lines | |||
| 1134 | #define AMDGPU_FAMILY_NV 143 /* Navi10 */ | 1151 | #define AMDGPU_FAMILY_NV 143 /* Navi10 */ |
| 1135 | #define AMDGPU_FAMILY_VGH 144 /* Van Gogh */ | 1152 | #define AMDGPU_FAMILY_VGH 144 /* Van Gogh */ |
| 1136 | #define AMDGPU_FAMILY_YC 146 /* Yellow Carp */ | 1153 | #define AMDGPU_FAMILY_YC 146 /* Yellow Carp */ |
| 1154 | #define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */ | ||
| 1155 | #define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */ | ||
| 1137 | 1156 | ||
| 1138 | #if defined(__cplusplus) | 1157 | #if defined(__cplusplus) |
| 1139 | } | 1158 | } |
| @@ -663,41 +663,73 @@ struct drm_mode_fb_cmd { · 662 unmodified lines | |||
| 663 | #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ | 663 | #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ |
| 664 | #define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ | 664 | #define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ |
| 665 | 665 | ||
| 666 | /** | ||
| 667 | * struct drm_mode_fb_cmd2 - Frame-buffer metadata. | ||
| 668 | * | ||
| 669 | * This struct holds frame-buffer metadata. There are two ways to use it: | ||
| 670 | * | ||
| 671 | * - User-space can fill this struct and perform a &DRM_IOCTL_MODE_ADDFB2 | ||
| 672 | * ioctl to register a new frame-buffer. The new frame-buffer object ID will | ||
| 673 | * be set by the kernel in @fb_id. | ||
| 674 | * - User-space can set @fb_id and perform a &DRM_IOCTL_MODE_GETFB2 ioctl to | ||
| 675 | * fetch metadata about an existing frame-buffer. | ||
| 676 | * | ||
| 677 | * In case of planar formats, this struct allows up to 4 buffer objects with | ||
| 678 | * offsets and pitches per plane. The pitch and offset order is dictated by the | ||
| 679 | * format FourCC as defined by ``drm_fourcc.h``, e.g. NV12 is described as: | ||
| 680 | * | ||
| 681 | * YUV 4:2:0 image with a plane of 8 bit Y samples followed by an | ||
| 682 | * interleaved U/V plane containing 8 bit 2x2 subsampled colour difference | ||
| 683 | * samples. | ||
| 684 | * | ||
| 685 | * So it would consist of a Y plane at ``offsets[0]`` and a UV plane at | ||
| 686 | * ``offsets[1]``. | ||
| 687 | * | ||
| 688 | * To accommodate tiled, compressed, etc formats, a modifier can be specified. | ||
| 689 | * For more information see the "Format Modifiers" section. Note that even | ||
| 690 | * though it looks like we have a modifier per-plane, we in fact do not. The | ||
| 691 | * modifier for each plane must be identical. Thus all combinations of | ||
| 692 | * different data layouts for multi-plane formats must be enumerated as | ||
| 693 | * separate modifiers. | ||
| 694 | * | ||
| 695 | * All of the entries in @handles, @pitches, @offsets and @modifier must be | ||
| 696 | * zero when unused. Warning, for @offsets and @modifier zero can't be used to | ||
| 697 | * figure out whether the entry is used or not since it's a valid value (a zero | ||
| 698 | * offset is common, and a zero modifier is &DRM_FORMAT_MOD_LINEAR). | ||
| 699 | */ | ||
| 666 | struct drm_mode_fb_cmd2 { | 700 | struct drm_mode_fb_cmd2 { |
| 701 | /** @fb_id: Object ID of the frame-buffer. */ | ||
| 667 | __u32 fb_id; | 702 | __u32 fb_id; |
| 703 | /** @width: Width of the frame-buffer. */ | ||
| 668 | __u32 width; | 704 | __u32 width; |
| 705 | /** @height: Height of the frame-buffer. */ | ||
| 669 | __u32 height; | 706 | __u32 height; |
| 670 | __u32 pixel_format; /* fourcc code from drm_fourcc.h */ | 707 | /** |
| 671 | __u32 flags; /* see above flags */ | 708 | * @pixel_format: FourCC format code, see ``DRM_FORMAT_*`` constants in |
| 709 | * ``drm_fourcc.h``. | ||
| 710 | */ | ||
| 711 | __u32 pixel_format; | ||
| 712 | /** | ||
| 713 | * @flags: Frame-buffer flags (see &DRM_MODE_FB_INTERLACED and | ||
| 714 | * &DRM_MODE_FB_MODIFIERS). | ||
| 715 | */ | ||
| 716 | __u32 flags; | ||
| 672 | 717 | ||
| 673 | /* | 718 | /** |
| 674 | * In case of planar formats, this ioctl allows up to 4 | 719 | * @handles: GEM buffer handle, one per plane. Set to 0 if the plane is |
| 675 | * buffer objects with offsets and pitches per plane. | 720 | * unused. The same handle can be used for multiple planes. |
| 676 | * The pitch and offset order is dictated by the fourcc, | ||
| 677 | * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as: | ||
| 678 | * | ||
| 679 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
| 680 | * followed by an interleaved U/V plane containing | ||
| 681 | * 8 bit 2x2 subsampled colour difference samples. | ||
| 682 | * | ||
| 683 | * So it would consist of Y as offsets[0] and UV as | ||
| 684 | * offsets[1]. Note that offsets[0] will generally | ||
| 685 | * be 0 (but this is not required). | ||
| 686 | * | ||
| 687 | * To accommodate tiled, compressed, etc formats, a | ||
| 688 | * modifier can be specified. The default value of zero | ||
| 689 | * indicates "native" format as specified by the fourcc. | ||
| 690 | * Vendor specific modifier token. Note that even though | ||
| 691 | * it looks like we have a modifier per-plane, we in fact | ||
| 692 | * do not. The modifier for each plane must be identical. | ||
| 693 | * Thus all combinations of different data layouts for | ||
| 694 | * multi plane formats must be enumerated as separate | ||
| 695 | * modifiers. | ||
| 696 | */ | 721 | */ |
| 697 | __u32 handles[4]; | 722 | __u32 handles[4]; |
| 698 | __u32 pitches[4]; /* pitch for each plane */ | 723 | /** @pitches: Pitch (aka. stride) in bytes, one per plane. */ |
| 699 | __u32 offsets[4]; /* offset of each plane */ | 724 | __u32 pitches[4]; |
| 700 | __u64 modifier[4]; /* ie, tiling, compress */ | 725 | /** @offsets: Offset into the buffer in bytes, one per plane. */ |
| 726 | __u32 offsets[4]; | ||
| 727 | /** | ||
| 728 | * @modifier: Format modifier, one per plane. See ``DRM_FORMAT_MOD_*`` | ||
| 729 | * constants in ``drm_fourcc.h``. All planes must use the same | ||
| 730 | * modifier. Ignored unless &DRM_MODE_FB_MODIFIERS is set in @flags. | ||
| 731 | */ | ||
| 732 | __u64 modifier[4]; | ||
| 701 | }; | 733 | }; |
| 702 | 734 | ||
| 703 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 | 735 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 |
| @@ -1118,10 +1118,16 @@ struct drm_i915_gem_exec_object2 { · 1117 unmodified lines | |||
| 1118 | /** | 1118 | /** |
| 1119 | * When the EXEC_OBJECT_PINNED flag is specified this is populated by | 1119 | * When the EXEC_OBJECT_PINNED flag is specified this is populated by |
| 1120 | * the user with the GTT offset at which this object will be pinned. | 1120 | * the user with the GTT offset at which this object will be pinned. |
| 1121 | * | ||
| 1121 | * When the I915_EXEC_NO_RELOC flag is specified this must contain the | 1122 | * When the I915_EXEC_NO_RELOC flag is specified this must contain the |
| 1122 | * presumed_offset of the object. | 1123 | * presumed_offset of the object. |
| 1124 | * | ||
| 1123 | * During execbuffer2 the kernel populates it with the value of the | 1125 | * During execbuffer2 the kernel populates it with the value of the |
| 1124 | * current GTT offset of the object, for future presumed_offset writes. | 1126 | * current GTT offset of the object, for future presumed_offset writes. |
| 1127 | * | ||
| 1128 | * See struct drm_i915_gem_create_ext for the rules when dealing with | ||
| 1129 | * alignment restrictions with I915_MEMORY_CLASS_DEVICE, on devices with | ||
| 1130 | * minimum page sizes, like DG2. | ||
| 1125 | */ | 1131 | */ |
| 1126 | __u64 offset; | 1132 | __u64 offset; |
| 1127 | 1133 | ||
| @@ -3144,11 +3150,40 @@ struct drm_i915_gem_create_ext { · 2016 unmodified lines | |||
| 3144 | * | 3150 | * |
| 3145 | * The (page-aligned) allocated size for the object will be returned. | 3151 | * The (page-aligned) allocated size for the object will be returned. |
| 3146 | * | 3152 | * |
| 3147 | * Note that for some devices we have might have further minimum | 3153 | * |
| 3148 | * page-size restrictions(larger than 4K), like for device local-memory. | 3154 | * DG2 64K min page size implications: |
| 3149 | * However in general the final size here should always reflect any | 3155 | * |
| 3150 | * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS | 3156 | * On discrete platforms, starting from DG2, we have to contend with GTT |
| 3151 | * extension to place the object in device local-memory. | 3157 | * page size restrictions when dealing with I915_MEMORY_CLASS_DEVICE |
| 3158 | * objects. Specifically the hardware only supports 64K or larger GTT | ||
| 3159 | * page sizes for such memory. The kernel will already ensure that all | ||
| 3160 | * I915_MEMORY_CLASS_DEVICE memory is allocated using 64K or larger page | ||
| 3161 | * sizes underneath. | ||
| 3162 | * | ||
| 3163 | * Note that the returned size here will always reflect any required | ||
| 3164 | * rounding up done by the kernel, i.e 4K will now become 64K on devices | ||
| 3165 | * such as DG2. | ||
| 3166 | * | ||
| 3167 | * Special DG2 GTT address alignment requirement: | ||
| 3168 | * | ||
| 3169 | * The GTT alignment will also need to be at least 2M for such objects. | ||
| 3170 | * | ||
| 3171 | * Note that due to how the hardware implements 64K GTT page support, we | ||
| 3172 | * have some further complications: | ||
| 3173 | * | ||
| 3174 | * 1) The entire PDE (which covers a 2MB virtual address range), must | ||
| 3175 | * contain only 64K PTEs, i.e mixing 4K and 64K PTEs in the same | ||
| 3176 | * PDE is forbidden by the hardware. | ||
| 3177 | * | ||
| 3178 | * 2) We still need to support 4K PTEs for I915_MEMORY_CLASS_SYSTEM | ||
| 3179 | * objects. | ||
| 3180 | * | ||
| 3181 | * To keep things simple for userland, we mandate that any GTT mappings | ||
| 3182 | * must be aligned to and rounded up to 2MB. The kernel will internally | ||
| 3183 | * pad them out to the next 2MB boundary. As this only wastes virtual | ||
| 3184 | * address space and avoids userland having to copy any needlessly | ||
| 3185 | * complicated PDE sharing scheme (coloring) and only affects DG2, this | ||
| 3186 | * is deemed to be a good compromise. | ||
| 3152 | */ | 3187 | */ |
| 3153 | __u64 size; | 3188 | __u64 size; |
| 3154 | /** | 3189 | /** |
| @@ -67,16 +67,21 @@ struct drm_msm_timespec { · 66 unmodified lines | |||
| 67 | __s64 tv_nsec; /* nanoseconds */ | 67 | __s64 tv_nsec; /* nanoseconds */ |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | #define MSM_PARAM_GPU_ID 0x01 | 70 | /* Below "RO" indicates a read-only param, "WO" indicates write-only, and |
| 71 | #define MSM_PARAM_GMEM_SIZE 0x02 | 71 | * "RW" indicates a param that can be both read (GET_PARAM) and written |
| 72 | #define MSM_PARAM_CHIP_ID 0x03 | 72 | * (SET_PARAM) |
| 73 | #define MSM_PARAM_MAX_FREQ 0x04 | 73 | */ |
| 74 | #define MSM_PARAM_TIMESTAMP 0x05 | 74 | #define MSM_PARAM_GPU_ID 0x01 /* RO */ |
| 75 | #define MSM_PARAM_GMEM_BASE 0x06 | 75 | #define MSM_PARAM_GMEM_SIZE 0x02 /* RO */ |
| 76 | #define MSM_PARAM_PRIORITIES 0x07 /* The # of priority levels */ | 76 | #define MSM_PARAM_CHIP_ID 0x03 /* RO */ |
| 77 | #define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */ | 77 | #define MSM_PARAM_MAX_FREQ 0x04 /* RO */ |
| 78 | #define MSM_PARAM_FAULTS 0x09 | 78 | #define MSM_PARAM_TIMESTAMP 0x05 /* RO */ |
| 79 | #define MSM_PARAM_SUSPENDS 0x0a | 79 | #define MSM_PARAM_GMEM_BASE 0x06 /* RO */ |
| 80 | #define MSM_PARAM_PRIORITIES 0x07 /* RO: The # of priority levels */ | ||
| 81 | #define MSM_PARAM_PP_PGTABLE 0x08 /* RO: Deprecated, always returns zero */ | ||
| 82 | #define MSM_PARAM_FAULTS 0x09 /* RO */ | ||
| 83 | #define MSM_PARAM_SUSPENDS 0x0a /* RO */ | ||
| 84 | #define MSM_PARAM_SYSPROF 0x0b /* WO: 1 preserves perfcntrs, 2 also disables suspend */ | ||
| 80 | 85 | ||
| 81 | /* For backwards compat. The original support for preemption was based on | 86 | /* For backwards compat. The original support for preemption was based on |
| 82 | * a single ring per priority level so # of priority levels equals the # | 87 | * a single ring per priority level so # of priority levels equals the # |
| @@ -227,6 +232,7 @@ struct drm_msm_gem_submit_bo { · 144 unmodified lines | |||
| 227 | #define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */ | 232 | #define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */ |
| 228 | #define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */ | 233 | #define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */ |
| 229 | #define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */ | 234 | #define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */ |
| 235 | #define MSM_SUBMIT_FENCE_SN_IN 0x02000000 /* userspace passes in seqno fence */ | ||
| 230 | #define MSM_SUBMIT_FLAGS ( \ | 236 | #define MSM_SUBMIT_FLAGS ( \ |
| 231 | MSM_SUBMIT_NO_IMPLICIT | \ | 237 | MSM_SUBMIT_NO_IMPLICIT | \ |
| 232 | MSM_SUBMIT_FENCE_FD_IN | \ | 238 | MSM_SUBMIT_FENCE_FD_IN | \ |
| @@ -234,6 +240,7 @@ struct drm_msm_gem_submit_bo { · 1 unmodified line | |||
| 234 | MSM_SUBMIT_SUDO | \ | 240 | MSM_SUBMIT_SUDO | \ |
| 235 | MSM_SUBMIT_SYNCOBJ_IN | \ | 241 | MSM_SUBMIT_SYNCOBJ_IN | \ |
| 236 | MSM_SUBMIT_SYNCOBJ_OUT | \ | 242 | MSM_SUBMIT_SYNCOBJ_OUT | \ |
| 243 | MSM_SUBMIT_FENCE_SN_IN | \ | ||
| 237 | 0) | 244 | 0) |
| 238 | 245 | ||
| 239 | #define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */ | 246 | #define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */ |
| @@ -253,7 +260,7 @@ struct drm_msm_gem_submit_syncobj { · 13 unmodified lines | |||
| 253 | */ | 260 | */ |
| 254 | struct drm_msm_gem_submit { | 261 | struct drm_msm_gem_submit { |
| 255 | __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */ | 262 | __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */ |
| 256 | __u32 fence; /* out */ | 263 | __u32 fence; /* out (or in with MSM_SUBMIT_FENCE_SN_IN flag) */ |
| 257 | __u32 nr_bos; /* in, number of submit_bo's */ | 264 | __u32 nr_bos; /* in, number of submit_bo's */ |
| 258 | __u32 nr_cmds; /* in, number of submit_cmd's */ | 265 | __u32 nr_cmds; /* in, number of submit_cmd's */ |
| 259 | __u64 bos; /* in, ptr to array of submit_bo's */ | 266 | __u64 bos; /* in, ptr to array of submit_bo's */ |
| @@ -333,9 +340,7 @@ struct drm_msm_submitqueue_query { · 73 unmodified lines | |||
| 333 | }; | 340 | }; |
| 334 | 341 | ||
| 335 | #define DRM_MSM_GET_PARAM 0x00 | 342 | #define DRM_MSM_GET_PARAM 0x00 |
| 336 | /* placeholder: | ||
| 337 | #define DRM_MSM_SET_PARAM 0x01 | 343 | #define DRM_MSM_SET_PARAM 0x01 |
| 338 | */ | ||
| 339 | #define DRM_MSM_GEM_NEW 0x02 | 344 | #define DRM_MSM_GEM_NEW 0x02 |
| 340 | #define DRM_MSM_GEM_INFO 0x03 | 345 | #define DRM_MSM_GEM_INFO 0x03 |
| 341 | #define DRM_MSM_GEM_CPU_PREP 0x04 | 346 | #define DRM_MSM_GEM_CPU_PREP 0x04 |
| @@ -351,6 +356,7 @@ struct drm_msm_submitqueue_query { · 9 unmodified lines | |||
| 351 | #define DRM_MSM_SUBMITQUEUE_QUERY 0x0C | 356 | #define DRM_MSM_SUBMITQUEUE_QUERY 0x0C |
| 352 | 357 | ||
| 353 | #define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param) | 358 | #define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param) |
| 359 | #define DRM_IOCTL_MSM_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param) | ||
| 354 | #define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new) | 360 | #define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new) |
| 355 | #define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info) | 361 | #define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info) |
| 356 | #define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep) | 362 | #define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep) |
| @@ -84,14 +84,14 @@ struct drm_panfrost_wait_bo { · 83 unmodified lines | |||
| 84 | __s64 timeout_ns; /* absolute */ | 84 | __s64 timeout_ns; /* absolute */ |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | /* Valid flags to pass to drm_panfrost_create_bo */ | ||
| 87 | #define PANFROST_BO_NOEXEC 1 | 88 | #define PANFROST_BO_NOEXEC 1 |
| 88 | #define PANFROST_BO_HEAP 2 | 89 | #define PANFROST_BO_HEAP 2 |
| 89 | 90 | ||
| 90 | /** | 91 | /** |
| 91 | * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs. | 92 | * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs. |
| 92 | * | 93 | * |
| 93 | * There are currently no values for the flags argument, but it may be | 94 | * The flags argument is a bit mask of PANFROST_BO_* flags. |
| 94 | * used in a future extension. | ||
| 95 | */ | 95 | */ |
| 96 | struct drm_panfrost_create_bo { | 96 | struct drm_panfrost_create_bo { |
| 97 | __u32 size; | 97 | __u32 size; |
| @@ -32,9 +32,11 @@ · 31 unmodified lines | |||
| 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties | 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties |
| 33 | * - 1.5 - Add SVM API | 33 | * - 1.5 - Add SVM API |
| 34 | * - 1.6 - Query clear flags in SVM get_attr API | 34 | * - 1.6 - Query clear flags in SVM get_attr API |
| 35 | * - 1.7 - Checkpoint Restore (CRIU) API | ||
| 36 | * - 1.8 - CRIU - Support for SDMA transfers with GTT BOs | ||
| 35 | */ | 37 | */ |
| 36 | #define KFD_IOCTL_MAJOR_VERSION 1 | 38 | #define KFD_IOCTL_MAJOR_VERSION 1 |
| 37 | #define KFD_IOCTL_MINOR_VERSION 6 | 39 | #define KFD_IOCTL_MINOR_VERSION 8 |
| 38 | 40 | ||
| 39 | struct kfd_ioctl_get_version_args { | 41 | struct kfd_ioctl_get_version_args { |
| 40 | __u32 major_version; /* from KFD */ | 42 | __u32 major_version; /* from KFD */ |
| @@ -194,6 +196,8 @@ struct kfd_ioctl_dbg_wave_control_args { · 153 unmodified lines | |||
| 194 | __u32 buf_size_in_bytes; /*including gpu_id and buf_size */ | 196 | __u32 buf_size_in_bytes; /*including gpu_id and buf_size */ |
| 195 | }; | 197 | }; |
| 196 | 198 | ||
| 199 | #define KFD_INVALID_FD 0xffffffff | ||
| 200 | |||
| 197 | /* Matching HSA_EVENTTYPE */ | 201 | /* Matching HSA_EVENTTYPE */ |
| 198 | #define KFD_IOC_EVENT_SIGNAL 0 | 202 | #define KFD_IOC_EVENT_SIGNAL 0 |
| 199 | #define KFD_IOC_EVENT_NODECHANGE 1 | 203 | #define KFD_IOC_EVENT_NODECHANGE 1 |
| @@ -462,12 +466,89 @@ enum kfd_smi_event { · 262 unmodified lines | |||
| 462 | }; | 466 | }; |
| 463 | 467 | ||
| 464 | #define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1)) | 468 | #define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1)) |
| 469 | #define KFD_SMI_EVENT_MSG_SIZE 96 | ||
| 465 | 470 | ||
| 466 | struct kfd_ioctl_smi_events_args { | 471 | struct kfd_ioctl_smi_events_args { |
| 467 | __u32 gpuid; /* to KFD */ | 472 | __u32 gpuid; /* to KFD */ |
| 468 | __u32 anon_fd; /* from KFD */ | 473 | __u32 anon_fd; /* from KFD */ |
| 469 | }; | 474 | }; |
| 470 | 475 | ||
| 476 | /************************************************************************************************** | ||
| 477 | * CRIU IOCTLs (Checkpoint Restore In Userspace) | ||
| 478 | * | ||
| 479 | * When checkpointing a process, the userspace application will perform: | ||
| 480 | * 1. PROCESS_INFO op to determine current process information. This pauses execution and evicts | ||
| 481 | * all the queues. | ||
| 482 | * 2. CHECKPOINT op to checkpoint process contents (BOs, queues, events, svm-ranges) | ||
| 483 | * 3. UNPAUSE op to un-evict all the queues | ||
| 484 | * | ||
| 485 | * When restoring a process, the CRIU userspace application will perform: | ||
| 486 | * | ||
| 487 | * 1. RESTORE op to restore process contents | ||
| 488 | * 2. RESUME op to start the process | ||
| 489 | * | ||
| 490 | * Note: Queues are forced into an evicted state after a successful PROCESS_INFO. User | ||
| 491 | * application needs to perform an UNPAUSE operation after calling PROCESS_INFO. | ||
| 492 | */ | ||
| 493 | |||
| 494 | enum kfd_criu_op { | ||
| 495 | KFD_CRIU_OP_PROCESS_INFO, | ||
| 496 | KFD_CRIU_OP_CHECKPOINT, | ||
| 497 | KFD_CRIU_OP_UNPAUSE, | ||
| 498 | KFD_CRIU_OP_RESTORE, | ||
| 499 | KFD_CRIU_OP_RESUME, | ||
| 500 | }; | ||
| 501 | |||
| 502 | /** | ||
| 503 | * kfd_ioctl_criu_args - Arguments perform CRIU operation | ||
| 504 | * @devices: [in/out] User pointer to memory location for devices information. | ||
| 505 | * This is an array of type kfd_criu_device_bucket. | ||
| 506 | * @bos: [in/out] User pointer to memory location for BOs information | ||
| 507 | * This is an array of type kfd_criu_bo_bucket. | ||
| 508 | * @priv_data: [in/out] User pointer to memory location for private data | ||
| 509 | * @priv_data_size: [in/out] Size of priv_data in bytes | ||
| 510 | * @num_devices: [in/out] Number of GPUs used by process. Size of @devices array. | ||
| 511 | * @num_bos [in/out] Number of BOs used by process. Size of @bos array. | ||
| 512 | * @num_objects: [in/out] Number of objects used by process. Objects are opaque to | ||
| 513 | * user application. | ||
| 514 | * @pid: [in/out] PID of the process being checkpointed | ||
| 515 | * @op [in] Type of operation (kfd_criu_op) | ||
| 516 | * | ||
| 517 | * Return: 0 on success, -errno on failure | ||
| 518 | */ | ||
| 519 | struct kfd_ioctl_criu_args { | ||
| 520 | __u64 devices; /* Used during ops: CHECKPOINT, RESTORE */ | ||
| 521 | __u64 bos; /* Used during ops: CHECKPOINT, RESTORE */ | ||
| 522 | __u64 priv_data; /* Used during ops: CHECKPOINT, RESTORE */ | ||
| 523 | __u64 priv_data_size; /* Used during ops: PROCESS_INFO, RESTORE */ | ||
| 524 | __u32 num_devices; /* Used during ops: PROCESS_INFO, RESTORE */ | ||
| 525 | __u32 num_bos; /* Used during ops: PROCESS_INFO, RESTORE */ | ||
| 526 | __u32 num_objects; /* Used during ops: PROCESS_INFO, RESTORE */ | ||
| 527 | __u32 pid; /* Used during ops: PROCESS_INFO, RESUME */ | ||
| 528 | __u32 op; | ||
| 529 | }; | ||
| 530 | |||
| 531 | struct kfd_criu_device_bucket { | ||
| 532 | __u32 user_gpu_id; | ||
| 533 | __u32 actual_gpu_id; | ||
| 534 | __u32 drm_fd; | ||
| 535 | __u32 pad; | ||
| 536 | }; | ||
| 537 | |||
| 538 | struct kfd_criu_bo_bucket { | ||
| 539 | __u64 addr; | ||
| 540 | __u64 size; | ||
| 541 | __u64 offset; | ||
| 542 | __u64 restored_offset; /* During restore, updated offset for BO */ | ||
| 543 | __u32 gpu_id; /* This is the user_gpu_id */ | ||
| 544 | __u32 alloc_flags; | ||
| 545 | __u32 dmabuf_fd; | ||
| 546 | __u32 pad; | ||
| 547 | }; | ||
| 548 | |||
| 549 | /* CRIU IOCTLs - END */ | ||
| 550 | /**************************************************************************************************/ | ||
| 551 | |||
| 471 | /* Register offset inside the remapped mmio page | 552 | /* Register offset inside the remapped mmio page |
| 472 | */ | 553 | */ |
| 473 | enum kfd_mmio_remap { | 554 | enum kfd_mmio_remap { |
| @@ -596,7 +677,7 @@ struct kfd_ioctl_svm_args { · 122 unmodified lines | |||
| 596 | __u32 op; | 677 | __u32 op; |
| 597 | __u32 nattr; | 678 | __u32 nattr; |
| 598 | /* Variable length array of attributes */ | 679 | /* Variable length array of attributes */ |
| 599 | struct kfd_ioctl_svm_attribute attrs[0]; | 680 | struct kfd_ioctl_svm_attribute attrs[]; |
| 600 | }; | 681 | }; |
| 601 | 682 | ||
| 602 | /** | 683 | /** |
| @@ -679,16 +760,16 @@ struct kfd_ioctl_set_xnack_mode_args { · 76 unmodified lines | |||
| 679 | #define AMDKFD_IOC_WAIT_EVENTS \ | 760 | #define AMDKFD_IOC_WAIT_EVENTS \ |
| 680 | AMDKFD_IOWR(0x0C, struct kfd_ioctl_wait_events_args) | 761 | AMDKFD_IOWR(0x0C, struct kfd_ioctl_wait_events_args) |
| 681 | 762 | ||
| 682 | #define AMDKFD_IOC_DBG_REGISTER \ | 763 | #define AMDKFD_IOC_DBG_REGISTER_DEPRECATED \ |
| 683 | AMDKFD_IOW(0x0D, struct kfd_ioctl_dbg_register_args) | 764 | AMDKFD_IOW(0x0D, struct kfd_ioctl_dbg_register_args) |
| 684 | 765 | ||
| 685 | #define AMDKFD_IOC_DBG_UNREGISTER \ | 766 | #define AMDKFD_IOC_DBG_UNREGISTER_DEPRECATED \ |
| 686 | AMDKFD_IOW(0x0E, struct kfd_ioctl_dbg_unregister_args) | 767 | AMDKFD_IOW(0x0E, struct kfd_ioctl_dbg_unregister_args) |
| 687 | 768 | ||
| 688 | #define AMDKFD_IOC_DBG_ADDRESS_WATCH \ | 769 | #define AMDKFD_IOC_DBG_ADDRESS_WATCH_DEPRECATED \ |
| 689 | AMDKFD_IOW(0x0F, struct kfd_ioctl_dbg_address_watch_args) | 770 | AMDKFD_IOW(0x0F, struct kfd_ioctl_dbg_address_watch_args) |
| 690 | 771 | ||
| 691 | #define AMDKFD_IOC_DBG_WAVE_CONTROL \ | 772 | #define AMDKFD_IOC_DBG_WAVE_CONTROL_DEPRECATED \ |
| 692 | AMDKFD_IOW(0x10, struct kfd_ioctl_dbg_wave_control_args) | 773 | AMDKFD_IOW(0x10, struct kfd_ioctl_dbg_wave_control_args) |
| 693 | 774 | ||
| 694 | #define AMDKFD_IOC_SET_SCRATCH_BACKING_VA \ | 775 | #define AMDKFD_IOC_SET_SCRATCH_BACKING_VA \ |
| @@ -742,7 +823,10 @@ struct kfd_ioctl_set_xnack_mode_args { · 47 unmodified lines | |||
| 742 | #define AMDKFD_IOC_SET_XNACK_MODE \ | 823 | #define AMDKFD_IOC_SET_XNACK_MODE \ |
| 743 | AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args) | 824 | AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args) |
| 744 | 825 | ||
| 826 | #define AMDKFD_IOC_CRIU_OP \ | ||
| 827 | AMDKFD_IOWR(0x22, struct kfd_ioctl_criu_args) | ||
| 828 | |||
| 745 | #define AMDKFD_COMMAND_START 0x01 | 829 | #define AMDKFD_COMMAND_START 0x01 |
| 746 | #define AMDKFD_COMMAND_END 0x22 | 830 | #define AMDKFD_COMMAND_END 0x23 |
| 747 | 831 | ||
| 748 | #endif | 832 | #endif |