The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Fei Yu <fei.yu@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com, tursulin@ursulin.net,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
	linux-kernel@vger.kernel.org, fei.yu@intel.com
Subject: [PATCH] drm/syncobj: Document the handle limit in the uAPI headers
Date: Tue, 24 Nov 2026 16:15:36 +0800	[thread overview]
Message-ID: <20261124081536.4048657-1-fei.yu@intel.com> (raw)

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


                 reply	other threads:[~2026-11-24  8:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124081536.4048657-1-fei.yu@intel.com \
    --to=fei.yu@intel.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tursulin@ursulin.net \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox