From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] drm: Provide drm_set_busid() fallback Date: Fri, 11 Apr 2014 20:30:04 +0200 Message-ID: <20140411183002.GA3673@mithrandir> References: <1397222936-14804-1-git-send-email-thierry.reding@gmail.com> <20140411174318.GN9262@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1286537311==" Return-path: Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F0356E39E for ; Fri, 11 Apr 2014 11:30:08 -0700 (PDT) Received: by mail-bk0-f52.google.com with SMTP id my13so2717484bkb.11 for ; Fri, 11 Apr 2014 11:30:07 -0700 (PDT) In-Reply-To: <20140411174318.GN9262@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1286537311== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 11, 2014 at 07:43:18PM +0200, Daniel Vetter wrote: > On Fri, Apr 11, 2014 at 03:28:56PM +0200, Thierry Reding wrote: [...] > > - ret =3D dev->driver->bus->set_busid(dev, master); > > - if (ret) > > - goto err; > > + if (dev->driver->bus && dev->driver->bus->set_busid) { > > + ret =3D dev->driver->bus->set_busid(dev, master); > > + if (ret) > > + goto err; > > + } else { >=20 > Hm, my plan was actually to just provide a drm_dev_setunique to drivers so > that they can set whatever their userspace wants, So that would be going one step further and not call drm_set_busid() in the first place, but rather just let drivers statically assign unique at probe/load time? Yeah, that makes sense. It's not like the unique string is going to change at runtime, is it? > and then have no set_busid implementation here at all for !pci. Perhaps for PCI there could simply be a common helper to initialize the unique string in the way it's currently generated by the PCI bus' implementation of .set_busid(). Even for PCI it's still a static string that's fixed at probe/load time, isn't it? And it isn't specific per device, only per drm_bus. > Some userspace at least uses the unique thing to match for the driver, > so we need to do the usual bending over backwards to keep it > consistent. For new drivers and userspace it should be okay to just match on the driver name. Any differentiation on a per-device basis is probably better done using a GET_PARAM ioctl than by parsing a bus ID string. Or what is userspace doing with the bus ID in the first place? > The approach with a drm_set_unique helper would also make conversion of > existing platform and usb drivers easier. Yeah, I like that better than what this patch does. Is that something you have already queued up? If not I could take a stab at it. Thierry --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTSDSqAAoJEN0jrNd/PrOhRUsQAJpTMh2Uwa2inviCDhtsGQGR +Jt4RlPDyhg2ZE0WahTMejaTvZXozuSX0FEfe/gCSAnfpt2rjX8QoAKzODgaEmzB TU2rT14glgu8NL4/mJw3ao4EghtfrmU4mNLefI5yVzcgOlIdkPrnEFUfSNitOwjO NoqHoKQPtXv3Dum+TukuoZDyTEORpCeoc9k72TkQMbe4fR5gWH+mxNbU6WwJnruf Rn1YtM0XPOrA4DUZkRxy4TppOIN+2tmJy6TquWA11s+QgsWb02bl2Ef9jCTcMDoy SFiHkzQo0EYf8KLv/CTNNYkA70vfFrrjL1P1bW7GOCwVMGUNJIni6fISE+hODdfm bXjzcK1VHgYfclGlfm6iQWMUQha9UCnDe0CQucU2LxqN+UtfZXe+ipRDyculqwF6 R1qtZViQx5f0HdLdA4q3VD9jbRXsAMl9FL/UxoPlEHfXzb9pkro3XEJGSjPeFW1I dyUS+czTf7gjmatGw1LVOQAyv3Gr/O3MnKM0nHd256Ozd6LT5sVPFZTcs8d/thSY 2kuuMnOah/pFyu9ye957QKgxCU2DGa/r6vsIUObo6TxxQ0aas677Ai0n6iHHHF44 CemlzIVgN5/CzFNw6ptGOxUOA+elh+jPA966WUyo4iMKKqWIPg/qOBwOh2alE9eQ Z07CxuvkUCW1NuNf/qqn =ipwH -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- --===============1286537311== 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 --===============1286537311==--