From: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx> get sw_sync_pt_create() to use fence_create_on_timeline() directly and remove an abstractions layers between fences and its users. Signed-off-by: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx> --- drivers/staging/android/sw_sync.c | 22 ++++++++++++++-------- drivers/staging/android/sync.c | 20 -------------------- drivers/staging/android/sync.h | 7 ------- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index b9f8c51..7250f1b 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -25,16 +25,22 @@ #include "sw_sync.h" +static const struct fence_ops sw_sync_fence_ops = { + .get_driver_name = fence_default_get_driver_name, + .get_timeline_name = fence_default_get_timeline_name, + .enable_signaling = fence_default_enable_signaling, + .signaled = fence_default_signaled, + .wait = fence_default_wait, + .release = fence_default_release, + .fill_driver_data = fence_default_fill_driver_data, + .fence_value_str = fence_default_value_str, + .timeline_value_str = fence_default_timeline_value_str, +}; + struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) { - struct sw_sync_pt *pt; - - pt = (struct sw_sync_pt *) - sync_pt_create(&obj->obj, sizeof(struct sw_sync_pt), value); - - pt->value = value; - - return (struct fence *)pt; + return fence_create_on_timeline(&obj->obj, &sw_sync_fence_ops, + sizeof(struct fence), value); } EXPORT_SYMBOL(sw_sync_pt_create); diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 2365db7..956b4e9 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -31,16 +31,8 @@ #define CREATE_TRACE_POINTS #include "trace/sync.h" -static const struct fence_ops sync_fence_ops; static const struct file_operations sync_fence_fops; -struct fence *sync_pt_create(struct fence_timeline *obj, int size, u32 value) -{ - return fence_create_on_timeline(obj, &sync_fence_ops, - sizeof(struct fence), value); -} -EXPORT_SYMBOL(sync_pt_create); - static struct sync_fence *sync_fence_alloc(int size, const char *name) { struct sync_fence *sync_fence; @@ -305,18 +297,6 @@ int sync_fence_wait(struct sync_fence *sync_fence, long timeout) } EXPORT_SYMBOL(sync_fence_wait); -static const struct fence_ops sync_fence_ops = { - .get_driver_name = fence_default_get_driver_name, - .get_timeline_name = fence_default_get_timeline_name, - .enable_signaling = fence_default_enable_signaling, - .signaled = fence_default_signaled, - .wait = fence_default_wait, - .release = fence_default_release, - .fill_driver_data = fence_default_fill_driver_data, - .fence_value_str = fence_default_value_str, - .timeline_value_str = fence_default_timeline_value_str, -}; - static void sync_fence_free(struct kref *kref) { struct sync_fence *sync_fence = container_of(kref, struct sync_fence, diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 569873f..256315c 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -78,13 +78,6 @@ static inline void sync_fence_waiter_init(struct sync_fence_waiter *waiter, waiter->callback = callback; } -/* - * API for fence_timeline implementers - */ - -struct fence *sync_pt_create(struct fence_timeline *parent, int size, - u32 value); - /** * sync_fence_create() - creates a sync fence * @name: name of fence to create -- 2.5.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel