From nobody Thu Aug 01 22:32:07 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 4WZkGy6gbtz5RbFP; Thu, 01 Aug 2024 22:32:10 +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 4WZkGw13nJz4l1W; Thu, 1 Aug 2024 22:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551528; 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=GbgW7R0q8ySbQRqX0hCPRJEdW8FVUKjWZBtXEKgs6l4=; b=pvhqNd6vIaUCJHRtHxhrvgLkcNMB8eYfj/Uo3/tO0HFVjR9k4rdYHBT4tC13YFy2FbDSne /TXXavch8bXNxTWmMP8xbM3BWq3QbOqu4ns914RlY/zwHwraL91xbOquPPzVeQq9/8+XfY D4H/CSAH9VGsl5i1kUCtXv6hqa/Rp9XUcrmGasSnNV7kM4DnzMutWdm9thD4edzJTuBp1M EnpOyovXgl0qJ6pkeKXPEEg2nSRKxIcPgK5Xk//2ypu4+Nrz16uL7xVAReeZ0Q522dIye/ JOV/69GphcgyypbDEBrkwybGg8Vjl/vsUvuhdG02vuNz63tm7kdY9uLjkAVqhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551528; a=rsa-sha256; cv=none; b=RZ7KlbZ7CaBMa3ABm4uR7Bqoa1jhrOP2TM+Vt6/pvSYl42+XFADrABzdLm9IuG5ynKK+zq QX+kgjGXg3IcBfd08RO110cQ+kJCO5CBwDXLiWy1OTE+A6yGugA9LJmlnnUdTO+JkCwmLE qDM4EQfON9wMDTBxzgENrhy7hBWyqWJXZlN1qDDU62T3yLGUAV3SLdfo7AhKnZ/0Xhr3D+ I5HlqUzWB7bb8F8UqLlcjI6melAnYXx57YBpthdeX0oahLbEla4C56IDiSMMHeva7lSlIY LAC88cDd+e+UqOUMnhIZNRiJYt4NcB0KhyJrrWnCFPGM3q/8UHYX9NMfa89rRw== 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=1722551528; 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=GbgW7R0q8ySbQRqX0hCPRJEdW8FVUKjWZBtXEKgs6l4=; b=u0jZJCj9FaZRAAn5eE0kMSPmyikdgOIikCtwxfVwrtBMZGhAmtMJdslj088H4JpUgrFlSL 6I9jn4yr/gv7rM09auoAQcDcKlh/K/RXIEsjBOfwDnWmIIeSRsmJ7YyMwryPfgLzK+z72M TbJn9KD42wOvAeUhLqwbxMSdZO6myKHDkOCMC+iMuFPKo0IiOEx9FrWwCXogVaR97PFGRX 9Rt84JVtghGZ2CIfHGpXqa19OEBKfs8P97YF7NV0OE1kAnSqF2KPDPSuNdnfkSacC8Offt h0tHW+nVIQfSX+9WWW833olON1+H72RP5deUnMoGJjMofiGH0yLSDbY4LSTrpg== 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 4WZkGw0FjKz12pc; Thu, 1 Aug 2024 22:32:08 +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 471MW7Nc041094; Thu, 1 Aug 2024 22:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MW7Hv041091; Thu, 1 Aug 2024 22:32:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:32:07 GMT Message-Id: <202408012232.471MW7Hv041091@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: 85da0abada24 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 85da0abada244f90dc6e9ce36c75492f0aa9bf02 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=85da0abada244f90dc6e9ce36c75492f0aa9bf02 commit 85da0abada244f90dc6e9ce36c75492f0aa9bf02 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:02:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 22:31:06 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 5f7296d66ee9..459f03f7e2a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -752,7 +752,8 @@ 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); return (_linux_pci_register_driver(pdrv, dc)); @@ -907,7 +908,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);