* [PATCH] drm/syncobj: Document the handle limit in the uAPI headers
@ 2026-11-24 8:15 Fei Yu
0 siblings, 0 replies; only message in thread
From: Fei Yu @ 2026-11-24 8:15 UTC (permalink / raw)
To: dri-devel
Cc: christian.koenig, tursulin, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, linux-kernel, fei.yu
Commit 6ca87397aeeb ("drm/syncobj: Limit the number of handles and use
kvmalloc for user-sized arrays") rejects more than 1M (1 << 20) handles
with -EINVAL in all syncobj ioctls that take an array of handles: wait,
timeline_wait, reset, signal, query and timeline_signal.
Document the limit next to count_handles in the four uAPI structs those
ioctls use, so that userspace knows about it. The define itself stays
kernel internal.
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Fei Yu <fei.yu@intel.com>
---
This documents the limit added by the fix below, which is in mainline
since v7.4-rc4 (6ca87397aeeb) but not yet in drm-misc-next. The patch
only touches comments, so it applies and builds on drm-misc-next as is:
https://lore.kernel.org/all/20261109014852.2127723-1-fei.yu@intel.com/
As discussed in the v2 thread, the define stays kernel internal and the
limit is only documented here:
https://lore.kernel.org/all/20261104030930.3852781-1-fei.yu@intel.com/
include/uapi/drm/drm.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index bc7ef7684099..59b6e2558d82 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -963,6 +963,7 @@ struct drm_syncobj_wait {
__u64 handles;
/* absolute timeout */
__s64 timeout_nsec;
+ /* at most 1M (1 << 20) handles, more return -EINVAL */
__u32 count_handles;
__u32 flags;
__u32 first_signaled; /* only valid when not waiting all */
@@ -983,6 +984,7 @@ struct drm_syncobj_timeline_wait {
__u64 points;
/* absolute timeout */
__s64 timeout_nsec;
+ /* at most 1M (1 << 20) handles, more return -EINVAL */
__u32 count_handles;
__u32 flags;
__u32 first_signaled; /* only valid when not waiting all */
@@ -1021,6 +1023,7 @@ struct drm_syncobj_eventfd {
struct drm_syncobj_array {
__u64 handles;
+ /* at most 1M (1 << 20) handles, more return -EINVAL */
__u32 count_handles;
__u32 pad;
};
@@ -1029,6 +1032,7 @@ struct drm_syncobj_array {
struct drm_syncobj_timeline_array {
__u64 handles;
__u64 points;
+ /* at most 1M (1 << 20) handles, more return -EINVAL */
__u32 count_handles;
__u32 flags;
};
base-commit: 2f50e0a0f9d319678a67715d4160ee890f5ee6f6
--
2.53.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-24 8:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 8:15 [PATCH] drm/syncobj: Document the handle limit in the uAPI headers Fei Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®