From eaf8de5e1ddf176bea9ecec72e5e3c1c7451feee Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 6 Aug 2026 16:39:33 +1000 Subject: [PATCH] [idd] scheduler: republish after owner subscription Consume subscription notifications from the private owner queues. When any lane gains a subscriber, request a retained-frame publication for the current timing owner so a static desktop cannot leave it waiting. --- idd/LGIdd/CFrameScheduler.cpp | 15 +++++++++++++++ idd/LGIdd/CFrameScheduler.h | 1 + idd/LGIdd/CIndirectDeviceContext.cpp | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/idd/LGIdd/CFrameScheduler.cpp b/idd/LGIdd/CFrameScheduler.cpp index 15d5839c..ab6c59ac 100644 --- a/idd/LGIdd/CFrameScheduler.cpp +++ b/idd/LGIdd/CFrameScheduler.cpp @@ -779,6 +779,21 @@ void CFrameScheduler::FrameRepublished(const Schedule& schedule, ReleaseSRWLockExclusive(&m_lock); } +void CFrameScheduler::RequestRepublish() +{ + bool wake = false; + AcquireSRWLockExclusive(&m_lock); + if (m_scheduling) + { + ++m_republishRequestTicket; + wake = true; + } + ReleaseSRWLockExclusive(&m_lock); + + if (wake) + WakePublisher(); +} + unsigned CFrameScheduler::GetSecondaryRecipients( const uint32_t * clientIDs, unsigned count, uint32_t frameSerial, uint64_t now, uint32_t * recipients) const diff --git a/idd/LGIdd/CFrameScheduler.h b/idd/LGIdd/CFrameScheduler.h index 22458089..6df3a90c 100644 --- a/idd/LGIdd/CFrameScheduler.h +++ b/idd/LGIdd/CFrameScheduler.h @@ -157,6 +157,7 @@ public: uint64_t& target) const; void FrameDelivered(const uint32_t * clientIDs, unsigned count, uint32_t frameSerial, uint64_t now); + void RequestRepublish(); void NotifyPublisher() const { WakePublisher(); } void TryRecordFrameTiming(uint64_t duration); void LogStatistics(uint64_t now); diff --git a/idd/LGIdd/CIndirectDeviceContext.cpp b/idd/LGIdd/CIndirectDeviceContext.cpp index 107d9bb5..57294ef7 100644 --- a/idd/LGIdd/CIndirectDeviceContext.cpp +++ b/idd/LGIdd/CIndirectDeviceContext.cpp @@ -1410,6 +1410,15 @@ void CIndirectDeviceContext::LGMPTimer() if (lgmpHostQueueNewSubs(m_frameQueue)) m_frameScheduler.NotifyPublisher(); + bool ownerSubscribed = false; + for (unsigned queueIndex = 0; + queueIndex < LGMP_Q_FRAME_LEN; + ++queueIndex) + ownerSubscribed |= + lgmpHostQueueNewSubs(m_frameOwnerQueue[queueIndex]) != 0; + if (ownerSubscribed) + m_frameScheduler.RequestRepublish(); + ProcessFrameDeliveries(); if (lgmpHostQueueNewSubs(m_pointerQueue))