refactor(windows-host): delete the SudoVDA backend — pf-vdisplay is the sole vdisplay (Goal 2)
Goal 2 ("drop every trace of SudoVDA") is done. The SudoVDA driver is no longer
shipped (only pf-vdisplay; the old vdisplay-driver tree was deleted in a2bd0cd),
and F1 (d638a93/e60cda3) already moved the display-utility helpers out of the
backend into neutral modules (win_adapter/win_display), breaking the reach-in.
So the backend is now cleanly removable:
- Deleted crates/punktfunk-host/src/vdisplay/windows/sudovda.rs (350 lines: the
SudoVdaDisplay VirtualDisplay impl + its VdisplayDriver/probe).
- vdisplay::open()/probe() are now unconditional pf-vdisplay; deleted the
windows_use_pf_vdisplay() backend selector. open() now ensure!s
pf_vdisplay::is_available() with a clear "driver not installed" error instead
of the old silent SudoVDA fallback (no fallback driver exists anymore).
- Scrubbed the dangling references to the deleted symbols (manager/sendinput/dxgi
comments, the config + host.env PUNKTFUNK_VDISPLAY docs); the var stays as an
informational forward-seam. Updated the F1 module docs (Goal 2 now done).
All changes are #[cfg(windows)] except the config doc; Linux clippy
-p punktfunk-host -D warnings clean; zero `sudovda::`/`SudoVdaDisplay` code refs
remain (comments only). Windows build is CI-gated.
Scorecard Goal 2 -> DONE; recorded the E1 "do NOT do it" stability decision in
windows-host-rewrite.md §4 (the process-global driver design is sound given
ProcessSharingDisabled; a device-owned variant adds a use-after-free window for
no gain).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -529,15 +529,15 @@ pub fn open(compositor: Compositor) -> Result<Box<dyn VirtualDisplay>> {
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// Two virtual-display backends: the new pf-vdisplay IddCx driver (pf_vdisplay_proto) and the
|
||||
// shipping SudoVDA fallback. The compositor arg is moot on Windows. PUNKTFUNK_VDISPLAY overrides;
|
||||
// default auto-detects (prefer pf-vdisplay if its driver interface is present).
|
||||
// The pf-vdisplay all-Rust IddCx driver is the sole virtual-display backend (the legacy SudoVDA
|
||||
// fallback was removed — its driver is no longer shipped). The compositor arg is moot on Windows.
|
||||
let _ = compositor;
|
||||
if windows_use_pf_vdisplay() {
|
||||
Ok(Box::new(pf_vdisplay::PfVdisplayDisplay::new()?))
|
||||
} else {
|
||||
Ok(Box::new(sudovda::SudoVdaDisplay::new()?))
|
||||
}
|
||||
anyhow::ensure!(
|
||||
pf_vdisplay::is_available(),
|
||||
"pf-vdisplay driver interface not found — the pf-vdisplay IddCx driver is not installed or \
|
||||
not loaded (the host installer bundles it; reinstall or check the driver state)"
|
||||
);
|
||||
Ok(Box::new(pf_vdisplay::PfVdisplayDisplay::new()?))
|
||||
}
|
||||
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
|
||||
{
|
||||
@@ -546,18 +546,6 @@ pub fn open(compositor: Compositor) -> Result<Box<dyn VirtualDisplay>> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pick the Windows virtual-display backend. `PUNKTFUNK_VDISPLAY=pf|pf-vdisplay|pfvd` forces the new
|
||||
/// pf-vdisplay IddCx driver; `=sudovda|sudo` forces the shipping SudoVDA driver; anything else (the
|
||||
/// default) auto-detects, preferring pf-vdisplay if its device interface is enumerable.
|
||||
#[cfg(target_os = "windows")]
|
||||
fn windows_use_pf_vdisplay() -> bool {
|
||||
match crate::config::config().vdisplay.as_deref().map(str::trim) {
|
||||
Some("pf") | Some("pf-vdisplay") | Some("pfvd") => true,
|
||||
Some("sudovda") | Some("sudo") => false,
|
||||
_ => pf_vdisplay::is_available(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Readiness probe for `compositor`: is it up and able to create a virtual output *right
|
||||
/// now*? A session-bringup script polls this (via `punktfunk-host probe-compositor`) to gate
|
||||
/// on actual readiness instead of racing the compositor with a blind sleep.
|
||||
@@ -578,11 +566,7 @@ pub fn probe(compositor: Compositor) -> Result<()> {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let _ = compositor;
|
||||
if windows_use_pf_vdisplay() {
|
||||
pf_vdisplay::probe()
|
||||
} else {
|
||||
sudovda::probe()
|
||||
}
|
||||
pf_vdisplay::probe()
|
||||
}
|
||||
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
|
||||
{
|
||||
@@ -640,9 +624,6 @@ pub(crate) mod manager;
|
||||
#[cfg(target_os = "windows")]
|
||||
#[path = "vdisplay/windows/pf_vdisplay.rs"]
|
||||
pub(crate) mod pf_vdisplay;
|
||||
#[cfg(target_os = "windows")]
|
||||
#[path = "vdisplay/windows/sudovda.rs"]
|
||||
pub(crate) mod sudovda;
|
||||
#[cfg(target_os = "linux")]
|
||||
#[path = "vdisplay/linux/wlroots.rs"]
|
||||
mod wlroots;
|
||||
|
||||
Reference in New Issue
Block a user