Skip to content

Fix frames that are marked as discarded incorrectly #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikkumaar
Copy link

@nikkumaar nikkumaar commented Apr 10, 2025

The way PresentMon marks the completion of frames is to first mark frames as 'Presented' when it receives MMIO MPO flip call and then once Win32k providers’ (running within DWM process) TokenStateChange(TokenState::Discarded) event is received it is marked as completed.

In certain cases, like when there are short bursts of presents, we get multiple back-to-back flips and token tracking thread ends up marking the first frame in the burst as dropped. To fix this issue, we mark the frame as discarded only if the frame already doesn’t have valid ScreenTime.

ETL file: https://drive.google.com/file/d/1uVnWiT9An-p5_BanYQB8e_-FCPd61qXP/view?usp=sharing

@nikkumaar
Copy link
Author

Attaching the ETL file here. Please unzip all three parts and then extract using 7-zip.
PM_BugFix_Files.7z.003.zip
PM_BugFix_Files.7z.002.zip
PM_BugFix_Files.7z.001.zip

@nikkumaar nikkumaar marked this pull request as ready for review April 15, 2025 16:16
@nikkumaar nikkumaar marked this pull request as draft April 21, 2025 13:24
@nikkumaar nikkumaar force-pushed the fix_discardedframes_bug branch from bef42ca to 212e57b Compare May 5, 2025 14:40
The way FrameView/PresentMon marks the completion of frames is to first just mark frames as 'Presented' when it receives MMIO MPO flip call and then once Win32k providers’ (running within DWM process) TokenStateChange(TokenState::Discarded) event is received it is marked as completed.

In certain cases like when there are short bursts of presents, we get multiple back to back flips and token tracking thread ends up marking the second frame in the burst as dropped. To fix this issue, we mark the frame as discarded only if the frame already doesn’t have valid ScreenTime.
@nikkumaar nikkumaar force-pushed the fix_discardedframes_bug branch from 212e57b to 3ba0685 Compare May 5, 2025 14:43
@nikkumaar nikkumaar marked this pull request as ready for review May 6, 2025 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant