From nobody Fri Jul 07 17:04:22 2023 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 4QyKWM1vKJz4m5wt; Fri, 7 Jul 2023 17:04:31 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4QyKWL2vpDz4Vg6; Fri, 7 Jul 2023 17:04:30 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.2/8.16.1) with ESMTP id 367H4MVu031730; Fri, 7 Jul 2023 20:04:22 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.2/8.16.1/Submit) id 367H4MPe031729; Fri, 7 Jul 2023 20:04:22 +0300 (MSK) (envelope-from dchagin) Date: Fri, 7 Jul 2023 20:04:22 +0300 From: Dmitry Chagin To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e8404a72c5df - main - vgapci: Don't create a drm helper Message-ID: References: <202307061726.366HQj28081856@gitrepo.freebsd.org> <40907bee-2ccd-d53f-9e38-4f21bed45620@FreeBSD.org> 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <40907bee-2ccd-d53f-9e38-4f21bed45620@FreeBSD.org> X-Rspamd-Queue-Id: 4QyKWL2vpDz4Vg6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, Jul 06, 2023 at 10:35:05AM -0700, John Baldwin wrote: > On 7/6/23 10:26 AM, Dmitry Chagin wrote: > > The branch main has been updated by dchagin: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e8404a72c5df939cd9ad869b12cf038c6846440a > > > > commit e8404a72c5df939cd9ad869b12cf038c6846440a > > Author: Dmitry Chagin > > AuthorDate: 2023-07-06 17:26:24 +0000 > > Commit: Dmitry Chagin > > CommitDate: 2023-07-06 17:26:24 +0000 > > > > vgapci: Don't create a drm helper > > Simply speaking, being started the drm-kmod driver should create sysfs helpers, > > which is «drm» class devices, with the unit number 0, 128 and, perhaps 64. > > If a drm helper created by vgapci driver with the corresponding unit number > > exists then the drm-kmod driver initialize it by the device_initialize() lkpi > > method, otherwise drm-kmod driver create new «drm» device. > > For hw, where two or more different GPU installed, it's not guaranteed that > > the order of loading GPU drivers will be the same as the vgapci devices numbered. > > I.e., on hw where vgapci0 is Nvidia GPU and vgapci1 is Intel GPU, when drm-kmod > > loaded first it will use drm0 helper of vgapci0 device. > > There is no problem for drm-kmod driver unless we do not traverse device > > tree, as needed for https://reviews.freebsd.org/D38545. > > drm-kmod is ok for this change as it has fallback to create corresponding > > drm device. > > Reviewed by: > > Differential Revision: https://reviews.freebsd.org/D38546 > > --- > > sys/dev/pci/vga_pci.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c > > index 12a4057a474c..64847d37f0f6 100644 > > --- a/sys/dev/pci/vga_pci.c > > +++ b/sys/dev/pci/vga_pci.c > > @@ -373,8 +373,7 @@ vga_pci_attach(device_t dev) > > bus_generic_probe(dev); > > - /* Always create a drm child for now to make it easier on drm. */ > > - device_add_child(dev, "drm", -1); > > + /* Always create a drmn child for now to make it easier on drm. */ > > device_add_child(dev, "drmn", -1); > > bus_generic_attach(dev); > > Ideally drm and drmn drivers would use identify routines called by bus_generic_probe > above to add devices instead of depending on these device_add_child calls, and > the device_add_child calls should really just go away. > > That is to say, it would be nice to remove the drmnX device_add_child, too. Agreed, I'll check Nvidia and drm-kmod > > -- > John Baldwin