From nobody Thu Jul 06 17:35:05 2023 X-Original-To: dev-commits-src-main@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 4QxkF70MLwz4lqM1; Thu, 6 Jul 2023 17:35:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QxkF671wJz3jRb; Thu, 6 Jul 2023 17:35:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688664907; 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: in-reply-to:in-reply-to:references:references; bh=nPrUhf7yHBbGPNImsnZeDwJjefVppMAehOn8L2SbEyQ=; b=Fk0J7J+Is7IWzGRDNZPqUb5smJ3NueC/h4jOUKLicVknvNtMID7Fqc8w52qVKeCmWvFBvB Pvu6JiRgpLjXAgcevN/7VayBVEGVkvtFj7wRC4te1zkF49kysKFjpbQ7uY9fkGS0XhJqz6 EtIwO9spCdF9BiiHoJe56dx4FWkyP6QAk7Oa3Uvv3M7gaG2BEcv5dbEqcDjl7raqbS5hbT HfLCwqvvRX5N95YX03Kd1OcyWK4M7sXjIlM978A3HTaVaVruJd4Z1g1Ntg3t1IPzrFG9xC 6Cn/cv5nN38fN70v00FQMfEg2dGzbUah7nedr4tToG+TimXZrz1NMEo03Xng9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688664907; 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: in-reply-to:in-reply-to:references:references; bh=nPrUhf7yHBbGPNImsnZeDwJjefVppMAehOn8L2SbEyQ=; b=ZNUr1r92fqrQ5xEIU3mBvjUUXwuAFK8AnvvtaCwMhA8maycf624j/QKCuMQVDtEqG9fqpx js1+05KwSWVP64Q+OrhCsGStPHXs0Kc4lArmS9joUjNm9BWqVT2xXBIfOF6WJeC+icrbUj ARGSwCiO2vkUnEBqAGrdLJUPj6yWu+yxUZQuLTVzx2hY84YJVgCxiXC310UwQxFBZVo16m BGgH9YkMCLjtZEAaxi5y1182J8xY4IAQVi96eIfR3cFbFfjL0SQRPUcLElUVq7/Ni49/N1 Zwo0r1uakH1ogtKbi+o1dUavH4CEazM9weZSGnupvM3gV/sXe5E3WHYU+OzVTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688664907; a=rsa-sha256; cv=none; b=hQgYs1FeqAd9SGFosuTyh/8lr3/l38zpy+L/40721gCuI+HsKg9bE0hwk8Kj3hb7w0+CxY TTaYGnxLRg+umR4DNhWQDaIS5lB+ehorV+eiIr0YmL1qOjofSyO5hD/Y0p7t8bWWBZE2oA QZOMPr1JjCuacLcWfrvyR6SV1fRm2K2PuRuKhmMX3qvV3PT/354cWvZESdRjwlCmgxzzUV ypuyI9ts67B/oZSe2MTo8Yt+RcMwWtgdh3F0iT1aPwQ8X8vzMHYQ6EhVZkY2J4Cl6o3dYe qX5M8a5FB4WHtDRerkJxSVxDvlejTZVKTOovyxQ5xXKb/09UzS9KyeWff/IFPw== Received: from [IPV6:2601:648:8680:16b0:f13b:a6df:ec74:6853] (unknown [IPv6:2601:648:8680:16b0:f13b:a6df:ec74:6853]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QxkF631MhzKR1; Thu, 6 Jul 2023 17:35:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <40907bee-2ccd-d53f-9e38-4f21bed45620@FreeBSD.org> Date: Thu, 6 Jul 2023 10:35:05 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: e8404a72c5df - main - vgapci: Don't create a drm helper Content-Language: en-US To: Dmitry Chagin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307061726.366HQj28081856@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202307061726.366HQj28081856@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N 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. -- John Baldwin