From: Adam Jackson Subject: Re: [RFC PATCH] drm/vgem: virtual GEM provider Date: Wed, 11 Jan 2012 16:04:20 -0500 Message-ID: <1326315860.28557.91.camel@atropine> References: <1326309561-21055-1-git-send-email-ajax@redhat.com> <87mx9u2dx3.fsf@eliezer.anholt.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0017755139==" Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id B98B79E76D for ; Wed, 11 Jan 2012 13:04:24 -0800 (PST) In-Reply-To: <87mx9u2dx3.fsf@eliezer.anholt.net> 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: Eric Anholt Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0017755139== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-GRkZOI2GWIMx03ZX3XYz" --=-GRkZOI2GWIMx03ZX3XYz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2012-01-11 at 12:16 -0800, Eric Anholt wrote: > 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. 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. 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. > 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. That makes sense. Having two paths by which you could hit drm_gem_mmap() seemed weird when I was writing it. I think the clean way of doing that requires exporting at least shmem_fault and possibly some other shmfs details. - ajax --=-GRkZOI2GWIMx03ZX3XYz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk8N+VQACgkQW4otUKDs0NNKJQCg0mu6mcUdKUrC6P6OsUkvzVIc KHUAnAppIpSTo3eae85lVmEZwjqlQkXN =mXPQ -----END PGP SIGNATURE----- --=-GRkZOI2GWIMx03ZX3XYz-- --===============0017755139== 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 --===============0017755139==--