From patchwork Thu Jun 30 14:09:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9207871 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 B4EF06075A for ; Thu, 30 Jun 2016 14:10:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5B5B28489 for ; Thu, 30 Jun 2016 14:10:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 986E62867B; Thu, 30 Jun 2016 14:10:21 +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 CBE3B28489 for ; Thu, 30 Jun 2016 14:10:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE06F6E8A4; Thu, 30 Jun 2016 14:10:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38B396E8A3 for ; Thu, 30 Jun 2016 14:10:02 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id j2so16805135qkf.1 for ; Thu, 30 Jun 2016 07:10:02 -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=YYsQQ79niFAO11rDIdSijsyCiFJC2N/2+ANC4RPOi+qJgCYMJT4xtg1YTdaFbbpKJ6 XAIgLCIMBQLFZbL4Y7neU3aj0GkfjjBljkIS0+SVTBtVtlMA87z33OYSaA7rhJd5J2oo oPTgNG5WzCwiV8Ie9qq3R6G3BtEoWDZdFTiFzZbfBRk1MnE5H2AHK/JH4iMsOgwrBm+Q uX3q8V9HDvL+VYjgLi7qEiaP4O7TkGDMKTzSh2cFhPtTuEVDX9cWykIdZbk/WmQw8qvM MOiIt0H0qdHwEDqBa5J+pBbb/Z/XBmBmyxeWHrdR8yqQxi5dtCzErreTe2nqq1l0DqON It3A== X-Gm-Message-State: ALyK8tK2B66Oj8/EO/X/jD3Ih9h5t+ic9Q29DIeSN0l7ATPvsaV9ykkHZKxS6CF18QlsZA== X-Received: by 10.129.106.197 with SMTP id f188mr6729427ywc.245.1467295801270; Thu, 30 Jun 2016 07:10:01 -0700 (PDT) Received: from jade.localdomain ([189.61.225.79]) by smtp.gmail.com with ESMTPSA id f130sm4185757ywb.52.2016.06.30.07.09.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 07:10:00 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] dma-buf/fence-array: add fence_is_array() Date: Thu, 30 Jun 2016 11:09:47 -0300 Message-Id: <1467295788-6422-2-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1467295788-6422-1-git-send-email-gustavo@padovan.org> References: <1467295788-6422-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 Reviewed-by: Chris Wilson --- 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 *