From: Ben Widawsky Subject: Re: [RFC PATCH] drm/vgem: virtual GEM provider Date: Wed, 8 Feb 2012 00:28:57 +0100 Message-ID: <20120207232857.GA19150@seagal.amr.corp.intel.com> References: <1326309561-21055-1-git-send-email-ajax@redhat.com> <87mx9u2dx3.fsf@eliezer.anholt.net> <1326315860.28557.91.camel@atropine> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0865888281==" Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 493ED9E8EB for ; Tue, 7 Feb 2012 15:30:05 -0800 (PST) In-Reply-To: <1326315860.28557.91.camel@atropine> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Adam Jackson Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0865888281== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 11, 2012 at 04:04:20PM -0500, Adam Jackson wrote: > On Wed, 2012-01-11 at 12:16 -0800, Eric Anholt wrote: >=20 > > I remember at one point you had a plan along the lines of passing shmem > > fds across the protocol. I'm curious what happened to that -- too hard > > to get the passing to work, or something else? I'm just thinking of > > kernel developer grumbling that you've duplicated something that pretty > > much existed before. >=20 > There's no way to pass an fd without passing an extra byte of in-stream > data, and it's weirdly invasive to try to thread that into the existing > protocol. Sort of the same way getting socket peer credentials with > recvmsg(SCM_CREDENTIALS) sucks, which is why we have > getsockopt(SO_PEERCRED) instead. But unlike process credentials, > SCM_RIGHTS is a queue, which is a funny kind of API to bolt into > setsockopt. >=20 > Making something that looked like a hardware driver seemed way more > symmetric. And, in the long-range future of being able to pass GEM > objects among DRM devices, you'll probably want to apply any constraints > like tiling round-up at object creation time. Doing it the other way > around - xserver allocates with shm_open() then promotes to GEM - just > introduces a way userspace can get it wrong. >=20 > > If you can, I recommend using the intel gtt mapping type of mmap ioctl, > > where it gives you back an offset that you use the mmap syscall on, and > > implement the vgem_gem_fault to map its pages, instead. It should avoid > > tricking userland tools like valgrind, which really sucks with the > > do_mmap()-calling ioctl we have today. >=20 > That makes sense. Having two paths by which you could hit > drm_gem_mmap() seemed weird when I was writing it. >=20 > I think the clean way of doing that requires exporting at least > shmem_fault and possibly some other shmfs details. >=20 > - ajax I'm working on this presently unless you've already done it. ~Ben --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJPMbO5AAoJEL9nTIiJEj0piu8H/0BADuYqNOGVkJiPFgRKh/0L rIvr2VevZD6wlllCHvkET+W6N0lrSlnHJUUJlvHApt7kIK8iiu9WHlNfOTxgzS5R s6IS2Zww0ok0Y9peVpMf3UGQfff0t/J4fJrQ5ppujYxh1q7YMcRiNQLmDOpOQ36u w3jagmiTD9J2L2yrNuu2BP3WPbEhT008F8YzPp80ZLWlk4XavWX9r1N1HHTrNZHc McQYAnnbPChI36I6k+0zIeuyrscdlGlJOMBU1/R1cV5PmvcJ9EjNhQRtQV/uKbqK Pk2HXxULEgFULmIH+nl0ml5o8XKGmrb3svfvCVrUVpv2502n5YgFm6IrcqbZHiA= =18C0 -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9-- --===============0865888281== 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 --===============0865888281==--