From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH v5 4/5] drm: Add library for shmem backed GEM objects Date: Thu, 29 Nov 2018 15:58:01 -0800 Message-ID: <87h8fzjv1y.fsf@anholt.net> References: <20181017130454.44292-1-noralf@tronnes.org> <20181017130454.44292-5-noralf@tronnes.org> <87k1kzgxve.fsf@anholt.net> <20181127085850.GX4266@phenom.ffwll.local> <87lg5es1bf.fsf@anholt.net> <20181128082251.GI4266@phenom.ffwll.local> <87mupseuo7.fsf@anholt.net> <20181129091707.GD21184@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1194295456==" Return-path: In-Reply-To: <20181129091707.GD21184@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: david@lechnology.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Noralf =?utf-8?Q?Tr=C3=B8nnes?= , sam@ravnborg.org List-Id: dri-devel@lists.freedesktop.org --===============1194295456== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Daniel Vetter writes: > On Wed, Nov 28, 2018 at 01:52:56PM -0800, Eric Anholt wrote: >> Daniel Vetter writes: >>=20 >> > On Tue, Nov 27, 2018 at 12:38:44PM -0800, Eric Anholt wrote: >> >> Daniel Vetter writes: >> >>=20 >> >> > On Mon, Nov 26, 2018 at 04:36:21PM -0800, Eric Anholt wrote: >> >> >> Noralf Tr=C3=B8nnes writes: >> >> >> > +static void drm_gem_shmem_vm_close(struct vm_area_struct *vma) >> >> >> > +{ >> >> >> > + struct drm_gem_object *obj =3D vma->vm_private_data; >> >> >> > + struct drm_gem_shmem_object *shmem =3D to_drm_gem_shmem_obj(ob= j); >> >> >> > + >> >> >> > + drm_gem_shmem_put_pages(shmem); >> >> >> > + drm_gem_vm_close(vma); >> >> >> > +} >> >> >> > + >> >> >> > +const struct vm_operations_struct drm_gem_shmem_vm_ops =3D { >> >> >> > + .fault =3D drm_gem_shmem_fault, >> >> >> > + .open =3D drm_gem_vm_open, >> >> >> > + .close =3D drm_gem_shmem_vm_close, >> >> >> > +}; >> >> >> > +EXPORT_SYMBOL_GPL(drm_gem_shmem_vm_ops); >> >> >>=20 >> >> >> I just saw a warning from drm_gem_shmem_put_pages() for >> >> >> !shmem->pages_use_count -- I think drm_gem_vm_open() needs to >> >> >> drm_gem_shmem_get_pages(). >> >> > >> >> > Yeah we need a drm_gem_shmem_vm_open here. >> >>=20 >> >> Adding one of those fixed my refcounting issues, so I've sent out a v6 >> >> with it. >> > >> > Just realized that I've reviewed this patch already, spotted that vma >> > management issue there too. Plus a pile of other things. From reading = that >> > other thread discussion with Noralf concluded with "not yet ready for >> > prime time" unfortunately :-/ >>=20 >> I saw stuff about how it wasn't usable for SPI because SPI does weird >> things with DMA mapping. Was there something else? > > Looking through that mail it was a bunch of comments to improve the > kerneldoc. Plus a note that buffer sharing/mmap is going to be all > incoherent and horrible (but I guess for vkms we don't care that much). > I'm just kinda vary of generic buffer handling that turns out to not be > actually all that useful. We have lots of deadends and kinda-midlayers in > this area already (but this one here definitely smells plenty better than > lots of older ones). FWIW, I really want shmem helpers for v3d. The fault handling in particular has magic I don't understand, and this is not my first fault handler. :/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlwAfQkACgkQtdYpNtH8 nuhfFw//RkUTllJLA+SNHL0KBKrKjUxxDWIuwr+/qvstmFfcVRQbNrcRXVKu47b2 TYGQktqIzjw8DgBjfDtq3SghJEMI8oG0NaYTB6KUm7Ob5g1OkHBIfzX08IaTxDcr x5jLkC7mzHS504UwTrVKhO794vy3c3z/YJ30xBQSb6I/r+dtqCvtJ5mK9QEVSxjy TbnLtg/gIDSMmpIFujGXP6+kRCMbOYq8avaRc/hZWxWzYcKI9VfmtHAkf7h/yFUA UDmiq5aaBfl/YYGoLN263M/yRy79buhcYFMOOyzuFYBFvAfMw4meQ/9eWFEo59JE UGRG7fKRvs5WKHHSqRThwEIgIpIXJZvZp1zAXNsHQiX1y3wsV791qmcQSTKqvdiJ R0pcDJQX9xqgE9kNmBXUJ5gQklhQeVwd80M10aPBMvs8zDnKTVGM/9bLcxs1wJU8 //kWOxgs2ZVuVSbMqg4fSCFKpAuBqezZUpsKk07LRxPxoZt937iT8C0Km4lxYWuX KQ2qIRqdcqeDINU6cQBqhFoRDypVBbtPub2++umcX7JgEeMUH14rykhFkwfsnRlv OjJFMXbMLua+NOF+Fsr4iBQ6PqdheE7U1weo156iMXBgpSLTFYjkB+bnXBXjBHSI FPQCoNUAEs/zTI0vFk5JY0e/S2ZQm80/B748iUAAsduYYGrxZnA= =omxp -----END PGP SIGNATURE----- --=-=-=-- --===============1194295456== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1194295456==--