From patchwork Mon Jun 27 19:29:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9201297 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 97EC960B16 for ; Mon, 27 Jun 2016 19:30:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8104F285BA for ; Mon, 27 Jun 2016 19:30:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75EA6285C0; Mon, 27 Jun 2016 19:30:05 +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 31D45285BB for ; Mon, 27 Jun 2016 19:30:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44B146E369; Mon, 27 Jun 2016 19:30:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BB566E369 for ; Mon, 27 Jun 2016 19:29:44 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id j2so32087446qkf.1 for ; Mon, 27 Jun 2016 12:29:44 -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=uFQbk4285hM3Wlqb+Fj+6QX+NbMFR5XEXOayewHstXs=; b=Az/T188BVtwVSs8+ifbFEodv+6D3PW4CLmCLKsx76tE/L6DYDlelsKTkW8q9oxtueL eEHxtnPrsquj1Me0mPYQXiow/eKf9/4vIo8o45kXsshDX36/PUBkAtyBccPNrNKDC60j Bftr9QfDbI2yXMcAoZ8FStjNxGr1muUhyPS0k4GBHWb3lMABWqMVeKra3YGHYF3l9K66 Vizd1ttSfF7GW7TkSRlaBqPuzaqdzI4+dCqNdGEycwvbrH+djW/mzgP8GEkF/XSiApAE E+iBhQy0uvbEUoBN7TjC2N5YFiX1KUgVMQAj40GfkKKDcvgVG0MUaHquWOlscV+NP9Dt 8JlQ== X-Gm-Message-State: ALyK8tKLCUClkF5r821XwwHcawicF49BeiR9mcBWuki7/3Zslp8iXBjLGOIgOPpqMHGXbQ== X-Received: by 10.37.211.199 with SMTP id e190mr12560953ybf.74.1467055783054; Mon, 27 Jun 2016 12:29:43 -0700 (PDT) Received: from jade.localdomain ([189.61.225.79]) by smtp.gmail.com with ESMTPSA id u82sm5838687ywa.44.2016.06.27.12.29.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2016 12:29:42 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [RFC v2 1/3] dma-buf/fence-array: add fence_is_array() Date: Mon, 27 Jun 2016 16:29:20 -0300 Message-Id: <1467055762-25881-2-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1467055762-25881-1-git-send-email-gustavo@padovan.org> References: <1467055762-25881-1-git-send-email-gustavo@padovan.org> MIME-Version: 1.0 Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, =?UTF-8?q?Christian=20K=C3=B6nig?= , 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 Add helper to check if fence is array. Cc: Chris Wilson Cc: Christian König Signed-off-by: Gustavo Padovan --- include/linux/fence-array.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/fence-array.h b/include/linux/fence-array.h index 86baaa4..d2e9f40 100644 --- a/include/linux/fence-array.h +++ b/include/linux/fence-array.h @@ -52,6 +52,16 @@ struct fence_array { extern const struct fence_ops fence_array_ops; /** + * fence_is_array - check if a fence is from the array subsclass + * + * Return true if it is a fence_array and false otherwise. + */ +static inline bool fence_is_array(struct fence *fence) +{ + return (fence->ops == &fence_array_ops) ? true : false; +} + +/** * to_fence_array - cast a fence to a fence_array * @fence: fence to cast to a fence_array *