[PATCH 7/7] drm/syncobj: use the timeline point in drm_syncobj_find_fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Implement finding the right timeline point in drm_syncobj_find_fence.

Signed-off-by: Christian König <christian.koenig@xxxxxxx>
---
 drivers/gpu/drm/drm_syncobj.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 589d884ccd58..d42c51520da4 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -307,9 +307,17 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
 		return -ENOENT;
 
 	*fence = drm_syncobj_fence_get(syncobj);
-	if (!*fence) {
+	if (!*fence)
 		ret = -EINVAL;
+
+	if (!ret && point) {
+		dma_fence_chain_for_each(*fence) {
+			if (!to_dma_fence_chain(*fence) ||
+			    (*fence)->seqno <= point)
+				break;
+		}
 	}
+
 	drm_syncobj_put(syncobj);
 	return ret;
 }
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux