From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/5] drm/radeon: add userptr support v5 Date: Mon, 28 Jul 2014 17:27:41 +0200 Message-ID: <20140728152741.GE4747@phenom.ffwll.local> References: <1406547012-3105-1-git-send-email-deathsimple@vodafone.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 33CCC6E3AA for ; Mon, 28 Jul 2014 08:27:35 -0700 (PDT) Received: by mail-wi0-f178.google.com with SMTP id hi2so4520141wib.17 for ; Mon, 28 Jul 2014 08:27:32 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1406547012-3105-1-git-send-email-deathsimple@vodafone.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: jglisse@redhat.com, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, Jul 28, 2014 at 01:30:08PM +0200, Christian K=F6nig wrote: > +struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, > + struct drm_gem_object *gobj, > + int flags) > +{ > + struct radeon_bo *bo =3D gem_to_radeon_bo(gobj); > + if (radeon_ttm_tt_has_userptr(bo->tbo.ttm)) > + return ERR_PTR(-EPERM); dma-buf is used by wayland and dri3, so this won't cut it. Instead you need to reject any real device attachments with a special ->attach callback to make sure that dma-bufs are still useful as buffer cookies, but not for actual cross-device sharing. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch