feat(vdisplay/driver): the frame pump survives MMCSS refusal and outranks GPU contention

Two stall-immunity hardenings for the swap-chain drain thread (branch-2 of the
disturbance-immunity program — failures in OUR delivery leg, as opposed to
adapter-wide display servicing, which no priority survives):

- MMCSS registration fails under the restricted WUDFHost token on some boxes;
  the drain thread then ran UNPRIORITIZED — the whole display's frame pump at
  normal priority, starvable by DDC/HPD-servicing DPC pressure into
  multi-hundred-ms delivery holes. Fall back to TIME_CRITICAL.

- IddCxSetRealtimeGPUPriority (IddCx 1.9) raises the processing device above
  every regular application's GPU priority. Slot availability comes from
  raising the exported IddMinimumVersionRequired 4 → 10, which was overdue
  independently: the drain loop already calls ReleaseAndAcquireBuffer2 (1.10)
  unconditionally, so binding a pre-1.10 framework would dispatch past the
  populated IddFunctions table — with 10 an old framework fails the bind
  cleanly instead. The product floor is already Win11 22H2 (installer
  MinVersion=10.0.22621, whose framework is 1.10), so no supported system
  changes behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 15:24:10 +02:00
co-authored by Claude Fable 5
parent 94f0207cbd
commit 19d6f79d2d
3 changed files with 70 additions and 7 deletions
@@ -200,3 +200,20 @@ iddcx_ddi!(
IddCxSwapChainFinishedProcessingFrame(swap_chain: iddcx::IDDCX_SWAPCHAIN)
@ IddCxSwapChainFinishedProcessingFrameTableIndex as PFN_IDDCXSWAPCHAINFINISHEDPROCESSINGFRAME
);
iddcx_ddi!(
/// Raise the swap-chain's processing D3D device to realtime GPU scheduling priority — "higher
/// than any regular application can set" (IddCx 1.9) — so buffer processing outruns ordinary
/// GPU contention. It does NOT help against adapter-wide display servicing (modeset-class DDIs
/// idle the hardware outright); it defends the contention case only. Best-effort at the call
/// site: the DDI itself may decline (e.g. E_NOTIMPL on WDDM < 3.0 hardware).
///
/// Table-slot availability rests on the driver's `IddMinimumVersionRequired = 10` export
/// (pf-vdisplay lib.rs): the loader refuses to bind a framework older than IddCx 1.10, so
/// every slot of our compiled 1.10 surface — this 1.9 one included — is populated wherever the
/// driver runs at all.
IddCxSetRealtimeGPUPriority(
swap_chain: iddcx::IDDCX_SWAPCHAIN,
in_args: *const iddcx::IDARG_IN_SETREALTIMEGPUPRIORITY,
) @ IddCxSetRealtimeGPUPriorityTableIndex as PFN_IDDCXSETREALTIMEGPUPRIORITY
);