Commit d21858fd authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Greg Kroah-Hartman

staging/android: remove sw_sync.[ch] files

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: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dcc28080
...@@ -5,4 +5,3 @@ obj-y += ion/ ...@@ -5,4 +5,3 @@ obj-y += ion/
obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
obj-$(CONFIG_SYNC) += sync.o sync_debug.o obj-$(CONFIG_SYNC) += sync.o sync_debug.o
obj-$(CONFIG_SW_SYNC) += sw_sync.o
/*
* 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 <linux/kernel.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/syscalls.h>
#include <linux/uaccess.h>
#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);
/*
* 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 <linux/types.h>
#include <linux/kconfig.h>
#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 */
...@@ -27,7 +27,11 @@ ...@@ -27,7 +27,11 @@
#include <linux/anon_inodes.h> #include <linux/anon_inodes.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <linux/sync_file.h> #include <linux/sync_file.h>
#include "sw_sync.h" #include <linux/types.h>
#include <linux/kconfig.h>
#include "uapi/sw_sync.h"
#include "sync.h"
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
...@@ -200,6 +204,7 @@ static const struct file_operations sync_info_debugfs_fops = { ...@@ -200,6 +204,7 @@ static const struct file_operations sync_info_debugfs_fops = {
.release = single_release, .release = single_release,
}; };
#if IS_ENABLED(CONFIG_SW_SYNC)
/* /*
* *WARNING* * *WARNING*
* *
...@@ -214,7 +219,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) ...@@ -214,7 +219,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file)
get_task_comm(task_comm, current); 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) if (!obj)
return -ENOMEM; return -ENOMEM;
...@@ -248,7 +253,7 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, ...@@ -248,7 +253,7 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj,
goto err; goto err;
} }
fence = sw_sync_pt_create(obj, data.value); fence = sync_pt_create(obj, sizeof(*fence), data.value);
if (!fence) { if (!fence) {
err = -ENOMEM; err = -ENOMEM;
goto err; goto err;
...@@ -284,7 +289,7 @@ static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) ...@@ -284,7 +289,7 @@ static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg)
if (copy_from_user(&value, (void __user *)arg, sizeof(value))) if (copy_from_user(&value, (void __user *)arg, sizeof(value)))
return -EFAULT; return -EFAULT;
sw_sync_timeline_inc(obj, value); sync_timeline_signal(obj, value);
return 0; return 0;
} }
...@@ -312,14 +317,18 @@ static const struct file_operations sw_sync_debugfs_fops = { ...@@ -312,14 +317,18 @@ static const struct file_operations sw_sync_debugfs_fops = {
.unlocked_ioctl = sw_sync_ioctl, .unlocked_ioctl = sw_sync_ioctl,
.compat_ioctl = sw_sync_ioctl, .compat_ioctl = sw_sync_ioctl,
}; };
#endif
static __init int sync_debugfs_init(void) static __init int sync_debugfs_init(void)
{ {
dbgfs = debugfs_create_dir("sync", NULL); dbgfs = debugfs_create_dir("sync", NULL);
debugfs_create_file("info", 0444, dbgfs, NULL, &sync_info_debugfs_fops); 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, debugfs_create_file("sw_sync", 0644, dbgfs, NULL,
&sw_sync_debugfs_fops); &sw_sync_debugfs_fops);
#endif
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment