Skip to content

Commit

Permalink
vblankmanager: Treat wakeup time as scheduled wakeup point for timerf…
Browse files Browse the repository at this point in the history
…d path

Because we are using timerfd, ulWakeupTime should actually be the target point of the timerfd when using that, not the the current time from OnPollIn, so we can account for the scheduling quantums from the target wakeup time and other work (like we were wrt the pipe write before)
  • Loading branch information
misyltoad committed Dec 7, 2023
1 parent 956591f commit 07df97a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vblankmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ namespace gamescope
if ( !m_bArmed.exchange( false ) )
return;

uint64_t ulNow = get_time_in_nanos();

m_PendingVBlank = VBlankTime
{
.schedule = m_TimerFDSchedule,
.ulWakeupTime = ulNow,
.ulWakeupTime = m_TimerFDSchedule.ulScheduledWakeupPoint,
};
#ifdef VBLANK_DEBUG
uint64_t ulNow = get_time_in_nanos();
fprintf( stderr, "wakeup: %lu\n", ulNow );
#endif

Expand Down

0 comments on commit 07df97a

Please sign in to comment.