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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nikkumaar
Copy link

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 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.

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

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
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
Check if there is valid ScreenTime before marking frame as discarded.
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