From patchwork Thu Aug 11 15:26:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9275415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D536360231 for ; Thu, 11 Aug 2016 15:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C66C12841A for ; Thu, 11 Aug 2016 15:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAF0F286ED; Thu, 11 Aug 2016 15:27:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 783E92841A for ; Thu, 11 Aug 2016 15:27:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCBE26E958; Thu, 11 Aug 2016 15:27:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-f196.google.com (mail-yb0-f196.google.com [209.85.213.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71AAD6E958 for ; Thu, 11 Aug 2016 15:27:09 +0000 (UTC) Received: by mail-yb0-f196.google.com with SMTP id e125so170340ybc.0 for ; Thu, 11 Aug 2016 08:27:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ORalIYF/Ore57+bDQS1cf0zzi+TDdeTYmLHp3tOHbbo=; b=bzg4dnL+sSQvYj6Gi6+8I73gCB94MK1WDC4VRkHDkeafljec3jv7OmdxfyFbjcWtOz 9CUf5SyL/mEw5WRB47tlR/Ta0VtLTZA4VMTsHMiHg16q2ZIhwc4zUTBcrVSQI1UMCV6b XFSo4Ru61eDYB6TME74sDYwzlyh5OwM9VjBv/t/bcuEdC/yryHudWltURE23k2yhffoP GZgeYswStiaqA7KpK9Z2I0u05yAyucyr2G+QJMy4QBhx3fJtMDChd9ZmVAg+FiM0RCTS YzccHavMjR7uPJwkku+susD2bw9VpJkoGmQd7DW+lCjMJKpWwHCgmCA2VXOfRT7g4wfF yAuw== X-Gm-Message-State: AEkoousG1lDboXFdk83rgsoo9pUgFU3FuZFAkFsm0/LfEju9hoLG86TRf2K7CPXZPMGfww== X-Received: by 10.37.214.194 with SMTP id n185mr6695827ybg.131.1470929228702; Thu, 11 Aug 2016 08:27:08 -0700 (PDT) Received: from jade.localdomain ([201.82.189.183]) by smtp.gmail.com with ESMTPSA id r124sm1180691ywg.50.2016.08.11.08.27.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 08:27:08 -0700 (PDT) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Date: Thu, 11 Aug 2016 12:26:43 -0300 Message-Id: <1470929204-13237-5-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1470929204-13237-1-git-send-email-gustavo@padovan.org> References: <1470929204-13237-1-git-send-email-gustavo@padovan.org> Cc: devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , pavel@ucw.cz, Gustavo Padovan , John Harrison X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan This interface is hidden from kernel headers and it is intended for use only for testing. So testers would have to add the ioctl information internally. This is to prevent misuse of this feature. v2: take in Eric suggestions for the Documentation Signed-off-by: Gustavo Padovan Reviewed-by: Eric Engestrom --- drivers/staging/android/sw_sync.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 039e1f4..498ab55 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -25,6 +25,36 @@ #define CREATE_TRACE_POINTS #include "sync_trace.h" +/* + * SW SYNC validation framework + * + * A sync object driver that uses a 32bit counter to coordinate + * synchronization. Useful when there is no hardware primitive backing + * the synchronization. + * + * To start the framework just open: + * + * /sync/sw_sync + * + * That will create a sync timeline, all fences created under this timeline + * file descriptor will belong to the this timeline. + * + * The 'sw_sync' file can be opened many times as to create different + * timelines. + * + * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct + * sw_sync_ioctl_create_fence as parameter. + * + * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used + * with the increment as u32. This will update the last signaled value + * from the timeline and signal any fence that has seqno smaller of equal + * it. + * + * struct sw_sync_ioctl_create_fence + * @value: the seqno to initialise the fence with + * @name: the name of the new sync point + * @fence: return the fd of the new sync_file with the created fence + */ struct sw_sync_create_fence_data { __u32 value; char name[32]; @@ -35,6 +65,7 @@ struct sw_sync_create_fence_data { #define SW_SYNC_IOC_CREATE_FENCE _IOWR(SW_SYNC_IOC_MAGIC, 0,\ struct sw_sync_create_fence_data) + #define SW_SYNC_IOC_INC _IOW(SW_SYNC_IOC_MAGIC, 1, __u32) static const struct fence_ops timeline_fence_ops;