From patchwork Thu Aug 11 16:45:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9275641 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 80F4060780 for ; Thu, 11 Aug 2016 16:46:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 730212873C for ; Thu, 11 Aug 2016 16:46:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6788D2874E; Thu, 11 Aug 2016 16:46:03 +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 0C8A62873C for ; Thu, 11 Aug 2016 16:46:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5F586E97D; Thu, 11 Aug 2016 16:46:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f193.google.com (mail-yw0-f193.google.com [209.85.161.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 851426E97D for ; Thu, 11 Aug 2016 16:46:00 +0000 (UTC) Received: by mail-yw0-f193.google.com with SMTP id j12so49587ywb.1 for ; Thu, 11 Aug 2016 09:46:00 -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=bGJXwDb5Y7W0s8zq6J+nrIAXjKz53dwZ41vG0uHxkwE=; b=DFr3vmhmqCfkLH6hEbZ6YS9cd3EM4TUKUVJeUXvT49iU7KnrYcCN1ihE1orItl9D4e uens3d2UV5liH/POH2yNi1bYKeJWQsKsHc0reMngKor8iFztDiB8G0s/yZIPgtbRaVtq wBbI1Dt1MyHE+GPMRjNp1gqkJomnEMfyI65NR/YnFb2NFuyTulpUlk2HcqX3tKVgvAp0 /EjlhpjgOIqMfhzNeWIYoClnDaqHIX3Ta97tGNGYyo7QLbf2ETwwqEPk1d1AUN1Iyx93 8R/nmJ9P9jF3sT801jV+/A7YLjK+D1yPHa5mVUJMT2vX68yGCZw3jh+2WXr0tzXWFWEX cCGw== X-Gm-Message-State: AEkoouuFcN5yzYV9DIAosXpDN9JmyVzLd65B9fwuxkc71A1al7md9GE0y3+HeAt/Ei0r0w== X-Received: by 10.129.110.137 with SMTP id j131mr7049976ywc.190.1470933959745; Thu, 11 Aug 2016 09:45:59 -0700 (PDT) Received: from jade.localdomain ([201.82.189.183]) by smtp.gmail.com with ESMTPSA id w125sm1335230ywg.39.2016.08.11.09.45.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 09:45:58 -0700 (PDT) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH] staging/android: add Doc for SW_SYNC ioctl interface Date: Thu, 11 Aug 2016 13:45:53 -0300 Message-Id: <1470933953-11288-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1470929204-13237-5-git-send-email-gustavo@padovan.org> References: <1470929204-13237-5-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 v3: really take in Eric suggestions Signed-off-by: Gustavo Padovan Reviewed-by: Eric Engestrom Acked-by: Pavel Machek --- 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..62e8e6d 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 a seqno smaller or equal + * to 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;