OpenCloudOS-Kernel/drivers/staging/android
Gustavo Padovan a02b9dc90d dma-buf/sync_file: refactor fence storage in struct sync_file
Create sync_file->fence to abstract the type of fence we are using for
each sync_file. If only one fence is present we use a normal struct fence
but if there is more fences to be added to the sync_file a fence_array
is created.

This change cleans up sync_file a bit. We don't need to have sync_file_cb
array anymore. Instead, as we always have  one fence, only one fence
callback is registered per sync_file.

v2: Comments from Chris Wilson and Christian König
	- Not using fence_ops anymore
	- fence_is_array() was created to differentiate fence from fence_array
	- fence_array_teardown() is now exported and used under fence_is_array()
	- struct sync_file lost num_fences member

v3: Comments from Chris Wilson and Christian König
	- struct sync_file lost status member in favor of fence_is_signaled()
	- drop use of fence_array_teardown()
	- use sizeof(*fence) to allocate only an array on fence pointers

v4: Comments from Chris Wilson
	- use sizeof(*fence) to reallocate array
	- fix typo in comments
	- protect num_fences sum against overflows
	- use array->base instead of casting the to struct fence

v5: fixes checkpatch warnings

v6: fix case where all fences are signaled.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
2016-08-11 15:33:24 +05:30
..
ion staging: android: ion: dummy: fix dereference of ERR_PTR 2016-04-29 17:40:50 -07:00
trace staging/android: rename sync.h to sync_debug.h 2016-06-17 21:17:40 -07:00
uapi staging/android: make sw_ioctl info internal to sw_sync.c 2016-06-17 21:17:40 -07:00
Kconfig staging/android: add DEBUG_FS dependence on Kconfig 2016-06-17 21:17:40 -07:00
Makefile staging/android: make sync_timeline internal to sw_sync 2016-06-17 21:17:40 -07:00
TODO staging/android: add TODO to de-stage android sync framework 2015-12-14 11:05:45 -08:00
ashmem.c Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 19:08:56 -07:00
ashmem.h staging: android: Split uapi out of ashmem.h 2014-02-18 11:03:28 -08:00
lowmemorykiller.c mm: move most file-based accounting to the node 2016-07-28 16:07:41 -07:00
sw_sync.c staging/android: rename sync.h to sync_debug.h 2016-06-17 21:17:40 -07:00
sync_debug.c dma-buf/sync_file: refactor fence storage in struct sync_file 2016-08-11 15:33:24 +05:30
sync_debug.h Merge tag 'drm-for-v4.8' of git://people.freedesktop.org/~airlied/linux 2016-08-01 21:44:08 -04:00