From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 17/20] drm: add driver->set_busid() callback Date: Fri, 29 Aug 2014 14:54:58 +0200 Message-ID: <20140829125457.GQ17519@ulmo> References: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> <1409307166-12396-18-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1966531024==" Return-path: Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by gabe.freedesktop.org (Postfix) with ESMTP id C2C626E6D6 for ; Fri, 29 Aug 2014 05:55:00 -0700 (PDT) Received: by mail-we0-f181.google.com with SMTP id x48so2180059wes.12 for ; Fri, 29 Aug 2014 05:55:00 -0700 (PDT) In-Reply-To: <1409307166-12396-18-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1966531024== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gV1yUYniiDLxW66s" Content-Disposition: inline --gV1yUYniiDLxW66s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 29, 2014 at 12:12:43PM +0200, David Herrmann wrote: > One step closer to dropping all the drm_bus_* code: > Add a driver->set_busid() callback and make all drivers use the generic > helpers. Nouveau is the only driver that uses two different bus-types with > the same drm_driver. This is totally broken if both buses are available on > the same machine (unlikely, but lets be safe). It's not at all unlikely. There are quite a few people using nouveau to drive an discrete GPU over PCIe on Tegra K1. I've also been noticing lately (and I'm not sure why I didn't see it earlier, possibly because the relevant patches weren't in nouveau yet) that the nouveau kernel driver crashes when running X on Tegra K1 with nouveau (and the gk20a GPU) enabled. The reason being that the device is wrongfully marked as drm_pci_bus. > Therefore, we create two > different drivers for each platform during module_init() and set the > set_busid() callback respectively. =46rom what I can tell this patch should fix the above-mentioned issue, so thanks for that. =3D) I do have local changes that do mostly the same thing, but slightly less elegantly. > diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouv= eau/nouveau_drm.c [...] > @@ -1086,6 +1088,11 @@ EXPORT_SYMBOL(nouveau_platform_device_create_); > static int __init > nouveau_drm_init(void) > { > + driver_pci =3D driver_stub; > + driver_pci.set_busid =3D drm_pci_set_busid; > + driver_platform =3D driver_stub; > + driver_platform.set_busid =3D drm_platform_set_busid; I think at some point we may also want to remove the DRIVER_MODESET flag here. It probably won't be that easy because DRIVER_MODESET still implies !legacy. I thought I had submitted a patch series at some point to fix that (and got rid of the useless /dev/dri/cardX for render-only devices), but I don't quite remember what became of it. I seem to remember that Daniel didn't like it, but I can't recall the reason. > diff --git a/include/drm/drmP.h b/include/drm/drmP.h [...] > @@ -1507,6 +1509,7 @@ extern int drm_pcie_get_speed_cap_mask(struct drm_d= evice *dev, u32 *speed_mask); > =20 > /* platform section */ > extern int drm_platform_init(struct drm_driver *driver, struct platform_= device *platform_device); > +extern int drm_platform_set_busid(struct drm_device *d, struct drm_maste= r *m); One step closer to getting rid of this altogether. Reviewed-by: Thierry Reding --gV1yUYniiDLxW66s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUAHghAAoJEN0jrNd/PrOhregQAIAlOjZoS1A6WkKgk0yZxHNX vll6+YVyLw6f2F1k2LvBE9q3qC6VcwKzBwY7ExBXNEeebz3Qz3yTUly2A9aNsxuZ NSoQPXUrNiSBPsO3+NVwbjx38nAuJ6tttts4l1JaDKNM8t0eYDIlBOx/Rlm5CGSS 7mIYgJCBnMIHKTRlvI5cFFNKZ/lwkuBbw5Ds5pGEXw1Ki1jzGs54Jpj/gPusjeCr fgufSzjbpzmoAMfoemGD2uCcQ0Sc53XNmmpye0jW9fS2zJPaDZ4AWYz6RdQ92VYa QVIjD6m0amQhe/yd79JrCBwE1fvkavlkt4+h0vUNAI+pfhSa9+oCUbYERu0ZCGfq YQHJKuSU5J7CwDWMC030AB6MsisLcNz0dhR9dE5XciJhassitJ0YfXRlN2TT38n0 kGNXLnpIaKJCpEfIddte0Yc+tc6ekiVFk2khujWswVh6CnF/NRGDT1nmoTiJr4mB yxt6YNMPjm+7AKOCqMyiUi9BCt1HAVayiJ/780YCKMDSTT6XeFdpm64F+ZKV+KfZ YB7odFMiFLUspfoN8bS61E+TP5Ge5/uPL/xBoE35x1jYVP49hjKeezepRdYUDBC7 BsgzJhrD35kjV9zPnTF//AMnE9gciRVLr2JrePadnzGoNoKN7ZSusawsw+G28aDv /g9hewb7d4Enq/WKDceJ =s0Sq -----END PGP SIGNATURE----- --gV1yUYniiDLxW66s-- --===============1966531024== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1966531024==--