Skip to content

Commit

Permalink
+ "sw_sync: export sw_sync API" - sakindia123/android_kernel_samsung_…
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Jun 20, 2013
1 parent 40f9274 commit 5d1eda1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/base/sw_sync.c
Expand Up @@ -15,6 +15,7 @@
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
Expand Down Expand Up @@ -42,6 +43,7 @@ struct sync_pt *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value)

return (struct sync_pt *)pt;
}
EXPORT_SYMBOL(sw_sync_pt_create);

static struct sync_pt *sw_sync_pt_dup(struct sync_pt *sync_pt)
{
Expand Down Expand Up @@ -117,14 +119,15 @@ struct sw_sync_timeline *sw_sync_timeline_create(const char *name)

return obj;
}
EXPORT_SYMBOL(sw_sync_timeline_create);

void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc)
{
obj->value += inc;

sync_timeline_signal(&obj->obj);
}

EXPORT_SYMBOL(sw_sync_timeline_inc);

#ifdef CONFIG_SW_SYNC_USER
/* *WARNING*
Expand Down Expand Up @@ -164,8 +167,13 @@ long sw_sync_ioctl_create_fence(struct sw_sync_timeline *obj, unsigned long arg)
struct sync_fence *fence;
struct sw_sync_create_fence_data data;

if (copy_from_user(&data, (void __user *)arg, sizeof(data)))
return -EFAULT;
if (fd < 0)
return fd;

if (copy_from_user(&data, (void __user *)arg, sizeof(data))) {
err = -EFAULT;
goto err;
}

pt = sw_sync_pt_create(obj, data.value);
if (pt == NULL) {
Expand Down

0 comments on commit 5d1eda1

Please sign in to comment.