From 9ca7b9b1cf292e790223419dc197737f875109d4 Mon Sep 17 00:00:00 2001 From: Erik Kurzinger Date: Tue, 16 Apr 2024 14:44:50 -0700 Subject: [PATCH] core/syncobjtimeline: import release fence at correct timeline point SyncTimeline::moveInto imports the provided fence to the syncobj by calling drmSyncobjImportSyncFile. However, that function assumes the syncobj a binary syncobj, meaning the fence will be imported at timeline point 0, not at the intended timeline point. Since there is no timeline equivalent of drmSyncobjImportSyncFile, to achieve the correct behavior we create a temporary binary syncobj, import the fence into that, and then use drmSyncobjTransfer to transfer the fence to the desired timeline point on the destination syncobj. Signed-off-by: Erik Kurzinger --- src/core/syncobjtimeline.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/syncobjtimeline.cpp b/src/core/syncobjtimeline.cpp index 437902644e..3de607a89b 100644 --- a/src/core/syncobjtimeline.cpp +++ b/src/core/syncobjtimeline.cpp @@ -110,6 +110,10 @@ void SyncTimeline::signal(uint64_t timelinePoint) void SyncTimeline::moveInto(uint64_t timelinePoint, const FileDescriptor &fd) { - drmSyncobjImportSyncFile(m_drmFd, m_handle, fd.get()); + uint32_t tempHandle = 0; + drmSyncobjCreate(m_drmFd, 0, &tempHandle); + drmSyncobjImportSyncFile(m_drmFd, tempHandle, fd.get()); + drmSyncobjTransfer(m_drmFd, m_handle, timelinePoint, tempHandle, 0, 0); + drmSyncobjDestroy(m_drmFd, tempHandle); } }