From patchwork Wed Dec 3 19:49:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 5432871 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95AC6BEEA8 for ; Wed, 3 Dec 2014 19:49:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B86C02035C for ; Wed, 3 Dec 2014 19:49:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A4C4B201ED for ; Wed, 3 Dec 2014 19:49:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 828826E0E9; Wed, 3 Dec 2014 11:49:13 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 60F7F6E0BC for ; Wed, 3 Dec 2014 11:49:12 -0800 (PST) Received: by mail-pd0-f176.google.com with SMTP id y10so16058716pdj.21 for ; Wed, 03 Dec 2014 11:49:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oiqd/pwqEUn6WXUGZyde9gUxy4G5YOM4mu7MjtSSMjE=; b=Rme4VQP9cKOX3u3IvhxUre1ZgJFqnqe0hKMvOeCjyX1QAb/peLBqeVzU7EwSTkNj1q 2JbZDc/23kkZVklWbj3/G3kOgf7upz3oRfPDcnp8eqGDNluji1wvfQdw0cAWMIXtn2ds D8p0hwbUFMLrIASDENJY485sKYzD3E1Fn1Wm910AuwxpeesDMdX8DxYUlwCmDxOzMAwo aevNFz8nHis9L4RFWDBP13XxPIVGb5NTZuMoK2huorGJ4iwzat01AaysXrrD7WFsf3Ty xszh8jEnXCXl6nnygZYCXhboA6n4QE+1cWJxMiOnMd0P+Wkqp6nwE2013pPUKSYz48ug ScdQ== X-Received: by 10.66.100.134 with SMTP id ey6mr3700088pab.116.1417636152122; Wed, 03 Dec 2014 11:49:12 -0800 (PST) Received: from localhost.localdomain (c-67-161-37-189.hsd1.ca.comcast.net. [67.161.37.189]) by mx.google.com with ESMTPSA id hk9sm13694668pdb.47.2014.12.03.11.49.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Dec 2014 11:49:11 -0800 (PST) From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Dec 2014 11:49:05 -0800 Message-Id: <1417636147-29664-2-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417636147-29664-1-git-send-email-jbarnes@virtuousgeek.org> References: <1417636147-29664-1-git-send-email-jbarnes@virtuousgeek.org> Cc: Maarten Lankhorst Subject: [Intel-gfx] [PATCH 1/3] android: 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 7bdb62b..0ee333e 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); /*