From patchwork Wed Mar 23 18:47:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8653131 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 44CE19F38C for ; Wed, 23 Mar 2016 18:47:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5386202E5 for ; Wed, 23 Mar 2016 18:47:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E1B902026D for ; Wed, 23 Mar 2016 18:47:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDA2D6E8F8; Wed, 23 Mar 2016 18:47:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f169.google.com (mail-yw0-f169.google.com [209.85.161.169]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0D046E8F8 for ; Wed, 23 Mar 2016 18:47:39 +0000 (UTC) Received: by mail-yw0-f169.google.com with SMTP id h129so31226793ywb.1 for ; Wed, 23 Mar 2016 11:47:39 -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=WEvGwpN9pSiZtRL8z9Tg1Cm1NCUHGXIR1+bH1PL6n4w=; b=Ga6TtwfwpMbpYfxv/P/ynjG2/8yGbdjn+CgGjKCi2m3kWkNIbDB5OxF51i6MiOsWh5 /KT0lNc1xu9b39IbcQ+qUKeAOGr6IiCPAi9W8Qw0y0xwIhtxUrLCoVbfem6vVUkLbunD JdviE0cKYhDjVH2+oS8i+hRQJ67s/HvDGhZYbac1hPvE1xdNhFcTe29epHKJ05Rxje9K J3ISPlLq8dTpme17ajHRwyuELpdFFBwrbFapUCreByMcQN6qLPAImjjTMdyLEEoIgSts 9zqRshfMwXWZJ3KpBFH4JeERn0GfcOvTrwe7wah6n9sZMp55hobsZuW/GD9Oz/v9/j4p qvhw== X-Gm-Message-State: AD7BkJKKdh0r761ZcscBVZp136/FpjyCyZF17t0SQ9GjHeiSbqnQ5JySLdS4Vv/6Y1KZsA== X-Received: by 10.37.230.136 with SMTP id d130mr2273272ybh.125.1458758857923; Wed, 23 Mar 2016 11:47:37 -0700 (PDT) Received: from jade.localdomain ([201.82.24.203]) by smtp.gmail.com with ESMTPSA id y138sm2146629ywa.28.2016.03.23.11.47.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 11:47:37 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [RFC 2/6] dma-buf/fence: add struct fence_collection Date: Wed, 23 Mar 2016 15:47:23 -0300 Message-Id: <1458758847-21170-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458758847-21170-1-git-send-email-gustavo@padovan.org> References: <1458758847-21170-1-git-send-email-gustavo@padovan.org> Cc: Daniel Stone , Daniel Vetter , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , linux-kernel@vger.kernel.org, Riley Andrews , 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-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: Gustavo Padovan The struct aggregates fences that we need to wait on before proceed with some specific operation. In DRM, for example, we may wait for a group of fences to signal before we scanout the buffers related to those fences. Signed-off-by: Gustavo Padovan --- include/linux/fence.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/fence.h b/include/linux/fence.h index 605bd88..3d1151f 100644 --- a/include/linux/fence.h +++ b/include/linux/fence.h @@ -104,6 +104,22 @@ struct fence_cb { fence_func_t func; }; +typedef void (*collection_put_func_t)(void *data); + +/** + * struct fence_collection - aggregate fences together + * @num_fences: number of fence in the collection. + * @user_data: user data. + * @func: user callback to put user data. + * @fences: array of @num_fences fences. + */ +struct fence_collection { + int num_fences; + void *user_data; + collection_put_func_t func; + struct fence *fences[]; +}; + /** * struct fence_ops - operations implemented for fence * @get_driver_name: returns the driver name.