diff options
author | Richard Liu <xuegang.liu@freescale.com> | 2016-03-18 11:31:30 +0800 |
---|---|---|
committer | Xianzhong <xianzhong.li@nxp.com> | 2016-03-25 13:54:05 +0800 |
commit | 529621aec56e8d128ce33cd6d9fb2b0669b7e736 (patch) | |
tree | 7281bc8b81d5ad335599d7ba127b0a92c18a7eb3 /drivers/mxc | |
parent | 2c1fa9347a50e05c79b76de35f84192af796f677 (diff) |
MGS-1630 5.0.11.p8 driver can't pass build with kernel 4.1 on Android M6.0
It has converted sync to fence api in kernel_imx/drivers/staging/android/sync.h,
so make it done in gpu driver to match kernel.
Signed-off-by: Meng Mingming <b51843@freescale.com>
Signed-off-by: Richard Liu <xuegang.liu@freescale.com>
(cherry picked from commit d69c57557a2ef782d0daa617a30945f41a608fd5)
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 39 | ||||
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c | 14 |
2 files changed, 43 insertions, 10 deletions
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 f7710fbd58d1..c3f91701d115 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 @@ -8503,7 +8503,7 @@ gckOS_CreateNativeFence( /* Cast timeline. */ timeline = (struct viv_sync_timeline *) Timeline; - fd = get_unused_fd(); + fd = get_unused_fd_flags(O_CLOEXEC); if (fd < 0) { @@ -8565,7 +8565,6 @@ gckOS_WaitNativeFence( ) { struct sync_timeline * timeline; - struct list_head *pos; struct sync_fence * fence; gctBOOL wait = gcvFALSE; gceSTATUS status = gcvSTATUS_OK; @@ -8584,18 +8583,40 @@ gckOS_WaitNativeFence( gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT); } - list_for_each(pos, &fence->pt_list_head) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) { - struct sync_pt * pt = - container_of(pos, struct sync_pt, pt_list); + int i; - /* Do not need to wait on same timeline. */ - if (pt->parent != timeline) + for (i = 0; i < fence->num_fences; i++) { - wait = gcvTRUE; - break; + struct 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. */ + if ((sync_pt_parent(pt) != timeline) && !fence_is_signaled(f)) + { + wait = gcvTRUE; + break; + } } } +#else + { + struct list_head *pos; + list_for_each(pos, &fence->pt_list_head) + { + struct sync_pt * pt = + container_of(pos, struct sync_pt, pt_list); + + /* Do not need to wait on same timeline. */ + if (pt->parent != timeline) + { + wait = gcvTRUE; + break; + } + } + } +#endif if (wait) { 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 fcde100fa626..21f4f69be18b 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 @@ -79,7 +79,11 @@ viv_sync_pt_dup( struct viv_sync_timeline *obj; src = (struct viv_sync_pt *) sync_pt; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) + obj = (struct viv_sync_timeline *) sync_pt_parent(sync_pt); +#else obj = (struct viv_sync_timeline *) sync_pt->parent; +#endif /* Create the new sync_pt. */ pt = (struct viv_sync_pt *) @@ -111,7 +115,11 @@ viv_sync_pt_has_signaled( struct viv_sync_timeline * obj; pt = (struct viv_sync_pt *)sync_pt; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) + obj = (struct viv_sync_timeline *) sync_pt_parent(sync_pt); +#else obj = (struct viv_sync_timeline *)sync_pt->parent; +#endif status = gckOS_QuerySyncPoint(obj->os, pt->sync, &state); @@ -150,7 +158,11 @@ viv_sync_pt_free( struct viv_sync_timeline * obj; pt = (struct viv_sync_pt *) sync_pt; - obj = (struct viv_sync_timeline *) sync_pt->parent; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) + obj = (struct viv_sync_timeline *) sync_pt_parent(sync_pt); +#else + obj = (struct viv_sync_timeline *)sync_pt->parent; +#endif gckOS_DestroySyncPoint(obj->os, pt->sync); } |