dma-buf/sw-sync: Use an rbtree to sort fences in the timeline
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 29 Jun 2017 21:12:53 +0000 (22:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Dec 2017 21:01:55 +0000 (22:01 +0100)
commitdb767404ad09b419779704fff4709a25f1dc252b
treea2f49051fb5dfec5b5508252a864245c1b077d8e
parente82ecb230924314b848b68f5dade1ccf38bea838
dma-buf/sw-sync: Use an rbtree to sort fences in the timeline

commit f1e8c67123cf171e2b0357e885e426328b241d7d upstream.

Reduce the list iteration when incrementing the timeline by storing the
fences in increasing order.

v2: Prevent spinlock recursion on free during create
v3: Fixup rebase conflict inside comments that escaped the compiler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170629211253.22766-1-chris@chris-wilson.co.uk
[s/dma_fence/fence/g - gregkh]
Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma-buf/sw_sync.c
drivers/dma-buf/sync_debug.h