From nobody Sun Jul 21 13:14:44 2024 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 4WRkQs1Gxvz5RV5L; Sun, 21 Jul 2024 13:14:45 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WRkQs0hcDz4RrX; Sun, 21 Jul 2024 13:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721567685; 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=UINWRsbhsF3ZWYl6sWNgXHA2u/OEZIIOHp0h9EL1XfA=; b=fc0YTkJIvI0FRg9XtOYhC9UEaLOnarmnGBkwFR2WBEPb5yMdTbBRyzPbrhOBy3NbDo4IpF p7dm2aWdhVOHSrfifg/89pGNwlo5tH4KLWjErzJs4B5yDIv2d5PMmC6nVdZlmYeRhsy4FT TiK5JYo2m31zmNrKfQJ0gKBlUWTjsBH29Uy6+cNvcmJPQjcdS2ROObzQh0V1oXT7sX1QsD UZnfPaynyF8LkhfsDpFAh9+Fnl/RLZkuXjOZiBivZCx76x2JT9JLJNyFxkra8WvP4TQ7B6 bObvjqiUHLlSoehdHuwEvZF8pJekpdxiH59UcgRgQ1GIcLC6rrSGVGTqSpuIeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721567685; a=rsa-sha256; cv=none; b=cDboZ2yvg/ZQnFFB09BsBu2liZN5N/lY5ZxnXaN5j7VnkpANJiBSvunSnS4UQtMoG778zZ cqpG+dkRhyzVF7rsXDBvX7Z+hijOH/S/Onj0dDcFv5qFrVj9w7Me9ORauWa5f8Za/ZzCyI qqQZRJMNx9jxTG8o5ubtWC8E63mWpsyZfSYLht+bGjh8zjCq+VPZTk/LXZSESgAq983bzU fXnk/EnmGAiGZMD9Ll+RQq6qTaov2LbmsLurq164WujfCkOabG8b4/SLuDIBqgl00zOnmt LkxJ1H4FrUbPMWugVhjPS43jfJ/SkNPaBU7STOwXZS3XvFFN3p640FFGadycmQ== 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=1721567685; 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=UINWRsbhsF3ZWYl6sWNgXHA2u/OEZIIOHp0h9EL1XfA=; b=UBqRPbJcHirZsifSztgHcW/ozsEaqiW1cnaYloGVsWGc9kUnMFcRwLl6EQnndBadYj1JMA GVYYEjwAS/ivaKfhYsyHs67oZOxXWd3NN07kct5Sx7zpZ+L9nIbXQEX+R1kTuuGHSMXvMi GL3w0uN/31Zs/o18txKTo9HfLP/xRcaj4/L/hNaKh91NrDE72LPaB17Ygb+p2ZAe70YAer vF+7wpQT9QHM47nKrj/xmo7Z4I0KFHLnuHLBdjgbQp9E40s421U2k/wHqqlqBrMmkZZLxG dNb9KYhOwLyggzxKZKXUcn68MDJrMLAF1JTyVIojgtMCKFN5N4JZN5h+HSuUPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WRkQs0BC1z12Bf; Sun, 21 Jul 2024 13:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46LDEihg022901; Sun, 21 Jul 2024 13:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46LDEiqb022898; Sun, 21 Jul 2024 13:14:44 GMT (envelope-from git) Date: Sun, 21 Jul 2024 13:14:44 GMT Message-Id: <202407211314.46LDEiqb022898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5d20075f8b9f - main - LinuxKPI: Automatically enable drm support for devices named "drmn" 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d20075f8b9f7107aa0a246e5165d9816e816a44 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5d20075f8b9f7107aa0a246e5165d9816e816a44 commit 5d20075f8b9f7107aa0a246e5165d9816e816a44 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:02:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-07-21 13:02:08 +0000 LinuxKPI: Automatically enable drm support for devices named "drmn" This allows replace linux_pci_(un)register_drm_driver calls with driver renaming to FreeBSD name. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45906 --- sys/compat/linuxkpi/common/src/linux_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 825ebe319b1a..51a3b0b2ebe1 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -976,10 +976,10 @@ linux_pci_register_driver(struct pci_driver *pdrv) { devclass_t dc; - dc = devclass_find("pci"); + pdrv->isdrm = strcmp(pdrv->name, "drmn") == 0; + dc = pdrv->isdrm ? devclass_create("vgapci") : devclass_find("pci"); if (dc == NULL) return (-ENXIO); - pdrv->isdrm = false; return (_linux_pci_register_driver(pdrv, dc)); } @@ -1166,7 +1166,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) { devclass_t bus; - bus = devclass_find("pci"); + bus = devclass_find(pdrv->isdrm ? "vgapci" : "pci"); spin_lock(&pci_lock); list_del(&pdrv->node);