From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: drm: Why shmem? Date: Tue, 29 Aug 2017 10:40:04 -0700 Message-ID: <87ziaiqnm3.fsf@anholt.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0172968490==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F89A6E12C for ; Tue, 29 Aug 2017 17:43:52 +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: Daniel Vetter , Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: dri-devel List-Id: dri-devel@lists.freedesktop.org --===============0172968490== 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 Mon, Aug 28, 2017 at 8:44 PM, Noralf Tr=C3=B8nnes = wrote: >> Hi, >> >> Currently I'm using the cma library with tinydrm because it was so >> simple to use even though I have to work around the fact that reads are >> uncached. A bigger problem that I have become aware of, is that it >> restricts the dma buffers it can import since they have to be continous. >> >> So I looked to udl and it uses shmem. Fine, let's make a shmem gem >> library similar to the cma library. >> >> Now I have done so and have started to think about the DOC: section, >> explaining what the library does. And I'm stuck, what's the benefit of >> using shmem compared to just using alloc_page()? > > Gives you swapping (and eventually maybe even migration) since there's > a real filesystem behind it. Atm this only works if you register a > shrinker callback, which for display drivers is a bit overkill. See > i915 or msm for examples (or ttm, if you want an entire fancy > framework), and git grep shrinker -- drivers/gpu. The shrinker is only needed if you need some impetus to unbind objects from your page tables, right? If you're just binding the pages for the moment that you're doing SPI transfers to the display, then in the remaining time it could be swapped out, right? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlmlpvQACgkQtdYpNtH8 nuh4VRAAqNtwJn3vmBYdzdvurT7qqR1yGJh+eY7gINOoT7PjyzJSMOES8TysZAKW 3zkQrPjbm3Gbyy9gFK16mP8CX1cZhBocUNdFzoFoTwEMRXgo1rFA/HEG3LOGnjie a+viyHsBB7vguc+8+GumCYZCwPVkN44dxisKwaz7F5mQbQPSjdXd9tyl1uPHohkD GWabOprXAm706zpuJoBE4y6JGOmMpri8HTVpYDkibnEGEKu8jSP5joG1+mP+Hlan J79ErVRONpbyVjJF/uEiT2qT6WsDDHr1Qe20rcYhS3cGaJUjfOgYCJ7XAidmVXaT iMwSl0RBCrdm89O61JmoK0wZNckJzywR9IdnlRdU5OTUmCJW7n52vDml/Jq2r8sp nEXT+znR1q08A53wFVMmeq/rqYCUEeo+v/MW+1BxUkjDvrxoLaxxVF0Nd9YJLPTT P/iCEHLEDzEhIBfcZYuFGza5jw4TLH4UfI1clane+SGWvcWXh5VzwYZEdSU2hyy6 hH4AEKeAt6PrEWq2aKbFK5f+N6kF8Qj/aJP9wjUkGDMncGxYPvF+q2FZTFURqDCl BiOeSb6G9fK2f/sYMJJVZrVxMQjbf5Of2odNim32SBtlZHZbU+hBHhb7bUNufXHr Al27RdhG7zRGZZMaRiwxzYBXqjUkpSMcCB92IDGT25jKCiVMgag= =zm/I -----END PGP SIGNATURE----- --=-=-=-- --===============0172968490== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0172968490==--