From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [Linaro-mm-sig] [PATCH 6/7] drm/vgem: import support Date: Thu, 23 Feb 2012 23:00:56 +0000 Message-ID: References: <1329938960-4903-1-git-send-email-ben@bwidawsk.net> <1329938960-4903-8-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 mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 99C039EEA1 for ; Thu, 23 Feb 2012 15:01:03 -0800 (PST) In-Reply-To: <1329938960-4903-8-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky , dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org, Dave Airlie List-Id: dri-devel@lists.freedesktop.org On Wed, 22 Feb 2012 20:29:19 +0100, Ben Widawsky wrote: > + mutex_lock(&dev->prime_mutex); > + /* First check that we don't dup on this file */ > + ret = drm_prime_lookup_fd_handle_mapping(&file_priv->prime, dma_buf, > + handle); The other example of importing bo we have already in GEM is through the use of flink and global names. There we create a new handle every time a process opens a name, and de-duplication is indeed handled in userspace if it so desires. Multiple handles pointing to the same object simplifies the code without risking kernel integrity, so why bother with kernel de-dupe? And allow userspace the extra bit of freedom to shoot itself in the foot! -Chris -- Chris Wilson, Intel Open Source Technology Centre