From nobody Wed Apr 29 21:42:48 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g5W4S6gmfz6c0dC for ; Wed, 29 Apr 2026 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g5W4S1MrCz3gZT for ; Wed, 29 Apr 2026 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777498968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clHqo0LSg1Z9to2ag4Z6VOnjybNDSmihDUvy2U46CN0=; b=wIFO0beYsC14A08aZ7PBthI0k+hNeyP0yZQASIom4KALwLnu4WD+hK+Xv8mAjjIR5WJ9Tf WVWkYTPPJ69Mn6kF9cxsCL6y1I0SzRrLPRbqPze7R508/jS+XBn6QNMA2eO4d9t6REXXFh uxqE9X03pOhRPql4u1gi6aF3MicvdoVO3WPeLREN+ZfEArZLbFqq3wG9qzX193ZLTIIUHO m0m8SiY6LWqeJ8vTseAJ24PQJFsU0c0RWyNYkCNnXh2dLqtvemDQUAcgmD3pVKrlPSwT4s INcQ8DSWJ6NI4B+5afxJqjwRMRvMMR0h2y0LAFLycnI83I+/ECUhNcZ4z/b/3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777498968; a=rsa-sha256; cv=none; b=oMixnwQ+UaJs7xh3EVW2mYvam3a23CGTlvcdYqDLDUQYZhCJBKpRQ5AXC3Y8BTPtl27B3S A44teFa6Yeahty/a190rdFTLib34nCyY4RNO8R69wHFpb9YeLb+yiQFFKDraBCGV1FbGK7 QQwY9ahVJxYXRdZiAPuIdhYbbsBYequ+Sd2D/GMtH2EamNH4Spmvqu3h2WlNKvY2QjhXH9 RM5++klo1JZuZZF1qmQN+/ML5mMtV+fP7M/4UXledDe9jYiVCpcwwAgVuTHn8ZNbl3EP3V 0MCh1JFGtZPot/sFma05m1A/09err58N7Xhus2LnO8hs/vbrQIJF/rX8ibe22g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777498968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clHqo0LSg1Z9to2ag4Z6VOnjybNDSmihDUvy2U46CN0=; b=LZVfCVtbn/8951Rg2crngGqh95f/pJDlJVFE889noDUfreRqRjsGUwNcIMOO/T+JYW6a0R 5F6JYjdFc4a5BIrgbEGSc+6QCFyyZ50+ROpdejM0pNgnLVWqnQfMCpxyKwApScwcmnPVqa DBHZpeTxrfIkXael+CvCAi6Oc6VVTjCSmGNSDGtllHOOl6SvBjkPnnqXm9STMM7hRpiUTl o6hSunLhEl78g3la6QQZiyGyS8zWd53I6MEYcevBHEBiauIP6Inv0R6WmCEANj5JY9zATg uHDcY6brGmefKoJI4DjNFd/TAs3k7kepObpX8TOnFvcgp207lICKCxmBVCCfjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g5W4S0kLfzyZS for ; Wed, 29 Apr 2026 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47fb8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 29 Apr 2026 21:42:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: e93eb7b7f821 - stable/15 - linuxkpi: Define `MINORBITS` List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e93eb7b7f821160958261e5678f5bafde8237a84 Auto-Submitted: auto-generated Date: Wed, 29 Apr 2026 21:42:48 +0000 Message-Id: <69f27b58.47fb8.1466c518@gitrepo.freebsd.org> The branch stable/15 has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=e93eb7b7f821160958261e5678f5bafde8237a84 commit e93eb7b7f821160958261e5678f5bafde8237a84 Author: Jean-Sébastien Pédron AuthorDate: 2026-04-13 21:47:22 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-04-29 21:03:18 +0000 linuxkpi: Define `MINORBITS` We can't really define a proper value for this constant because minor and major are encoded in a complex way on FreeBSD which cannot be represented with a simple shift. The DRM generic code started to use it in Linux 6.12. In this context, `MINORBITS` is used to define an upper limit passed to `xa_alloc()`. Therefore it is not used to encode or decode minors. It is used as an arbitrary value. Therefore, we define the constant to 20, like on Linux. Reviewed by: bz Sponsored by: The FreeBSD Foundation (cherry picked from commit ae1f6954e2c82ad7f1d8b80155a921b908d51756) --- sys/compat/linuxkpi/common/include/linux/kdev_t.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kdev_t.h b/sys/compat/linuxkpi/common/include/linux/kdev_t.h index 988dd771254a..964b7078e7f5 100644 --- a/sys/compat/linuxkpi/common/include/linux/kdev_t.h +++ b/sys/compat/linuxkpi/common/include/linux/kdev_t.h @@ -31,6 +31,21 @@ #include +/* + * The encoding of major/minor on FreeBSD is complex to take into account the + * compatibility with 16-bit dev_t (see ). It is not possible to + * use a simple shift and thus, we can't have a proper definition of + * `MINORBITS`. + * + * At the time this is added to linuxkpi, this is used by the DRM generic code + * as the upper limit to allocate an ID using an xarray. It is not used to + * decode a minor, therefore any arbitrary value here is fine in this context. + * + * On Linux, the value is set to 20. Because of the above, we reuse this value, + * even so it does not correspond to the actual minor encoding on FreeBSD. + */ +#define MINORBITS 20 + #define MAJOR(dev) major(dev) #define MINOR(dev) minor(dev) #define MKDEV(ma, mi) makedev(ma, mi)