From patchwork Thu Jun 9 15:05:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9167263 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 72D7660467 for ; Thu, 9 Jun 2016 15:07:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 646D828328 for ; Thu, 9 Jun 2016 15:07:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58FEE2835E; Thu, 9 Jun 2016 15:07:58 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0181128363 for ; Thu, 9 Jun 2016 15:07:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1350B6EBFD; Thu, 9 Jun 2016 15:07:54 +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 934146EBFC for ; Thu, 9 Jun 2016 15:07:50 +0000 (UTC) Received: by mail-yw0-f193.google.com with SMTP id l126so5070442ywe.3 for ; Thu, 09 Jun 2016 08:07:50 -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=NEQblyw3lYw4GBMO+8iEIuRnq88KRkhg2S7Afj99cpY=; b=hlC5aJiwGW2SVcSNcFHNFfpooVhzFQGkxYnLfPO4SqSug+qJ+djYeaEptWcmTcXUxZ E/MsPda/lRN7SGUxebdZ6mgG1RpeVM/NJ2mlRdKkZB1c8afGa5dxTtMcE+ycugRvtH1+ KoaxNUGQC0/4z5oZsb59Li1CUT3SFF94tN4vawreMhz4LJnmGLoo2y+LYbQ+YphFyv+s TlqxwI6nyK/iIy6gsaD6V7Xj7yCFZDFtnLp3WgTxwj3lzbXmrcEMIJhUcWI0oQQcLo22 NTuzWZTOzj4fDEh3kjK4XlomJye2m2zQ53tcpT/1y2KhGq+DIol46t15tV+Hza0SedDX m/vg== X-Gm-Message-State: ALyK8tIRKhOoNlimIKAaRpy1RYm6JU2jYbCL5J2hByyflg08l/LPSMQS2bggBM2jswb0Ig== X-Received: by 10.129.56.138 with SMTP id f132mr6134305ywa.240.1465484869315; Thu, 09 Jun 2016 08:07:49 -0700 (PDT) Received: from jade.localdomain ([201.82.24.203]) by smtp.gmail.com with ESMTPSA id n10sm3465619ywd.7.2016.06.09.08.07.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jun 2016 08:07:48 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] Documentation: add doc for sync_file_get_fence() Date: Thu, 9 Jun 2016 12:05:30 -0300 Message-Id: <1465484730-8128-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465484730-8128-1-git-send-email-gustavo@padovan.org> References: <1465484730-8128-1-git-send-email-gustavo@padovan.org> 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: , MIME-Version: 1.0 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 Signed-off-by: Gustavo Padovan --- Documentation/sync_file.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/sync_file.txt b/Documentation/sync_file.txt index eaf8297..46f5769 100644 --- a/Documentation/sync_file.txt +++ b/Documentation/sync_file.txt @@ -64,6 +64,25 @@ 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 pass file descriptor +of the Sync File to the kernel. The kernel then can retrieve the sync_file +from it. + +Interface: + struct fence *sync_file_get_fence(int fd); + + +The function return a struct fence pointer referencing the fence(s) in the Sync +File. If the Sync File contains only one fence, this fence is returned. But if +has more than one fence a fence_array[3] is returned. However the callers only +see the arrays' base class which is struct fence. In both cases a reference to +the returned fence is held. + + References: [1] struct sync_file in include/linux/sync_file.h [2] All interfaces mentioned above defined in include/linux/sync_file.h +[1] struct fence_array in include/linux/fence-array.h