From nobody Thu Aug 01 22:27:56 2024 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 4WZkB53Mcvz5RZpx; Thu, 01 Aug 2024 22:27:57 +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 4WZkB42Tqtz4ZX4; Thu, 1 Aug 2024 22:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551276; 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=u+XW0fw9k2ty3+WsVx4UA95YE5mTHJtxKL+THtAVaW8=; b=j86kX6a7ana+/TTKkLYmASOxIxzqNNwAR+kMBp/GUrXgWMdCOx/O8grd8hBeQkGVNonzmr ffDGReKG6wcAMc1N1mdTQdivouh7EU1pjKvXNNMrgbuEummPyj9Kvp5MTdJe8ANBThLDZZ ckt2tuWUjBf0kzxmvXaPhvdYc2tkyBV/O3e1OKg35gdegQ23hksX0G9Ns5NxrmW7asC/Ez oEaomVLrU3bL9OnpF83DC1jLUpVDunrgiXxjA9diq4nGVV1lJuPnd7Q7xKFgxtdd5OeDYD 5CHBxroqyB7m6E+vJ553QgW5IToPiPkOg24wCFOlk0calS93pP6jh0gEBy9wmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551276; a=rsa-sha256; cv=none; b=j4oF/gu6PhCkXIR3/qC5BGAJYNLjubpY9CXFXyNtOBopOvwu52OQ8pjhjz66pJkraJtRIg Gk387dzvKjs9TTckyCEomXn32X7GMKoI6CYVxuoX197u9LFl3eNMVWwIMLEWxaKy/EumPc 4VP2LRYsb4JPlHxqGjSLbsFSx2+EgNA75eBa2oOdoC9aEM+TGY1le1FKJGfBecbEDsI19E 8zxvyxeJKbA367mx/XmeO/aDGu8hkhbiaSyyPjQJ+Gufb+L9LRovkubLZ2VtNz4Pwy8dZS zasCifelA1d5WFFny5gJB8cKbmrP4Q6hKiFGXj1MAuTYRqvZGkSJp6gG3f4twA== 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=1722551276; 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=u+XW0fw9k2ty3+WsVx4UA95YE5mTHJtxKL+THtAVaW8=; b=e++qd5Xk5fxFDDrD4Ub5+k3++647cj6x5u8aCYo1xCvsHKZJjniIwmetsZrzqigNMfv0ml ePBt+lxOvckzhVWqFVOC7NR+btzR63+Oxh9tLNNSSoqElknkoXU1+ynkzP1bFIGmQNUqsC 1Yai1nghy67FxueLN3KQLi+g6Yt6e6ynHYJeloOaUawiz6NPxAre1dRYYLVW7GQSuXH5cC KegeMI+R/7wX8D3Jmnfgo84okOenceW2lcG+grGIFaR+gnwcFhRdcNFmaN2TdBdu7GSaOW HxKgDrLrFZUg9wNY1kaJg5mLzLWRw0gWCWxFtHB8WeXIGC8WESV72hADsQEBDw== 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 4WZkB40rpPz12tP; Thu, 1 Aug 2024 22:27:56 +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 471MRufJ028334; Thu, 1 Aug 2024 22:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRuRu028331; Thu, 1 Aug 2024 22:27:56 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:56 GMT Message-Id: <202408012227.471MRuRu028331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8a6ec2975633 - stable/14 - LinuxKPI: Automatically enable drm support for devices named "drmn" 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a6ec2975633f9649c1d8fcb92df55a8a349f554 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8a6ec2975633f9649c1d8fcb92df55a8a349f554 commit 8a6ec2975633f9649c1d8fcb92df55a8a349f554 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:02:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:14:03 +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 (cherry picked from commit 5d20075f8b9f7107aa0a246e5165d9816e816a44) --- 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 551b924d6f5e..3ed0f268d5f9 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -975,10 +975,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)); } @@ -1165,7 +1165,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);