linux-sg2042/drivers/dma-buf
Chris Wilson 99f8284367 dma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence
Up until recently sync_file were create to export a single dma-fence to
userspace, and so we could canabalise a bit insie dma-fence to mark
whether or not we had enable polling for the sync_file itself. However,
with the advent of syncobj, we do allow userspace to create multiple
sync_files for a single dma-fence. (Similarly, that the sw-sync
validation framework also started returning multiple sync-files wrapping
a single dma-fence for a syncpt also triggering the problem.)

This patch reverts my suggestion in commit e241655373
("dma-buf/sync_file: only enable fence signalling on poll()") to use a
single bit in the shared dma-fence and restores the sync_file->flags for
tracking the bits individually.

Reported-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Fixes: f1e8c67123 ("dma-buf/sw-sync: Use an rbtree to sort fences in the timeline")
Fixes: e9083420bb ("drm: introduce sync objects (v4)")
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>
Cc: dri-devel@lists.freedesktop.org
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.13-rc1+
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170728212951.7818-1-chris@chris-wilson.co.uk
(cherry picked from commit db1fc97ca0)
2017-07-31 10:55:24 -03:00
..
Kconfig dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
Makefile dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
dma-buf.c dma-buf: Adjust a null pointer check in dma_buf_attach() 2017-05-08 20:50:21 +05:30
dma-fence-array.c dma-fence: add dma_fence_match_context helper 2017-03-17 23:51:36 +05:30
dma-fence.c Merge branch 'drm-misc-next-fixes' into drm-misc-fixes 2017-07-17 11:56:07 -04:00
reservation.c reservation: revert "wait only with non-zero timeout specified (v3)" v2 2016-11-09 00:48:57 +05:30
seqno-fence.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
sw_sync.c dma-buf/sw_sync: put fence reference from the fence creation 2016-11-08 23:57:40 +05:30
sync_debug.c Merge branch 'drm-misc-next-fixes' into drm-misc-fixes 2017-07-17 11:56:07 -04:00
sync_debug.h dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
sync_file.c dma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence 2017-07-31 10:55:24 -03:00
sync_trace.h dma-buf/sw_sync: de-stage SW_SYNC 2016-08-15 16:41:46 +02:00