From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?windows-1252?Q?Christian_K=F6nig?= Subject: Re: [PATCH 1/5] drm/radeon: add userptr support v5 Date: Tue, 29 Jul 2014 10:11:36 +0200 Message-ID: <53D75738.70102@vodafone.de> References: <1406547012-3105-1-git-send-email-deathsimple@vodafone.de> <20140728152741.GE4747@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: Received: from pegasos-out.vodafone.de (pegasos-out.vodafone.de [80.84.1.38]) by gabe.freedesktop.org (Postfix) with ESMTP id C244A8984C for ; Tue, 29 Jul 2014 01:11:52 -0700 (PDT) In-Reply-To: <20140728152741.GE4747@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: jglisse@redhat.com, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Am 28.07.2014 um 17:27 schrieb Daniel Vetter: > 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. It's not only cross device sharing we need to deny, but indeed cross = process sharing of the buffer. Apart from that those buffers should never leave the driver in any way. Christian. > -Daniel