From patchwork Thu Mar 3 19:40:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8495771 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 B707B9F9A0 for ; Thu, 3 Mar 2016 19:41:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF0852035E for ; Thu, 3 Mar 2016 19:41:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BAFA2203A5 for ; Thu, 3 Mar 2016 19:40:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 299126EAF9; Thu, 3 Mar 2016 19:40:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) by gabe.freedesktop.org (Postfix) with ESMTPS id 937C86EAF7 for ; Thu, 3 Mar 2016 19:40:55 +0000 (UTC) Received: by mail-yw0-f172.google.com with SMTP id i131so13417928ywc.3 for ; Thu, 03 Mar 2016 11:40:55 -0800 (PST) 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; bh=9py9n+iRkJOdJtxkJ7E/Ih2WPxma5uzvQr7WxjuPrB0=; b=MGE4LjwqxYE95QRrz/t/98rJFhcaVOzWzeRsRIoyv3Xs07x9E5YvH6WioGe5wkLHoc 8G5Qb88JQlhSHNb+jYE6tu98ta4jIO15Ok5TDCNP7in+1V93rK63Pth+nliDpbU8oNw0 TLHRRTqJzmyOHqItMdcjaZW83dY8mDtYwOA3kWBxibLDHgn23uVs28+9tSlIPoz9RZ02 qDq6XNYrC+cdy6+vQnedgHyAAZprDeU3ovOJUNL7Em1whOh0RLdUf/OufxRtTa5BATMR /6rYiak/Ar+gQsOPkFqzR5WR/aIkwaIrwr1LaZH6aRHxVkxZLQU35x3IIXlrZQn4UY00 Gxww== X-Gm-Message-State: AD7BkJIqsaeFIiUaYSZLIILjoGS550xFdqAsNUJ1hB8nwX7Qtt7KBxKm7O4dHutHppCzxA== X-Received: by 10.129.82.15 with SMTP id g15mr2486468ywb.344.1457034054604; Thu, 03 Mar 2016 11:40:54 -0800 (PST) Received: from jade.localdomain ([177.194.47.65]) by smtp.gmail.com with ESMTPSA id f186sm28850ywa.6.2016.03.03.11.40.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Mar 2016 11:40:53 -0800 (PST) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH v7 1/5] staging/android: add num_fences field to struct sync_file_info Date: Thu, 3 Mar 2016 16:40:42 -0300 Message-Id: <1457034046-27678-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 Cc: devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , 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, 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 Inform userspace how many fences are in the sync_fence_info field. Signed-off-by: Gustavo Padovan Reviewed-by: Maarten Lankhorst Acked-by: Greg Hackmann --- drivers/staging/android/sync.c | 2 ++ drivers/staging/android/uapi/sync.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 3a8f210..31aa462 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -525,6 +525,8 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file, if (info->status >= 0) info->status = !info->status; + info->num_fences = sync_file->num_fences; + len = sizeof(struct sync_file_info); for (i = 0; i < sync_file->num_fences; ++i) { diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h index a0cf357..4ffb7cc 100644 --- a/drivers/staging/android/uapi/sync.h +++ b/drivers/staging/android/uapi/sync.h @@ -47,12 +47,14 @@ struct sync_fence_info { * userspace including pt_info. * @name: name of fence * @status: status of fence. 1: signaled 0:active <0:error + * @num_fences number of fences in the sync_file * @sync_fence_info: array of sync_fence_info for every fence in the sync_file */ struct sync_file_info { __u32 len; char name[32]; __s32 status; + __u32 num_fences; __u8 sync_fence_info[0]; };