From patchwork Tue Jan 26 18:30:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8126051 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 E87369F6DA for ; Tue, 26 Jan 2016 18:31:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABC9520266 for ; Tue, 26 Jan 2016 18:31:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1523A20256 for ; Tue, 26 Jan 2016 18:31:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 634096E632; Tue, 26 Jan 2016 10:31:01 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f193.google.com (mail-yk0-f193.google.com [209.85.160.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 290BF6E632 for ; Tue, 26 Jan 2016 10:31:00 -0800 (PST) Received: by mail-yk0-f193.google.com with SMTP id v14so15311324ykd.1 for ; Tue, 26 Jan 2016 10:31:00 -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:in-reply-to :references; bh=173e3iQNaFlcj+kqgSFn5scTjQ8UZLA9NG2DKqg/GQM=; b=XW3/lK3/aCdAed20BkJKPLClVBjliCvM9y9Ba7YjlCy3muijOr/nC4iiJrHv8OWzvK gNksqm2Rp6RA3Yw4z7ajGjY5SLl7d+n/zjNoHufeiqjdW+kNsC72gmoYaJqWR9IdfkNi Q/qTVbP1uQ4ub+F7Hq8NlA6uYFAR8X9MZ5Rd0Q+H6pWxSSEQD/8vQcJuygvGfjtJde9L yPebiYrd+cTGAuZFmI44/q/eIrZwUuR2BLlGPiLUipbwTovgu/eIDzJe6KNDrUm2pWIX Gpngo8hOiz7Q/ANr+KWo2wgprDR2ahgYIDwhTmKwKjyJqjcPHjuWMFuNfpV7ZEIoD5uk Q17A== X-Gm-Message-State: AG10YOSXhSLtKy3mgNwDW2CjVMKumZQ4N29R9xt+NlQydITXfAWXw7M93Qb5kZs0AzIbSw== X-Received: by 10.129.159.206 with SMTP id w197mr12088128ywg.233.1453833059460; Tue, 26 Jan 2016 10:30:59 -0800 (PST) Received: from jade.localdomain ([177.194.47.65]) by smtp.gmail.com with ESMTPSA id t125sm1750549ywb.47.2016.01.26.10.30.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2016 10:30:58 -0800 (PST) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH 07/11] staging/android: remove sw_sync.[ch] files Date: Tue, 26 Jan 2016 16:30:22 -0200 Message-Id: <1453833026-24637-8-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453833026-24637-1-git-send-email-gustavo@padovan.org> References: <1453833026-24637-1-git-send-email-gustavo@padovan.org> 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 We can glue the sw_sync file operations directly on the sync framework without the need to pass through sw_sync wrappers. It only builds sw_sync debugfs file support if CONFIG_SW_SYNC is enabled. Signed-off-by: Gustavo Padovan --- drivers/staging/android/Makefile | 1 - drivers/staging/android/sw_sync.c | 45 ---------------------------------- drivers/staging/android/sw_sync.h | 47 ------------------------------------ drivers/staging/android/sync_debug.c | 17 ++++++++++--- 4 files changed, 13 insertions(+), 97 deletions(-) delete mode 100644 drivers/staging/android/sw_sync.c delete mode 100644 drivers/staging/android/sw_sync.h diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index c7b6c99..2c1d97f 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -7,4 +7,3 @@ obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o obj-$(CONFIG_SYNC) += sync.o sync_debug.o -obj-$(CONFIG_SW_SYNC) += sw_sync.o diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c deleted file mode 100644 index 461dbd9..0000000 --- a/drivers/staging/android/sw_sync.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * drivers/base/sw_sync.c - * - * Copyright (C) 2012 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sw_sync.h" - -struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) -{ - return sync_pt_create(obj, sizeof(struct fence), value); -} -EXPORT_SYMBOL(sw_sync_pt_create); - -struct sync_timeline *sw_sync_timeline_create(const char *name) -{ - return sync_timeline_create(sizeof(struct sync_timeline), - "sw_sync", name); -} -EXPORT_SYMBOL(sw_sync_timeline_create); - -void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) -{ - sync_timeline_signal(obj, inc); -} -EXPORT_SYMBOL(sw_sync_timeline_inc); diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h deleted file mode 100644 index 9f26c62..0000000 --- a/drivers/staging/android/sw_sync.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * include/linux/sw_sync.h - * - * Copyright (C) 2012 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _LINUX_SW_SYNC_H -#define _LINUX_SW_SYNC_H - -#include -#include -#include "sync.h" -#include "uapi/sw_sync.h" - -#if IS_ENABLED(CONFIG_SW_SYNC) -struct sync_timeline *sw_sync_timeline_create(const char *name); -void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc); - -struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value); -#else -static inline struct sync_timeline *sw_sync_timeline_create(const char *name) -{ - return NULL; -} - -static inline void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) -{ -} - -static inline struct fence *sw_sync_pt_create(struct sync_timeline *obj, - u32 value) -{ - return NULL; -} -#endif /* IS_ENABLED(CONFIG_SW_SYNC) */ - -#endif /* _LINUX_SW_SYNC_H */ diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index e984955..9312e6f 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -28,7 +28,11 @@ #include #include #include -#include "sw_sync.h" +#include +#include + +#include "uapi/sw_sync.h" +#include "sync.h" #ifdef CONFIG_DEBUG_FS @@ -202,6 +206,7 @@ static const struct file_operations sync_info_debugfs_fops = { .release = single_release, }; +#if IS_ENABLED(CONFIG_SW_SYNC) /* * *WARNING* * @@ -216,7 +221,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) get_task_comm(task_comm, current); - obj = sw_sync_timeline_create(task_comm); + obj = sync_timeline_create(sizeof(*obj), "sw_sync", task_comm); if (!obj) return -ENOMEM; @@ -250,7 +255,7 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, goto err; } - fence = sw_sync_pt_create(obj, data.value); + fence = sync_pt_create(obj, sizeof(*fence), data.value); if (!fence) { err = -ENOMEM; goto err; @@ -287,7 +292,7 @@ static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) if (copy_from_user(&value, (void __user *)arg, sizeof(value))) return -EFAULT; - sw_sync_timeline_inc(obj, value); + sync_timeline_signal(obj, value); return 0; } @@ -315,14 +320,18 @@ static const struct file_operations sw_sync_debugfs_fops = { .unlocked_ioctl = sw_sync_ioctl, .compat_ioctl = sw_sync_ioctl, }; +#endif static __init int sync_debugfs_init(void) { dbgfs = debugfs_create_dir("sync", NULL); debugfs_create_file("info", 0444, dbgfs, NULL, &sync_info_debugfs_fops); + +#if IS_ENABLED(CONFIG_SW_SYNC) debugfs_create_file("sw_sync", 0644, dbgfs, NULL, &sw_sync_debugfs_fops); +#endif return 0; }