From: Chris Wilson Subject: Re: [PATCH 3/3] drm/gem: start adding support for per-file object mmaps Date: Wed, 19 Dec 2012 09:47:59 +0000 Message-ID: <6c3329$7nh8o3@orsmga002.jf.intel.com> References: <1355892119-13926-1-git-send-email-airlied@gmail.com> <1355892119-13926-4-git-send-email-airlied@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E287E5C26 for ; Wed, 19 Dec 2012 01:48:14 -0800 (PST) In-Reply-To: <1355892119-13926-4-git-send-email-airlied@gmail.com> 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: Dave Airlie , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org From: Chris Wilson Subject: Re: [proof-of-concept/rfc] per object file mmaps To: Dave Airlie , dri-devel@lists.freedesktop.org In-Reply-To: <1355892119-13926-1-git-send-email-airlied@gmail.com> References: <1355892119-13926-1-git-send-email-airlied@gmail.com> On Wed, 19 Dec 2012 14:41:56 +1000, Dave Airlie wrote: > The 2+3 patches are actually the code, the first was just a cleanup. > > Anyways the second patch describes it best, but I've taken the approach > that we just need to keep track of what filp this object has had a handle > created on, and block mmaps on it. We could also probably block a bit > more explicitly in the driver respective mmap offset retrieval ioctls, > however we need to block in mmap itself to stop people just picking misc > address and trying them. > > It doesn't really add much now, but with render nodes where we have flink_to > or fd passing it would be more useful. > > I've no idea if I'll get to do much more with this, so consider it an > indication of how I'd like it done for someone else to run with :-) Locking looks entirely non-existent for per-file mmap add/remove in the generic gem code. Also we have a pair of hooks there that look like they would be a convenient point to place that code. -Chris -- Chris Wilson, Intel Open Source Technology Centre