summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv/hal/os
diff options
context:
space:
mode:
authorYong Gan <yong.gan@nxp.com>2018-07-20 06:40:22 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:32:43 +0800
commit6a53e5e367fada6191c1b27313f47acc40011703 (patch)
tree7b5c509dad49f10fac21178d0a5633ace5c6daa0 /drivers/mxc/gpu-viv/hal/os
parent0efe4e02da4052d2f1a4bce6822deedca6a249d3 (diff)
MA-11957 [Android] 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. Fix compile issue sync_timeline_create is not defined. Change-Id: I0f89a089f11131070f96a5ddc922938f4b28615f Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/os')
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c28
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c34
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h8
4 files changed, 36 insertions, 36 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
index b613b080f003..584a7c984ed6 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
@@ -266,7 +266,7 @@ typedef struct _gcsSIGNAL
/* Parent timeline. */
struct sync_timeline * timeline;
# else
- struct fence *fence;
+ struct dma_fence *fence;
# endif
#endif
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index 0209e9f52503..08a87e2e35ea 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -5647,7 +5647,7 @@ gckOS_Signal(
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0)
struct sync_timeline * timeline = gcvNULL;
# else
- struct fence * fence = gcvNULL;
+ struct dma_fence * fence = gcvNULL;
# endif
#endif
@@ -5716,8 +5716,8 @@ gckOS_Signal(
# else
if (fence)
{
- fence_signal(fence);
- fence_put(fence);
+ dma_fence_signal(fence);
+ dma_fence_put(fence);
}
# endif
#endif
@@ -6797,7 +6797,7 @@ gckOS_WaitNativeFence(
for (i = 0; i < fence->num_fences; i++)
{
- struct fence *f = fence->cbs[i].sync_pt;
+ struct dma_fence *f = fence->cbs[i].sync_pt;
struct sync_pt *pt = container_of(f, struct sync_pt, base);
/* Do not need to wait on same timeline. */
@@ -6942,7 +6942,7 @@ gckOS_CreateNativeFence(
OUT gctINT * FenceFD
)
{
- struct fence *fence = NULL;
+ struct dma_fence *fence = NULL;
struct sync_file *sync = NULL;
int fd;
struct viv_sync_timeline *timeline;
@@ -6993,7 +6993,7 @@ OnError:
if (fence)
{
- fence_put(fence);
+ dma_fence_put(fence);
}
if (fd > 0)
@@ -7013,12 +7013,12 @@ gckOS_WaitNativeFence(
IN gctUINT32 Timeout
)
{
- struct fence *fence;
+ struct dma_fence *fence;
struct viv_sync_timeline *timeline;
gceSTATUS status = gcvSTATUS_OK;
unsigned int i;
unsigned int numFences;
- struct fence **fences;
+ struct dma_fence **fences;
unsigned long timeout;
timeline = (struct viv_sync_timeline *) Timeline;
@@ -7030,9 +7030,9 @@ gckOS_WaitNativeFence(
gcmkONERROR(gcvSTATUS_GENERIC_IO);
}
- if (fence_is_array(fence))
+ if (dma_fence_is_array(fence))
{
- struct fence_array *array = to_fence_array(fence);
+ struct dma_fence_array *array = to_dma_fence_array(fence);
fences = array->fences;
numFences = array->num_fences;
}
@@ -7046,13 +7046,13 @@ gckOS_WaitNativeFence(
for (i = 0; i < numFences; i++)
{
- struct fence *f = fences[i];
+ struct dma_fence *f = fences[i];
if (f->context != timeline->context &&
- !fence_is_signaled(f))
+ !dma_fence_is_signaled(f))
{
signed long ret;
- ret = fence_wait_timeout(fence, 1, timeout);
+ ret = dma_fence_wait_timeout(fence, 1, timeout);
if (ret == -ERESTARTSYS)
{
@@ -7072,7 +7072,7 @@ gckOS_WaitNativeFence(
}
}
- fence_put(fence);
+ dma_fence_put(fence);
return gcvSTATUS_OK;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
index 95f3e460e648..ee30a5492e8e 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
@@ -237,7 +237,7 @@ struct viv_sync_timeline * viv_sync_timeline_create(const char *name, gckOS Os)
return NULL;
strncpy(timeline->name, name, sizeof(timeline->name));
- timeline->context = fence_context_alloc(1);
+ timeline->context = dma_fence_context_alloc(1);
atomic64_set(&timeline->seqno, 0);
timeline->os = Os;
@@ -249,19 +249,19 @@ void viv_sync_timeline_destroy(struct viv_sync_timeline *timeline)
kfree(timeline);
}
-static const char * viv_fence_get_driver_name(struct fence *fence)
+static const char * viv_fence_get_driver_name(struct dma_fence *fence)
{
return "viv_gpu_sync";
}
-static const char * viv_fence_get_timeline_name(struct fence *fence)
+static const char * viv_fence_get_timeline_name(struct dma_fence *fence)
{
struct viv_fence *f = (struct viv_fence *)fence;
return f->parent->name;
}
/* Same as fence_signaled. */
-static inline bool __viv_fence_signaled(struct fence *fence)
+static inline bool __viv_fence_signaled(struct dma_fence *fence)
{
struct viv_fence *f = (struct viv_fence *)fence;
struct viv_sync_timeline *timeline = f->parent;
@@ -272,19 +272,19 @@ static inline bool __viv_fence_signaled(struct fence *fence)
return (status == gcvSTATUS_TRUE) ? true : false;
}
-static bool viv_fence_enable_signaling(struct fence *fence)
+static bool viv_fence_enable_signaling(struct dma_fence *fence)
{
/* fence is locked already. */
return !__viv_fence_signaled(fence);
}
-static bool viv_fence_signaled(struct fence *fence)
+static bool viv_fence_signaled(struct dma_fence *fence)
{
/* fence could be locked, could be not. */
return __viv_fence_signaled(fence);
}
-static void viv_fence_release(struct fence *fence)
+static void viv_fence_release(struct dma_fence *fence)
{
struct viv_fence *f = (struct viv_fence *)fence;
struct viv_sync_timeline *timeline = f->parent;
@@ -295,22 +295,22 @@ static void viv_fence_release(struct fence *fence)
kfree(fence);
}
-static struct fence_ops viv_fence_ops =
+static struct dma_fence_ops viv_fence_ops =
{
.get_driver_name = viv_fence_get_driver_name,
.get_timeline_name = viv_fence_get_timeline_name,
.enable_signaling = viv_fence_enable_signaling,
.signaled = viv_fence_signaled,
- .wait = fence_default_wait,
+ .wait = dma_fence_default_wait,
.release = viv_fence_release,
};
-struct fence * viv_fence_create(struct viv_sync_timeline *timeline,
+struct dma_fence * viv_fence_create(struct viv_sync_timeline *timeline,
gcsSIGNAL *signal)
{
gceSTATUS status;
struct viv_fence *fence;
- struct fence *old_fence = NULL;
+ struct dma_fence *old_fence = NULL;
unsigned seqno;
fence = kzalloc(sizeof(struct viv_fence), gcdNOWARN | GFP_KERNEL);
@@ -333,7 +333,7 @@ struct fence * viv_fence_create(struct viv_sync_timeline *timeline,
seqno = (unsigned)atomic64_inc_return(&timeline->seqno);
- fence_init((struct fence *)fence, &viv_fence_ops,
+ dma_fence_init((struct dma_fence *)fence, &viv_fence_ops,
&fence->lock, timeline->context, seqno);
/*
@@ -348,24 +348,24 @@ struct fence * viv_fence_create(struct viv_sync_timeline *timeline,
}
if (!signal->done) {
- signal->fence = (struct fence*)fence;
- fence_get((struct fence*)fence);
+ signal->fence = (struct dma_fence*)fence;
+ dma_fence_get((struct dma_fence*)fence);
}
spin_unlock(&signal->lock);
if (old_fence)
- fence_put(old_fence);
+ dma_fence_put(old_fence);
if (!signal->fence) {
/* Fence already signaled. */
gckOS_DestroySignal(timeline->os, fence->signal);
fence->signal = NULL;
- fence_signal_locked((struct fence*)fence);
+ dma_fence_signal_locked((struct dma_fence*)fence);
}
- return (struct fence*)fence;
+ return (struct dma_fence*)fence;
}
#endif /* v4.9.0 */
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
index 9fe50429b164..4b526bab7bb4 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
@@ -101,8 +101,8 @@ struct sync_pt * viv_sync_pt_create(struct viv_sync_timeline *obj,
#else /* v4.9.0 */
#include <linux/sync_file.h>
-#include <linux/fence.h>
-#include <linux/fence-array.h>
+#include <linux/dma-fence.h>
+#include <linux/dma-fence-array.h>
#include <gc_hal.h>
#include <gc_hal_base.h>
@@ -125,7 +125,7 @@ struct viv_sync_timeline
struct viv_fence
{
/* must be the first. */
- struct fence base;
+ struct dma_fence base;
spinlock_t lock;
struct viv_sync_timeline *parent;
@@ -138,7 +138,7 @@ struct viv_sync_timeline * viv_sync_timeline_create(const char *name, gckOS Os);
void viv_sync_timeline_destroy(struct viv_sync_timeline *timeline);
-struct fence * viv_fence_create(struct viv_sync_timeline *timeline,
+struct dma_fence * viv_fence_create(struct viv_sync_timeline *timeline,
gcsSIGNAL *signal);
#endif /* v4.9.0 */