History

Merge tag 'drm-misc-next-2025-12-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for 6.19: UAPI Changes: - panfrost: Add PANFROST_BO_SYNC ioctl - panthor: Add PANTHOR_BO_SYNC ioctl Core Changes: - atomic: Add drm_device pointer to drm_private_obj - bridge: Introduce drm_bridge_unplug, drm_bridge_enter, and drm_bridge_exit - dma-buf: Improve sg_table debugging - dma-fence: Add new helpers, and use them when needed - dp_mst: Avoid out-of-bounds access with VCPI==0 - gem: Reduce page table overhead with transparent huge pages - panic: Report invalid panic modes - sched: Add TODO entries - ttm: Various cleanups - vblank: Various refactoring and cleanups - Kconfig cleanups - Removed support for kdb Driver Changes: - amdxdna: Fix race conditions at suspend, Improve handling of zero tail pointers, Fix cu_idx being overwritten during command setup - ast: Support imported cursor buffers - - panthor: Enable timestamp propagation, Multiple improvements and fixes to improve the overall robustness, notably of the scheduler. - panels: - panel-edp: Support for CSW MNE007QB3-1, AUO B140HAN06.4, AUO B140QAX01.H Signed-off-by: Dave Airlie <airlied@redhat.com> [airlied: fix mm conflict] From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20251212-spectacular-agama-of-abracadabra-aaef32@penduick

Dave Airlie committed 10 months ago

Commit 6c8e4042 parents 9448598 470cb09103 files · +2537 −1482Browse files

Showing the changes to include/uapi (2 of 103 files). Show all

Unified · Split

2 files
  1. include/uapi/drm/panfrost_drm.h +75 −1
  2. include/uapi/drm/panthor_drm.h +154 −3
include/uapi/drm/panfrost_drm.h+75−1
@@ -24,6 +24,8 @@ extern "C" { · 23 unmodified lines
2424 #define DRM_PANFROST_SET_LABEL_BO 0x09
2525 #define DRM_PANFROST_JM_CTX_CREATE 0x0a
2626 #define DRM_PANFROST_JM_CTX_DESTROY 0x0b
27+#define DRM_PANFROST_SYNC_BO 0x0c
28+#define DRM_PANFROST_QUERY_BO_INFO 0x0d
2729
2830 #define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
2931 #define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
@@ -35,6 +37,8 @@ extern "C" { · 5 unmodified lines
3537 #define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)
3638 #define DRM_IOCTL_PANFROST_JM_CTX_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_CREATE, struct drm_panfrost_jm_ctx_create)
3739 #define DRM_IOCTL_PANFROST_JM_CTX_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_DESTROY, struct drm_panfrost_jm_ctx_destroy)
40+#define DRM_IOCTL_PANFROST_SYNC_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SYNC_BO, struct drm_panfrost_sync_bo)
41+#define DRM_IOCTL_PANFROST_QUERY_BO_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_QUERY_BO_INFO, struct drm_panfrost_query_bo_info)
3842
3943 /*
4044 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
@@ -120,9 +124,12 @@ struct drm_panfrost_wait_bo { · 79 unmodified lines
120124 __s64 timeout_ns;
121125 };
122126
123−/* Valid flags to pass to drm_panfrost_create_bo */
127+/* Valid flags to pass to drm_panfrost_create_bo.
128+ * PANFROST_BO_WB_MMAP can't be set if PANFROST_BO_HEAP is.
129+ */
124130 #define PANFROST_BO_NOEXEC 1
125131 #define PANFROST_BO_HEAP 2
132+#define PANFROST_BO_WB_MMAP 4
126133
127134 /**
128135 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
@@ -228,6 +235,13 @@ enum drm_panfrost_param { · 99 unmodified lines
228235 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,
229236 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,
230237 DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,
238+ DRM_PANFROST_PARAM_SELECTED_COHERENCY,
239+};
240+
241+enum drm_panfrost_gpu_coherency {
242+ DRM_PANFROST_GPU_COHERENCY_ACE_LITE = 0,
243+ DRM_PANFROST_GPU_COHERENCY_ACE = 1,
244+ DRM_PANFROST_GPU_COHERENCY_NONE = 31,
231245 };
232246
233247 struct drm_panfrost_get_param {
@@ -301,6 +315,66 @@ struct drm_panfrost_set_label_bo { · 67 unmodified lines
301315 __u64 label;
302316 };
303317
318+/* Valid flags to pass to drm_panfrost_bo_sync_op */
319+#define PANFROST_BO_SYNC_CPU_CACHE_FLUSH 0
320+#define PANFROST_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE 1
321+
322+/**
323+ * struct drm_panthor_bo_flush_map_op - BO map sync op
324+ */
325+struct drm_panfrost_bo_sync_op {
326+ /** @handle: Handle of the buffer object to sync. */
327+ __u32 handle;
328+
329+ /** @type: Type of sync operation. */
330+ __u32 type;
331+
332+ /**
333+ * @offset: Offset into the BO at which the sync range starts.
334+ *
335+ * This will be rounded down to the nearest cache line as needed.
336+ */
337+ __u32 offset;
338+
339+ /**
340+ * @size: Size of the range to sync
341+ *
342+ * @size + @offset will be rounded up to the nearest cache line as
343+ * needed.
344+ */
345+ __u32 size;
346+};
347+
348+/**
349+ * struct drm_panfrost_sync_bo - ioctl argument for syncing BO maps
350+ */
351+struct drm_panfrost_sync_bo {
352+ /** Array of struct drm_panfrost_bo_sync_op */
353+ __u64 ops;
354+
355+ /** Number of BO sync ops */
356+ __u32 op_count;
357+
358+ __u32 pad;
359+};
360+
361+/** BO comes from a different subsystem. */
362+#define DRM_PANFROST_BO_IS_IMPORTED (1 << 0)
363+
364+struct drm_panfrost_query_bo_info {
365+ /** Handle of the object being queried. */
366+ __u32 handle;
367+
368+ /** Extra flags that are not coming from the BO_CREATE ioctl(). */
369+ __u32 extra_flags;
370+
371+ /** Flags passed at creation time. */
372+ __u32 create_flags;
373+
374+ /** Will be zero on return. */
375+ __u32 pad;
376+};
377+
304378 /* Definitions for coredump decoding in user space */
305379 #define PANFROSTDUMP_MAJOR 1
306380 #define PANFROSTDUMP_MINOR 0
include/uapi/drm/panthor_drm.h+154−3
@@ -144,6 +144,16 @@ enum drm_panthor_ioctl_id { · 143 unmodified lines
144144 * pgoff_t size.
145145 */
146146 DRM_PANTHOR_SET_USER_MMIO_OFFSET,
147+
148+ /** @DRM_PANTHOR_BO_SYNC: Sync BO data to/from the device */
149+ DRM_PANTHOR_BO_SYNC,
150+
151+ /**
152+ * @DRM_PANTHOR_BO_QUERY_INFO: Query information about a BO.
153+ *
154+ * This is useful for imported BOs.
155+ */
156+ DRM_PANTHOR_BO_QUERY_INFO,
147157 };
148158
149159 /**
@@ -245,6 +255,26 @@ enum drm_panthor_dev_query_type { · 95 unmodified lines
245255 DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO,
246256 };
247257
258+/**
259+ * enum drm_panthor_gpu_coherency: Type of GPU coherency
260+ */
261+enum drm_panthor_gpu_coherency {
262+ /**
263+ * @DRM_PANTHOR_GPU_COHERENCY_ACE_LITE: ACE Lite coherency.
264+ */
265+ DRM_PANTHOR_GPU_COHERENCY_ACE_LITE = 0,
266+
267+ /**
268+ * @DRM_PANTHOR_GPU_COHERENCY_ACE: ACE coherency.
269+ */
270+ DRM_PANTHOR_GPU_COHERENCY_ACE = 1,
271+
272+ /**
273+ * @DRM_PANTHOR_GPU_COHERENCY_NONE: No coherency.
274+ */
275+ DRM_PANTHOR_GPU_COHERENCY_NONE = 31,
276+};
277+
248278 /**
249279 * struct drm_panthor_gpu_info - GPU information
250280 *
@@ -301,7 +331,16 @@ struct drm_panthor_gpu_info { · 50 unmodified lines
301331 */
302332 __u32 thread_max_barrier_size;
303333
304− /** @coherency_features: Coherency features. */
334+ /**
335+ * @coherency_features: Coherency features.
336+ *
337+ * Combination of drm_panthor_gpu_coherency flags.
338+ *
339+ * Note that this is just what the coherency protocols supported by the
340+ * GPU, but the actual coherency in place depends on the SoC
341+ * integration and is reflected by
342+ * drm_panthor_gpu_info::selected_coherency.
343+ */
305344 __u32 coherency_features;
306345
307346 /** @texture_features: Texture features. */
@@ -310,8 +349,12 @@ struct drm_panthor_gpu_info { · 2 unmodified lines
310349 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */
311350 __u32 as_present;
312351
313− /** @pad0: MBZ. */
314− __u32 pad0;
352+ /**
353+ * @select_coherency: Coherency selected for this device.
354+ *
355+ * One of drm_panthor_gpu_coherency.
356+ */
357+ __u32 selected_coherency;
315358
316359 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */
317360 __u64 shader_present;
@@ -638,6 +681,15 @@ struct drm_panthor_vm_get_state { · 320 unmodified lines
638681 enum drm_panthor_bo_flags {
639682 /** @DRM_PANTHOR_BO_NO_MMAP: The buffer object will never be CPU-mapped in userspace. */
640683 DRM_PANTHOR_BO_NO_MMAP = (1 << 0),
684+
685+ /**
686+ * @DRM_PANTHOR_BO_WB_MMAP: Force "Write-Back Cacheable" CPU mapping.
687+ *
688+ * CPU map the buffer object in userspace by forcing the "Write-Back
689+ * Cacheable" cacheability attribute. The mapping otherwise uses the
690+ * "Non-Cacheable" attribute if the GPU is not IO coherent.
691+ */
692+ DRM_PANTHOR_BO_WB_MMAP = (1 << 1),
641693 };
642694
643695 /**
@@ -1040,6 +1092,101 @@ struct drm_panthor_set_user_mmio_offset { · 396 unmodified lines
10401092 __u64 offset;
10411093 };
10421094
1095+/**
1096+ * enum drm_panthor_bo_sync_op_type - BO sync type
1097+ */
1098+enum drm_panthor_bo_sync_op_type {
1099+ /** @DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH: Flush CPU caches. */
1100+ DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH = 0,
1101+
1102+ /** @DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE: Flush and invalidate CPU caches. */
1103+ DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE = 1,
1104+};
1105+
1106+/**
1107+ * struct drm_panthor_bo_sync_op - BO map sync op
1108+ */
1109+struct drm_panthor_bo_sync_op {
1110+ /** @handle: Handle of the buffer object to sync. */
1111+ __u32 handle;
1112+
1113+ /** @type: Type of operation. */
1114+ __u32 type;
1115+
1116+ /**
1117+ * @offset: Offset into the BO at which the sync range starts.
1118+ *
1119+ * This will be rounded down to the nearest cache line as needed.
1120+ */
1121+ __u64 offset;
1122+
1123+ /**
1124+ * @size: Size of the range to sync
1125+ *
1126+ * @size + @offset will be rounded up to the nearest cache line as
1127+ * needed.
1128+ */
1129+ __u64 size;
1130+};
1131+
1132+/**
1133+ * struct drm_panthor_bo_sync - BO map sync request
1134+ */
1135+struct drm_panthor_bo_sync {
1136+ /**
1137+ * @ops: Array of struct drm_panthor_bo_sync_op sync operations.
1138+ */
1139+ struct drm_panthor_obj_array ops;
1140+};
1141+
1142+/**
1143+ * enum drm_panthor_bo_extra_flags - Set of flags returned on a BO_QUERY_INFO request
1144+ *
1145+ * Those are flags reflecting BO properties that are not directly coming from the flags
1146+ * passed are creation time, or information on BOs that were imported from other drivers.
1147+ */
1148+enum drm_panthor_bo_extra_flags {
1149+ /**
1150+ * @DRM_PANTHOR_BO_IS_IMPORTED: BO has been imported from an external driver.
1151+ *
1152+ * Note that imported dma-buf handles are not flagged as imported if they
1153+ * where exported by panthor. Only buffers that are coming from other drivers
1154+ * (dma heaps, other GPUs, display controllers, V4L, ...).
1155+ *
1156+ * It's also important to note that all imported BOs are mapped cached and can't
1157+ * be considered IO-coherent even if the GPU is. This means they require explicit
1158+ * syncs that must go through the DRM_PANTHOR_BO_SYNC ioctl (userland cache
1159+ * maintenance is not allowed in that case, because extra operations might be
1160+ * needed to make changes visible to the CPU/device, like buffer migration when the
1161+ * exporter is a GPU with its own VRAM).
1162+ */
1163+ DRM_PANTHOR_BO_IS_IMPORTED = (1 << 0),
1164+};
1165+
1166+/**
1167+ * struct drm_panthor_bo_query_info - Query BO info
1168+ */
1169+struct drm_panthor_bo_query_info {
1170+ /** @handle: Handle of the buffer object to query flags on. */
1171+ __u32 handle;
1172+
1173+ /**
1174+ * @extra_flags: Combination of enum drm_panthor_bo_extra_flags flags.
1175+ */
1176+ __u32 extra_flags;
1177+
1178+ /**
1179+ * @create_flags: Flags passed at creation time.
1180+ *
1181+ * Combination of enum drm_panthor_bo_flags flags.
1182+ * Will be zero if the buffer comes from a different driver.
1183+ */
1184+ __u32 create_flags;
1185+
1186+ /** @pad: Will be zero on return. */
1187+ __u32 pad;
1188+};
1189+
10431190 /**
10441191 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
10451192 * @__access: Access type. Must be R, W or RW.
@@ -1086,6 +1233,10 @@ enum { · 40 unmodified lines
10861233 DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),
10871234 DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET =
10881235 DRM_IOCTL_PANTHOR(WR, SET_USER_MMIO_OFFSET, set_user_mmio_offset),
1236+ DRM_IOCTL_PANTHOR_BO_SYNC =
1237+ DRM_IOCTL_PANTHOR(WR, BO_SYNC, bo_sync),
1238+ DRM_IOCTL_PANTHOR_BO_QUERY_INFO =
1239+ DRM_IOCTL_PANTHOR(WR, BO_QUERY_INFO, bo_query_info),
10891240 };
10901241
10911242 #if defined(__cplusplus)