aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2017-04-18 14:58:13 +0530
committerAmit Pundir <amit.pundir@linaro.org>2017-07-17 11:22:45 +0530
commit42783296b50846b17550b024f82b0830f6ec6051 (patch)
tree0cc82126aaa598a8592b36f7358706ad3fffe103
parent03043a9288210b38be92fe6a1c3f3c77a6eb402a (diff)
downloadlinaro-android-42783296b50846b17550b024f82b0830f6ec6051.tar.gz
HACK: ANDROID: goldfish_sync_timeline: Rename fence to dma_fence
Rename fence interfaces to dma_fence to match with the upstream commit, f54d1867005c ("dma-buf: Rename struct fence to dma_fence"), changes. FIXME: Remove goldfish_sync_timeline and use sync_timeline interfaces instead. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--drivers/staging/goldfish/goldfish_sync_timeline.c4
-rw-r--r--drivers/staging/goldfish/goldfish_sync_timeline_fence.c46
-rw-r--r--drivers/staging/goldfish/goldfish_sync_timeline_fence.h6
3 files changed, 28 insertions, 28 deletions
diff --git a/drivers/staging/goldfish/goldfish_sync_timeline.c b/drivers/staging/goldfish/goldfish_sync_timeline.c
index 5bef4c6c0283..880d6e2e5b34 100644
--- a/drivers/staging/goldfish/goldfish_sync_timeline.c
+++ b/drivers/staging/goldfish/goldfish_sync_timeline.c
@@ -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;
}
diff --git a/drivers/staging/goldfish/goldfish_sync_timeline_fence.c b/drivers/staging/goldfish/goldfish_sync_timeline_fence.c
index e671618cf888..a5bc2deab780 100644
--- a/drivers/staging/goldfish/goldfish_sync_timeline_fence.c
+++ b/drivers/staging/goldfish/goldfish_sync_timeline_fence.c
@@ -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,
diff --git a/drivers/staging/goldfish/goldfish_sync_timeline_fence.h b/drivers/staging/goldfish/goldfish_sync_timeline_fence.h
index fc25924652c1..638c6fb68f1e 100644
--- a/drivers/staging/goldfish/goldfish_sync_timeline_fence.h
+++ b/drivers/staging/goldfish/goldfish_sync_timeline_fence.h
@@ -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;
};