ANDROID: goldfish_sync_timeline: Rename fence to dma_fence
authorAmit Pundir <amit.pundir@linaro.org>
Tue, 18 Apr 2017 09:28:13 +0000 (14:58 +0530)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 18 Dec 2017 15:41:22 +0000 (21:11 +0530)
Rename fence interfaces to dma_fence to match with the upstream
commit, f54d1867005c ("dma-buf: Rename struct fence to dma_fence"),
changes.

FIXME: Might be a good idea to remove goldfish_sync_timeline and
       use upstream sync_timeline interfaces instead.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
drivers/staging/goldfish/goldfish_sync_timeline.c
drivers/staging/goldfish/goldfish_sync_timeline_fence.c
drivers/staging/goldfish/goldfish_sync_timeline_fence.h

index 5bef4c6c02838a42911d8142473fd965df1a32f4..880d6e2e5b3470947deb9e9311b7b530d40cc216 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/fs.h>
 #include <linux/syscalls.h>
 #include <linux/sync_file.h>
-#include <linux/fence.h>
+#include <linux/dma-fence.h>
 
 #include "goldfish_sync_timeline_fence.h"
 
@@ -325,7 +325,7 @@ goldfish_sync_fence_create(struct goldfish_sync_timeline_obj *obj,
 err_cleanup_fd_pt:
        put_unused_fd(fd);
 err_cleanup_pt:
-       fence_put(&syncpt->base);
+       dma_fence_put(&syncpt->base);
        return -1;
 }
 
index e671618cf888d60425b33873c7e5d3c8d4700716..a5bc2deab780ef2b352a5261e967d85429074f92 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/fs.h>
 #include <linux/syscalls.h>
 #include <linux/sync_file.h>
-#include <linux/fence.h>
+#include <linux/dma-fence.h>
 
 #include "goldfish_sync_timeline_fence.h"
 
@@ -46,15 +46,15 @@ struct goldfish_sync_timeline {
        struct list_head        active_list_head;
 };
 
-static inline struct goldfish_sync_timeline *fence_parent(struct fence *fence)
+static inline struct goldfish_sync_timeline *goldfish_dma_fence_parent(struct dma_fence *fence)
 {
        return container_of(fence->lock, struct goldfish_sync_timeline,
                                child_list_lock);
 }
 
-static const struct fence_ops goldfish_sync_timeline_fence_ops;
+static const struct dma_fence_ops goldfish_sync_timeline_fence_ops;
 
-static inline struct sync_pt *goldfish_sync_fence_to_sync_pt(struct fence *fence)
+static inline struct sync_pt *goldfish_sync_fence_to_sync_pt(struct dma_fence *fence)
 {
        if (fence->ops != &goldfish_sync_timeline_fence_ops)
                return NULL;
@@ -78,7 +78,7 @@ struct goldfish_sync_timeline
                return NULL;
 
        kref_init(&obj->kref);
-       obj->context = fence_context_alloc(1);
+       obj->context = dma_fence_context_alloc(1);
        strlcpy(obj->name, name, sizeof(obj->name));
 
        INIT_LIST_HEAD(&obj->child_list_head);
@@ -128,7 +128,7 @@ void goldfish_sync_timeline_signal_internal(struct goldfish_sync_timeline *obj,
 
        list_for_each_entry_safe(pt, next, &obj->active_list_head,
                                 active_list) {
-               if (fence_is_signaled_locked(&pt->base))
+               if (dma_fence_is_signaled_locked(&pt->base))
                        list_del_init(&pt->active_list);
        }
 
@@ -162,7 +162,7 @@ struct sync_pt *goldfish_sync_pt_create_internal(
 
        spin_lock_irqsave(&obj->child_list_lock, flags);
        goldfish_sync_timeline_get_internal(obj);
-       fence_init(&pt->base, &goldfish_sync_timeline_fence_ops, &obj->child_list_lock,
+       dma_fence_init(&pt->base, &goldfish_sync_timeline_fence_ops, &obj->child_list_lock,
                   obj->context, value);
        list_add_tail(&pt->child_list, &obj->child_list_head);
        INIT_LIST_HEAD(&pt->active_list);
@@ -171,23 +171,23 @@ struct sync_pt *goldfish_sync_pt_create_internal(
 }
 
 static const char *goldfish_sync_timeline_fence_get_driver_name(
-                                               struct fence *fence)
+                                               struct dma_fence *fence)
 {
        return "sw_sync";
 }
 
 static const char *goldfish_sync_timeline_fence_get_timeline_name(
-                                               struct fence *fence)
+                                               struct dma_fence *fence)
 {
-       struct goldfish_sync_timeline *parent = fence_parent(fence);
+       struct goldfish_sync_timeline *parent = goldfish_dma_fence_parent(fence);
 
        return parent->name;
 }
 
-static void goldfish_sync_timeline_fence_release(struct fence *fence)
+static void goldfish_sync_timeline_fence_release(struct dma_fence *fence)
 {
        struct sync_pt *pt = goldfish_sync_fence_to_sync_pt(fence);
-       struct goldfish_sync_timeline *parent = fence_parent(fence);
+       struct goldfish_sync_timeline *parent = goldfish_dma_fence_parent(fence);
        unsigned long flags;
 
        spin_lock_irqsave(fence->lock, flags);
@@ -197,20 +197,20 @@ static void goldfish_sync_timeline_fence_release(struct fence *fence)
        spin_unlock_irqrestore(fence->lock, flags);
 
        goldfish_sync_timeline_put_internal(parent);
-       fence_free(fence);
+       dma_fence_free(fence);
 }
 
-static bool goldfish_sync_timeline_fence_signaled(struct fence *fence)
+static bool goldfish_sync_timeline_fence_signaled(struct dma_fence *fence)
 {
-       struct goldfish_sync_timeline *parent = fence_parent(fence);
+       struct goldfish_sync_timeline *parent = goldfish_dma_fence_parent(fence);
 
        return (fence->seqno > parent->value) ? false : true;
 }
 
-static bool goldfish_sync_timeline_fence_enable_signaling(struct fence *fence)
+static bool goldfish_sync_timeline_fence_enable_signaling(struct dma_fence *fence)
 {
        struct sync_pt *pt = goldfish_sync_fence_to_sync_pt(fence);
-       struct goldfish_sync_timeline *parent = fence_parent(fence);
+       struct goldfish_sync_timeline *parent = goldfish_dma_fence_parent(fence);
 
        if (goldfish_sync_timeline_fence_signaled(fence))
                return false;
@@ -219,35 +219,35 @@ static bool goldfish_sync_timeline_fence_enable_signaling(struct fence *fence)
        return true;
 }
 
-static void goldfish_sync_timeline_fence_disable_signaling(struct fence *fence)
+static void goldfish_sync_timeline_fence_disable_signaling(struct dma_fence *fence)
 {
        struct sync_pt *pt = container_of(fence, struct sync_pt, base);
 
        list_del_init(&pt->active_list);
 }
 
-static void goldfish_sync_timeline_fence_value_str(struct fence *fence,
+static void goldfish_sync_timeline_fence_value_str(struct dma_fence *fence,
                                        char *str, int size)
 {
        snprintf(str, size, "%d", fence->seqno);
 }
 
 static void goldfish_sync_timeline_fence_timeline_value_str(
-                               struct fence *fence,
+                               struct dma_fence *fence,
                                char *str, int size)
 {
-       struct goldfish_sync_timeline *parent = fence_parent(fence);
+       struct goldfish_sync_timeline *parent = goldfish_dma_fence_parent(fence);
 
        snprintf(str, size, "%d", parent->value);
 }
 
-static const struct fence_ops goldfish_sync_timeline_fence_ops = {
+static const struct dma_fence_ops goldfish_sync_timeline_fence_ops = {
        .get_driver_name = goldfish_sync_timeline_fence_get_driver_name,
        .get_timeline_name = goldfish_sync_timeline_fence_get_timeline_name,
        .enable_signaling = goldfish_sync_timeline_fence_enable_signaling,
        .disable_signaling = goldfish_sync_timeline_fence_disable_signaling,
        .signaled = goldfish_sync_timeline_fence_signaled,
-       .wait = fence_default_wait,
+       .wait = dma_fence_default_wait,
        .release = goldfish_sync_timeline_fence_release,
        .fence_value_str = goldfish_sync_timeline_fence_value_str,
        .timeline_value_str = goldfish_sync_timeline_fence_timeline_value_str,
index fc25924652c1609a480857e7de2bfc7d2a314d9f..638c6fb68f1e2e498cfcf98f94dc6e25ae6c49d4 100644 (file)
@@ -1,14 +1,14 @@
 #include <linux/sync_file.h>
-#include <linux/fence.h>
+#include <linux/dma-fence.h>
 
 /**
  * struct sync_pt - sync_pt object
- * @base: base fence object
+ * @base: base dma_fence object
  * @child_list: sync timeline child's list
  * @active_list: sync timeline active child's list
  */
 struct sync_pt {
-       struct fence base;
+       struct dma_fence base;
        struct list_head child_list;
        struct list_head active_list;
 };