From nobody Tue Apr 21 22:27:12 2026 X-Original-To: dev-commits-src-all@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 4g0cRQ2LYyz6ZkbC for ; Tue, 21 Apr 2026 22:27:14 +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 4g0cRN4FGCz3Pt0 for ; Tue, 21 Apr 2026 22:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810432; 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=WOMEZD7YAWQIUztkz6nlu3b5M6k5Nu6321FTJAWRt0E=; b=ndh2SWMZC7P1UZhyIf/fQHHdACzSqf3GceTyW7u0DJUweWa3+QIWjb8RCBhj9xfOUYrO1x hy8mQbcAyg1PUvFiGjZMWPmXw2JiXMubdvPQmwmYc2wW9DYrUbQR+pMMWRIE0qFzxo57tt B6CBHBnunfrHTi/f4RGeXH/wWDn/yR6TAETzT0iDDnztHU09sDDXwXqPBNZ9g703r1IMAR WZQ5FqVzlVNP/1RUUB51QcKqkqmhbgsvkV7Hm3jnS8/MYDY5AAxkUgAIEYp7CLeTRL3R1W 41YvByB2bYJOpVUo1To/0iCZKWO89YJMIcLkTS+iXg3dC9f0ABqtkycrmN2v5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776810432; a=rsa-sha256; cv=none; b=t4WeZi4cipKPDmEOWiH9sugLDiJ3Vnmu6eKt8CCI3G1y6BYHluo4A0WHsOhBsE4SvFAK9E MtkKlz35xGmftraXZIYKVurMl9MmYE6hhAjs/0I9nQLdZ9RRaNhE6np5XN903C8QLZ7qRD ldJKw0DzGwM+0EZE0a1WzKmTzy3pGd0QTGtVj2dFJE0xKDkSMN3tJh8pN0feDWxkin74Zl uuuWBOAbONsJftWK3y4lS4Xk4z4j2uYgokHQYtpRhYDDnst/CgQkOZ3qodvEvrTUF1gr1O qwZ5z4LT6PwiBTISEUwTGcqIMH7HV00xBAynPIMF6mFRpZ/3YLB8OgdyAmTB1Q== 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=1776810432; 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=WOMEZD7YAWQIUztkz6nlu3b5M6k5Nu6321FTJAWRt0E=; b=domFFSjIRnXVLSFaUWBC5/04IilGXF7xJSspLtdLOd+ObsNCBG7XFafnvo/OrgzryWSTC3 DpGiYFu9XggBtk5ernnf+ZJjRyUpVo//BvX/15LQYgVkNnXqYp3EYz5QC9sbg2y9uEJqMa 7TcsaRvRnAAMZBRsHZoub/hWtiU0JlYmmEOdgNnPrnZReIDjdXKjAyPmeX0hv4+wXe1+y6 ytCgw7P9WV2dg8s8qVCgfGKYVLbk6ItVw4RACzkgmqCEoft6BAcEa7fi2Kauh1Xx0BKf40 R+nld+RBLuHhhROwsBnHCdivHmykdpHOQg2RVCjYJZ9DSYg+howk7ZZoM3w5mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g0cRN1tyBz13Mh for ; Tue, 21 Apr 2026 22:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36bda by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Apr 2026 22:27:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: ae1f6954e2c8 - main - linuxkpi: Define `MINORBITS` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: ae1f6954e2c82ad7f1d8b80155a921b908d51756 Auto-Submitted: auto-generated Date: Tue, 21 Apr 2026 22:27:12 +0000 Message-Id: <69e7f9c0.36bda.6e7d1768@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=ae1f6954e2c82ad7f1d8b80155a921b908d51756 commit ae1f6954e2c82ad7f1d8b80155a921b908d51756 Author: Jean-Sébastien Pédron AuthorDate: 2026-04-13 21:47:22 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-04-21 22:18:25 +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 Differential Revision: https://reviews.freebsd.org/D56447 --- 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)