From: Daniel Vetter Subject: Re: dma-buf non-coherent mmap Date: Fri, 1 Nov 2013 00:00:51 +0100 Message-ID: <20131031230051.GK4167@phenom.ffwll.local> References: <52728CA5.4030506@vmware.com> <5272C055.5010400@vmware.com> <5272C68D.7000409@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A079F00A7 for ; Thu, 31 Oct 2013 16:00:25 -0700 (PDT) Received: by mail-ee0-f42.google.com with SMTP id b45so2100342eek.15 for ; Thu, 31 Oct 2013 16:00:24 -0700 (PDT) Content-Disposition: inline In-Reply-To: <5272C68D.7000409@vmware.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Thomas Hellstrom Cc: "linaro-mm-sig@lists.linaro.org" , Daniel Vetter , "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Thu, Oct 31, 2013 at 10:07:25PM +0100, Thomas Hellstrom wrote: > On 10/31/2013 09:48 PM, Dave Airlie wrote: > >On Fri, Nov 1, 2013 at 6:40 AM, Thomas Hellstrom wrote: > >>Well, I'd be happy to avoid mmap, but then what does optional mean in this > >>context? > >>That all generic user-space apps *must* implement a workaround if mmap isn't > >>implemented? > >> > >>It's unfortunate a bit like implicit synchronization mentioned in section 3) > >>in Direct Userspace Access/mmap Support > >>in the kernel dma-buf doc: It should be avoided, otherwise it might be > >>relied upon by userspace and exporters > >>not implementing it will suffer. > >> > >>In reality, people will start using mmap() and won't care to implement > >>workarounds if it's not supported, and drivers like > >>vmwgfx and non-coherent architectures will suffer. > >> > >>I haven't looked closely at how DRI3 or Wayland/weston use or will use > >>dma-buf, but if they rely on mmap, we're sort > >>of lost. MIR uses the following scheme: > >DRI3 and wayland won't use dma-buf mmap directly, > > > >using dma-buf mmap directly is wrong for anything that shares objects > >with itself. > > That sounds good to hear. Perhaps we should add that to the dma-buf docs. Userspace mmap was essentially added as a concession to the android ion guys since they really, really wanted it. We've tried to tell them that it's a horrible idea (see all the fun with coherency and syncing), but they said that they have userspace for it already and so we let it be. Imo if you're not running Android userspace there's no need for this at all. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch