From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 5/5] drm/vgem: properly implement mmap Date: Thu, 9 Feb 2012 11:20:03 +0100 Message-ID: <20120209102003.GC4450@phenom.ffwll.local> References: <1328743171-13750-1-git-send-email-ben@bwidawsk.net> <1328743171-13750-6-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B46D9E765 for ; Thu, 9 Feb 2012 02:19:52 -0800 (PST) Received: by wico1 with SMTP id o1so1217096wic.36 for ; Thu, 09 Feb 2012 02:19:51 -0800 (PST) Content-Disposition: inline In-Reply-To: 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: Chris Wilson Cc: Ben Widawsky , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Feb 08, 2012 at 11:36:22PM +0000, Chris Wilson wrote: > On Thu, 9 Feb 2012 00:19:31 +0100, Ben Widawsky wrote: > > Mostly copied from i915 gtt mmaps, this will properly fault in pages as > > the user tries to use them. The only thing of note are that no > > prefaulting occurs, so perhaps some kind of madvise will happen later if > > needed. > > What's the goal here? Why not copy the simpler (from the driver > perspective) CPU mmaps? I presume that this will be required for dmabuf > in some form? Yeah, for proper instead of hacked-up dma_buf mmap support I expect that the expoerter needs to provide some sort of vm_insert_pfn_from_dma_buf function. We need this so that non-coherent dma_buf objects can fake coherency and also to allow (eventually) eviction. For that the exporter needs to be able to handle page-faults, so I've figured we might want to hack something together. I know it's not a beauty, because drm isn't a fs yet ;-) -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48