From patchwork Fri Sep 4 16:58:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 7124901 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9205C9F1D5 for ; Fri, 4 Sep 2015 17:01:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6C46206A0 for ; Fri, 4 Sep 2015 17:01:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AFFAE20628 for ; Fri, 4 Sep 2015 17:01:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E06EA7A1BE; Fri, 4 Sep 2015 10:01:01 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy9-pub.mail.unifiedlayer.com (gproxy9-pub.mail.unifiedlayer.com [69.89.20.122]) by gabe.freedesktop.org (Postfix) with SMTP id 978277A1BB for ; Fri, 4 Sep 2015 10:00:58 -0700 (PDT) Received: (qmail 23869 invoked by uid 0); 4 Sep 2015 17:00:58 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy9.mail.unifiedlayer.com with SMTP; 4 Sep 2015 17:00:58 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by cmgw2 with id D50c1r00q2UhLwi0150fVx; Fri, 04 Sep 2015 11:00:56 -0600 X-Authority-Analysis: v=2.1 cv=C6F6l2/+ c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=ff-B7xzCdYMA:10 a=DfNHnWVPAAAA:8 a=f_2pASsYvXjkMiBjV9MA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=Vx4CrKC1uscOvOIeOhn9LPnAKRO5wh4bZ43N0i3O2Z0=; b=GGaWeq09E6Q939hf0/FqlBg/a7aiilaicrodmo3AedN4nnm+vTDVa1MDK1yUiJVR/OlEKTseeg0DtJinO6G2P2ebEghlYVIg1hvR7f7Ew/sb6YN6AUj0BnJJmcLCOOEa; Received: from [67.161.37.189] (port=52804 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZXuLu-0003Ni-HQ; Fri, 04 Sep 2015 11:00:38 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Fri, 4 Sep 2015 09:58:57 -0700 Message-Id: <1441385943-11508-4-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> References: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: dwmw2@infradead.org Subject: [Intel-gfx] [PATCH 3/9] android/sync: add sync_fence_create_dma X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maarten Lankhorst This allows users of dma fences to create a android fence. Cc: Daniel Vetter Cc: Jesse Barnes Signed-off-by: Maarten Lankhorst --- drivers/staging/android/sync.c | 13 +++++++++---- drivers/staging/android/sync.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..7f0e919 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) } /* TODO: implement a create which takes more that one sync_pt */ -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) { struct sync_fence *fence; @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) fence->num_fences = 1; atomic_set(&fence->status, 1); - fence->cbs[0].sync_pt = &pt->base; + fence->cbs[0].sync_pt = pt; fence->cbs[0].fence = fence; - if (fence_add_callback(&pt->base, &fence->cbs[0].cb, - fence_check_cb_func)) + if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) atomic_dec(&fence->status); sync_fence_debug_add(fence); return fence; } +EXPORT_SYMBOL(sync_fence_create_dma); + +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +{ + return sync_fence_create_dma(name, &pt->base); +} EXPORT_SYMBOL(sync_fence_create); struct sync_fence *sync_fence_fdget(int fd) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index a21b79f..50052e4 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -250,8 +250,9 @@ void sync_pt_free(struct sync_pt *pt); * @pt: sync_pt to add to the fence * * Creates a fence containg @pt. Once this is called, the fence takes - * ownership of @pt. + * a reference on @pt. */ +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt); struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); /*