Fix multi-monitor swapchain threading for issue #449#482
Open
AndreTheAss wants to merge 1 commit intoVirtualDrivers:masterfrom
Open
Fix multi-monitor swapchain threading for issue #449#482AndreTheAss wants to merge 1 commit intoVirtualDrivers:masterfrom
AndreTheAss wants to merge 1 commit intoVirtualDrivers:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the multi-monitor swapchain threading bug described in issue #449.
It changes the indirect display driver from a single global swapchain worker model to a per-monitor worker model, so each virtual monitor keeps its own
SwapChainProcessorand processing thread.This PR was prepared by an AI coding assistant on the explicit instruction of Andre, and it is intended to address only bug/issue #449.
What changed
IndirectDeviceContextwith a per-monitor mapping ofIDDCX_MONITOR -> SwapChainProcessorAssignSwapChainso only the worker for the affected monitor is created or replacedUnassignSwapChainso only the worker for the affected monitor is removedIndirectDeviceContextdestructorE_PENDINGmonitorModesWhy
The previous single-worker architecture caused each new swapchain assignment to tear down the existing processor for other monitors. In practice, that meant only the most recently assigned monitor stayed stable, while other virtual displays could lag, stutter, or stop processing reliably.
The new per-monitor model allows swapchain processing to run independently and in parallel for each virtual monitor.
Scope
This PR is intentionally limited to bug/issue #449 only.
It does not attempt to change unrelated driver behavior beyond what is necessary to fix the multi-monitor swapchain processing issue.
Validation
MttVDD.vcxprojinRelease|x64WUDFRd.sys, unrelated to this fix