Implement finding the right timeline point in drm_syncobj_find_fence.

Signed-off-by: Christian König <christian.koe...@amd.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to