fix(host): force a CCD mode re-enumeration after UPDATE_MODES (in-place resize)
First on-glass run: the driver accepted every UpdateModes2 (0x0 in the driver log) but the OS never re-enumerated the target's settable modes on its own — 'OS did not advertise 800x1050 within 2s' → re-arrival fallback every time. Re-commit the current config with SDC_FORCE_MODE_ENUMERATION (the same nudge the isolate/layout paths already rely on) before the advertised-wait, re-kick up to 3x, and log the actually-offered resolutions when it still misses. Driver: dbglog the *2 mode-query/parse callbacks so the re-enumeration story is visible in pfvd-driver.log. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,6 +129,16 @@ pub unsafe extern "C" fn parse_monitor_description2(
|
||||
return STATUS_NOT_FOUND;
|
||||
};
|
||||
let count = crate::monitor::flatten(&modes).count() as u32;
|
||||
// Bring-up/diagnostic visibility (P2): does the OS ever RE-parse the description after an
|
||||
// UPDATE_MODES? The head mode names which list generation this call served.
|
||||
if let Some(head) = crate::monitor::flatten(&modes).next() {
|
||||
dbglog!(
|
||||
"[pf-vd] parse_monitor_description2(id={id}): {count} modes, head {}x{}@{}",
|
||||
head.width,
|
||||
head.height,
|
||||
head.refresh_rate
|
||||
);
|
||||
}
|
||||
out_args.MonitorModeBufferOutputCount = count;
|
||||
if in_args.MonitorModeBufferInputCount < count {
|
||||
// A zero input count is a count-only probe (success); a non-zero too-small buffer is an error.
|
||||
@@ -204,6 +214,17 @@ pub unsafe extern "C" fn monitor_query_modes2(
|
||||
return STATUS_NOT_FOUND;
|
||||
};
|
||||
let count = crate::monitor::flatten(&modes).count() as u32;
|
||||
// Diagnostic visibility (P2): shows whether/when the OS re-queries target modes after an
|
||||
// UPDATE_MODES (the head mode names the list generation this call served).
|
||||
if let Some(head) = crate::monitor::flatten(&modes).next() {
|
||||
dbglog!(
|
||||
"[pf-vd] monitor_query_modes2: {count} modes, head {}x{}@{} (fill={})",
|
||||
head.width,
|
||||
head.height,
|
||||
head.refresh_rate,
|
||||
in_args.TargetModeBufferInputCount >= count
|
||||
);
|
||||
}
|
||||
out_args.TargetModeBufferOutputCount = count;
|
||||
if in_args.TargetModeBufferInputCount >= count {
|
||||
// SAFETY: `pTargetModes` points to >= `count` IDDCX_TARGET_MODE2 entries.
|
||||
|
||||
Reference in New Issue
Block a user