From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH libdrm] tests/util: Add support for meson module Date: Thu, 26 Jan 2017 16:49:32 +0100 Message-ID: <20170126154931.GA27726@ulmo.ba.sec> References: <1484747961-5418-1-git-send-email-narmstrong@baylibre.com> <20170119091955.GA29394@ulmo.ba.sec> <20170120161739.GA28228@ulmo.ba.sec> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1476746464==" Return-path: Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65CCE6E26B for ; Thu, 26 Jan 2017 15:49:41 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: ML dri-devel , Neil Armstrong List-Id: dri-devel@lists.freedesktop.org --===============1476746464== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 20, 2017 at 06:28:39PM +0000, Emil Velikov wrote: > On 20 January 2017 at 16:17, Thierry Reding wrote: > > On Fri, Jan 20, 2017 at 02:13:00PM +0000, Emil Velikov wrote: > >> On 19 January 2017 at 09:19, Thierry Reding wrote: > >> > On Wed, Jan 18, 2017 at 02:59:21PM +0100, Neil Armstrong wrote: > >> >> Add support for Amlogic Meson DRM driver merged for Linux 4.10. > >> >> > >> >> Signed-off-by: Neil Armstrong > >> >> --- > >> >> tests/util/kms.c | 1 + > >> >> 1 file changed, 1 insertion(+) > >> > > >> > Applied, thanks. > >> > > >> Was going to say "NACK use Thierry's helpers" but you've beat me to it. > >> As a Tl;DR: we _really_ want to stop using drmOpen* for anything that'= s KMS. > > > > I think it's still useful to have this helper to iterate over all > > supported driver because it enables easy testing with just a simple > > modetest. > > > > That said, for (almost) as long as I remember I've been using the -M > > option to prevent modetest from iterating over the list, which can take > > fairly long if you've got DRM_DEBUG messages enabled. > > > > I'm not sure I understand exactly what you're suggesting by "use > > Thierry's helpers". modetest and other tests use util_open() internally > > now. That in turn uses drmOpen(), though we're of course open to change > > that. Are you suggesting we somehow use drmDevice to locate existing > > devices? > > > Yes using drmDevice is what I had in mind. The only thing that was > stopping me from doing that is the lack of platform devices support. > With that in we can start purging _everything_ that uses drmOpen*. >=20 > > We could implement some heuristic that finds the first device with a > > primary node, but what if we want to support the -M option? There is > > currently no way of getting the driver from drmDevice. Maybe that's > > something we should add anyway. > > > The -M (kernel module name as given by drmGetVersion) is another > interesting topic. Feel free to skip to the Tl;Dr below. >=20 > If doing the ioctl implicitly via drmOpen or drmDevice wakes up the > device, keeping in mind that: > - it can take some time, and > - you don't always need the info >=20 > A couple of elaborate workarounds include: > - use only on demand - add DRM_DEVICE_GET_MODULE_NAME or alike to the > drmDevice2 API > Needs a big "this can be VERY slow" warning in the documentation/man > pages... first we need actual man pages for libdrm ;-) > - deprecate the whole thing and use the compat strings - how do we > handle the PCI devices ? > - use the kernel module name (foo.ko) - kind of making it an ABI, but > iirc we've already have users which depend on it > Neither PCI devices nor platform ones are consistent in their naming - > foo.ko vs the value returned by the IOCTL. >=20 > We might be able to combine the latter two ... need to double-check. >=20 > Tl;Dr: For the moment I'd leave it to the user to call drmGetVersion. Okay, sounds like a plan. The good thing is we can keep adding new module names to the util_open() helper irrespective of when we change the implementation to use drmDevice instead of drmOpen() since it is conveniently encapsulated in a single function across libdrm. Thierry --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAliKGogACgkQ3SOs138+ s6G5zRAAvucjXn4NDtIQNLDQu2mo5Eoy2jRKEPb9+mOtfHq15KekFSLUwRpU2E0z +0VVX31n/SbTA4yNWgqyjBWnzG1dKUieLdimRxtKgrdP6vBIx0LAg0xb4h6nzIX8 cXo5RuW2T991qBX1SU4Np3h0Bfq4dEhZ+8WzPvHGKE3wbc5iy1Wh3e2XE0OQa1TO pRoz1x0kvXdROVxwHNSCj4a369bRy3Q/z43jkY30ESHm7ss5izUs/KB278xCaHpO h0bSOsB8J+zXfIlpqsUBJSTYu9+U70E7KaHwJ32Bjc2OE+ZhQuxxFBTaTVYn2K0q 2IC1cC5YPspdSINTXChOTEJu3eDOWJK8BwGFS+Jsw0HUfer/b1Kap6h8GN1prXHY o6+xGo+K5Z4Z4sSLb2qRXjleMpBowRTBUpLbmCNS9na70L7c0LrTUZpv4MQNVAwX X/Zo6g2wYz/856Ohn34pjBggSKxOo65hJ2qqp6BQBtA4UdV+0eGlO86FDC7KCWYr 0Vl2m0iF6oZ8QcBf4qeaXP6AxUHlxcy8BnMFp+GWiiwREVj08AGfvcOQOKCfl8+U YHaWtqlQWj0MVTv6+KiGX7yZOwdDbzj9QPa0lW4JT98NoPY2ARQOVjyC4WiyfMfo bHyzVPCvCSEDjmIg3gJIpTWA5dVrOnXTCyRnm2oT/cVW0LhfAnQ= =pwyr -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- --===============1476746464== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1476746464==--