From patchwork Fri Aug 5 13:39:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9265411 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 AD55560760 for ; Fri, 5 Aug 2016 13:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EA1528440 for ; Fri, 5 Aug 2016 13:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9327328448; Fri, 5 Aug 2016 13:40:19 +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 51EF728440 for ; Fri, 5 Aug 2016 13:40:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A38026EBAE; Fri, 5 Aug 2016 13:40:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-f193.google.com (mail-yb0-f193.google.com [209.85.213.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF6106EBAE for ; Fri, 5 Aug 2016 13:40:07 +0000 (UTC) Received: by mail-yb0-f193.google.com with SMTP id x196so1349363ybe.1 for ; Fri, 05 Aug 2016 06:40:07 -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:mime-version:content-transfer-encoding; bh=Ii9aPly7AC/7P3THMMVjrLHVwva5cpowpXtmq0hMtHc=; b=dQqEPp8nN5XT91V3pPubGBWSL82tCiyIgZ5hbFyefCx8kYOWP4ZJbxLdZWlTRfWgG7 oBptjzT0hYrHnu5eL5YXT/oYH5ZCO7wxrvTBuvgUvvujzgLjX8RrQufPNJvQXYEAQ7Wy 5H0kiBNavYBV6jWKNSQbHYEEtRdsQwYDjim+rnb6l89mikZqqtqvbD4MwK1Hx+6Q+kOr oDtOjR6hzA9cu3/CfroYzuRMmV8s1CDvoYXFLTwlk+6v/ZkWJA5YWA/h6lkgLlxtp5R8 dGyX2pd19IVEQYQQ45qxhNHRKkGEAXLx1QhlVl748xi8c3P5djN9wSoH/WwD912+ymEB tYDQ== X-Gm-Message-State: AEkoouujFDYQpCRDtVq6pWsV+vbuFw9rsE2SmSSz72h+/E9bCdmUdd/mUZSSwA/M3MVZEg== X-Received: by 10.37.209.86 with SMTP id i83mr1112150ybg.40.1470404407211; Fri, 05 Aug 2016 06:40:07 -0700 (PDT) Received: from jade.localdomain ([201.82.189.183]) by smtp.gmail.com with ESMTPSA id a11sm7801449ywa.37.2016.08.05.06.40.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Aug 2016 06:40:06 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH v6 4/5] Documentation: add doc for sync_file_get_fence() Date: Fri, 5 Aug 2016 10:39:37 -0300 Message-Id: <1470404378-27961-4-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1470404378-27961-1-git-send-email-gustavo@padovan.org> References: <1470404378-27961-1-git-send-email-gustavo@padovan.org> MIME-Version: 1.0 Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan Document the new function added to sync_file.c v2: Adapt to fence_array v3: Take in Chris Wilson suggestions Signed-off-by: Gustavo Padovan Acked-by: Christian König Reviewed-by: Chris Wilson --- Documentation/sync_file.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/sync_file.txt b/Documentation/sync_file.txt index e8e2eba..b63a685 100644 --- a/Documentation/sync_file.txt +++ b/Documentation/sync_file.txt @@ -64,6 +64,20 @@ The sync_file fd now can be sent to userspace. If the creation process fail, or the sync_file needs to be released by any other reason fput(sync_file->file) should be used. +Receiving Sync Files from Userspace +----------------------------------- + +When userspace needs to send an in-fence to the driver it passes file descriptor +of the Sync File to the kernel. The kernel can then retrieve the fences +from it. + +Interface: + struct fence *sync_file_get_fence(int fd); + + +The returned reference is owned by the caller and must be disposed of +afterwards using fence_put(). In case of error, a NULL is returned instead. + References: [1] struct sync_file in include/linux/sync_file.h [2] All interfaces mentioned above defined in include/linux/sync_file.h