Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751333AbdDBQpC (ORCPT ); Sun, 2 Apr 2017 12:45:02 -0400 Received: from home.keithp.com ([63.227.221.253]:59758 "EHLO elaine.keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750986AbdDBQpB (ORCPT ); Sun, 2 Apr 2017 12:45:01 -0400 From: Keith Packard To: Daniel Vetter Cc: linux-kernel@vger.kernel.org, Dave Airlie , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 4/4] drm: Add four ioctls for managing drm mode object leases In-Reply-To: <20170402132356.pgqzokifall7zjzy@phenom.ffwll.local> References: <20170401170841.2643-1-keithp@keithp.com> <20170401170841.2643-5-keithp@keithp.com> <20170402132356.pgqzokifall7zjzy@phenom.ffwll.local> Date: Sun, 02 Apr 2017 09:44:58 -0700 Message-ID: <861stakbcl.fsf@hiro.keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3144 Lines: 74 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Daniel Vetter writes: > Should we just use fd for this? Essentially lessors would be required to > keep track of all their pending leases, and just dup() them over to the > client. Would reduce the uapi scope a bit, and if a lessor can't keep > track of it's leases there's a problem. Right now, the lease terminates when the fd closes. If the lessor is holding the fd open, it would have to have some out-of-band indication that the lessee was done so that it could close its copy of the fd. However, it's not clear what value these query APIs have for the lessor in any case; surely it can remember what resources are in each lease without needing a kernel API. For the lessee, this API provides a way of learning about changes to the lease. That would mean getting rid of the lessee id in the requests, which seems good. I added them mostly to make checking the code easier during development; it caught a nasty bug where I was smashing the lessor file_priv with the lessee due to poor choice of variable names in the kernel code. I was thinking this morning that the lessee would like to know not only the ID but also the type of each resources so that it could figure out how to use the lease. I'll rewrite these to only return the resources for the fd provided, but to return both id and type. For listing lessees, I don't see value in allowing the lessor to look at sub-leases made by the lessee, so I'll remove the lessor id from that request and have it just return the list of lessees for the current lessor. > For this one here we could pass the fd of the lease as the argument. I > also still think that for v1 we just want revoke and otherwise invariant > leases. Makes things simpler. Again, that means that lessor would need to hold the lease fd open, which makes it hard to know when the lessee is done. However, there's no reason the lessor should be in control of the lessee's sub-leases, so again, I propose to restrict the scope of lessees to those directly under the lessor. > Non-driver functions please into drm-internal.h, we don't want to let > drivers even see this :-) Thanks! =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAljhKooACgkQ2yIaaQAA ABF57RAAlRUm6+gq5XHb/r7ZbpollruJLdxyUkh7xELYgd/GZF2086xE56rexgsz Cz8wm595afDlbMHi5FuO6K+0QwMRTwmvueSvCAZYdD2khveGQP+Xh6mZrB9gKRph FnWgK101odGB6/RJQKDgh/g77YyvjlkndnhB2kgbqRamtHAU7v3CUJd1rALGt4an tLK8HCEejPthrRMXiFfaofUqb62LHO3v+3TiPYuxF+Sj3pR5dcoML2pcCZR1nQwD Gj6Aj1LBNqacINGZ97I6UbIFOdCAMI3/LLzlnjXkMvQGIlMufsFZpFePzHhX9qDS 4Uc3tuua5VBlNPXrnSbU6PycLhdYlOz/ftLxI2PGi7MkWUtUgIOQSlZZ+HecyK3n FgFSp1JMbrCZ8a+SZY4zGK7SrgdIPRJlVIfcMSSDOz/KFRZ/iDmsT4Frd3wdZkYI v7N3CB2vekX0X/h2a47d5NWPEAmPjd3FXF9bErbQ1HT6jCaIvG4Dte7gi9RlLROC 6zA2WXl/4zI69d73+Nzm8aQH44Ut+2jyFcfgUK2sqSZJuH4A1tEMx0BcXhifMdY9 /RmoKR9pcrI9NLdGbMqPGb8e2g4w3Xg2CwwWbofj0ZAWdEyiOTEIO65pXa8VTcKG ox4OvOvWSxKdhSwBZfZamWXJPZQV6UfDwWwTVtpgYSfCnQWpPLU= =MgjW -----END PGP SIGNATURE----- --=-=-=--