forked from unom/punktfunk
fix(pf-win-display): unpin mode indexes on paths the CCD isolate deactivates
Field report: with Exclusive Topology, the physical monitor sometimes stayed lit — every isolate attempt re-committed and failed SetDisplayConfig with 0x57 ERROR_INVALID_PARAMETER. Clearing DISPLAYCONFIG_PATH_ACTIVE alone leaves the deactivated path's source/target modeInfoIdx pinned to the queried mode entries, and per the SetDisplayConfig contract a path being turned off must have BOTH mode indexes set to DISPLAYCONFIG_PATH_MODE_IDX_INVALID; some driver/topology combinations (notably when the doomed path shares a source with the kept virtual path) reject the supplied config outright, so the retry loop could never converge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -861,7 +861,18 @@ pub unsafe fn isolate_displays_ccd(keep_target_ids: &[u32]) -> Option<SavedConfi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if p.flags & DISPLAYCONFIG_PATH_ACTIVE != 0 {
|
if p.flags & DISPLAYCONFIG_PATH_ACTIVE != 0 {
|
||||||
p.flags &= !DISPLAYCONFIG_PATH_ACTIVE; // mark this path inactive
|
// Mark the path inactive AND unpin its modes: per the SetDisplayConfig
|
||||||
|
// contract a path being turned OFF needs BOTH mode indexes marked invalid,
|
||||||
|
// and leaving them referencing the queried mode entries gets the whole
|
||||||
|
// supplied config rejected with 0x57 ERROR_INVALID_PARAMETER on some
|
||||||
|
// driver/topology combinations (field-reported: exclusive mode left the
|
||||||
|
// physical panel lit, every retry failing 0x57). Writing the all-ones
|
||||||
|
// sentinel to the whole union is also correct under the virtual-mode-aware
|
||||||
|
// interpretation (cloneGroupId/sourceModeInfoIdx both become their 0xffff
|
||||||
|
// INVALID values).
|
||||||
|
p.flags &= !DISPLAYCONFIG_PATH_ACTIVE;
|
||||||
|
p.sourceInfo.Anonymous.modeInfoIdx = DISPLAYCONFIG_PATH_MODE_IDX_INVALID;
|
||||||
|
p.targetInfo.Anonymous.modeInfoIdx = DISPLAYCONFIG_PATH_MODE_IDX_INVALID;
|
||||||
others += 1;
|
others += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user