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
24#define DRM_PANFROST_SET_LABEL_BO 0x0924#define DRM_PANFROST_SET_LABEL_BO 0x09
25#define DRM_PANFROST_JM_CTX_CREATE 0x0a25#define DRM_PANFROST_JM_CTX_CREATE 0x0a
26#define DRM_PANFROST_JM_CTX_DESTROY 0x0b26#define DRM_PANFROST_JM_CTX_DESTROY 0x0b
27#define DRM_PANFROST_SYNC_BO 0x0c
28#define DRM_PANFROST_QUERY_BO_INFO 0x0d
27 29
28#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)30#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
29#define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)31#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
35#define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)37#define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)
36#define DRM_IOCTL_PANFROST_JM_CTX_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_CREATE, struct drm_panfrost_jm_ctx_create)38#define DRM_IOCTL_PANFROST_JM_CTX_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_CREATE, struct drm_panfrost_jm_ctx_create)
37#define DRM_IOCTL_PANFROST_JM_CTX_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_DESTROY, struct drm_panfrost_jm_ctx_destroy)39#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)
38 42
39/*43/*
40 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module44 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
@@ -120,9 +124,12 @@ struct drm_panfrost_wait_bo { · 79 unmodified lines
120 __s64 timeout_ns;124 __s64 timeout_ns;
121};125};
122 126
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 */
124#define PANFROST_BO_NOEXEC 1130#define PANFROST_BO_NOEXEC 1
125#define PANFROST_BO_HEAP 2131#define PANFROST_BO_HEAP 2
132#define PANFROST_BO_WB_MMAP 4
126 133
127/**134/**
128 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.135 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
@@ -228,6 +235,13 @@ enum drm_panfrost_param { · 99 unmodified lines
228 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,235 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,
229 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,236 DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,
230 DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,237 DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,
238 DRM_PANFROST_PARAM_SELECTED_COHERENCY,
239};
240
241enum 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,
231};245};
232 246
233struct drm_panfrost_get_param {247struct drm_panfrost_get_param {
@@ -301,6 +315,66 @@ struct drm_panfrost_set_label_bo { · 67 unmodified lines
301 __u64 label;315 __u64 label;
302};316};
303 317
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 */
325struct 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 */
351struct 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
364struct 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
304/* Definitions for coredump decoding in user space */378/* Definitions for coredump decoding in user space */
305#define PANFROSTDUMP_MAJOR 1379#define PANFROSTDUMP_MAJOR 1
306#define PANFROSTDUMP_MINOR 0380#define PANFROSTDUMP_MINOR 0
include/uapi/drm/panthor_drm.h+154−3
@@ -144,6 +144,16 @@ enum drm_panthor_ioctl_id { · 143 unmodified lines
144 * pgoff_t size.144 * pgoff_t size.
145 */145 */
146 DRM_PANTHOR_SET_USER_MMIO_OFFSET,146 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,
147};157};
148 158
149/**159/**
@@ -245,6 +255,26 @@ enum drm_panthor_dev_query_type { · 95 unmodified lines
245 DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO,255 DRM_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO,
246};256};
247 257
258/**
259 * enum drm_panthor_gpu_coherency: Type of GPU coherency
260 */
261enum 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
248/**278/**
249 * struct drm_panthor_gpu_info - GPU information279 * struct drm_panthor_gpu_info - GPU information
250 *280 *
@@ -301,7 +331,16 @@ struct drm_panthor_gpu_info { · 50 unmodified lines
301 */331 */
302 __u32 thread_max_barrier_size;332 __u32 thread_max_barrier_size;
303 333
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 */
305 __u32 coherency_features;344 __u32 coherency_features;
306 345
307 /** @texture_features: Texture features. */346 /** @texture_features: Texture features. */
@@ -310,8 +349,12 @@ struct drm_panthor_gpu_info { · 2 unmodified lines
310 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */349 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */
311 __u32 as_present;350 __u32 as_present;
312 351
313 /** @pad0: MBZ. */352 /**
314 __u32 pad0;353 * @select_coherency: Coherency selected for this device.
354 *
355 * One of drm_panthor_gpu_coherency.
356 */
357 __u32 selected_coherency;
315 358
316 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */359 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */
317 __u64 shader_present;360 __u64 shader_present;
@@ -638,6 +681,15 @@ struct drm_panthor_vm_get_state { · 320 unmodified lines
638enum drm_panthor_bo_flags {681enum drm_panthor_bo_flags {
639 /** @DRM_PANTHOR_BO_NO_MMAP: The buffer object will never be CPU-mapped in userspace. */682 /** @DRM_PANTHOR_BO_NO_MMAP: The buffer object will never be CPU-mapped in userspace. */
640 DRM_PANTHOR_BO_NO_MMAP = (1 << 0),683 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),
641};693};
642 694
643/**695/**
@@ -1040,6 +1092,101 @@ struct drm_panthor_set_user_mmio_offset { · 396 unmodified lines
1040 __u64 offset;1092 __u64 offset;
1041};1093};
1042 1094
1095/**
1096 * enum drm_panthor_bo_sync_op_type - BO sync type
1097 */
1098enum 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 */
1109struct 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 */
1135struct 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 */
1148enum 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 */
1169struct 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
1043/**1190/**
1044 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number1191 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
1045 * @__access: Access type. Must be R, W or RW.1192 * @__access: Access type. Must be R, W or RW.
@@ -1086,6 +1233,10 @@ enum { · 40 unmodified lines
1086 DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),1233 DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),
1087 DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET =1234 DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET =
1088 DRM_IOCTL_PANTHOR(WR, SET_USER_MMIO_OFFSET, set_user_mmio_offset),1235 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),
1089};1240};
1090 1241
1091#if defined(__cplusplus)1242#if defined(__cplusplus)