Documentation
¶
Overview ¶
Package vdd drives the SudoVDA indirect display driver on Windows: it adds a virtual monitor per client at the client's resolution and refresh rate, binds its rendering to a chosen GPU, and removes it again.
The driver removes every monitor when nobody has sent it an IOCTL for its watchdog timeout (3 s by default). A Driver pings while it owns displays, so a host that dies in any way loses its displays within that timeout. Apollo uses the same driver: its pings keep Planck's displays alive and its render-adapter choice moves them, so the two should not run at once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotInstalled = errors.New("vdd: SudoVDA driver not installed") ErrAccessDenied = errors.New("vdd: SudoVDA device denies this user") ErrProtocol = errors.New("vdd: unsupported SudoVDA protocol") ErrAttachTimeout = errors.New("vdd: virtual display did not attach") ErrWrongAdapter = errors.New("vdd: virtual display rendered on another GPU") ErrClosed = errors.New("vdd: driver closed") )
var ErrPrivacyUnsupported = errors.New("vdd: privacy mode needs a virtual display, which needs Windows")
ErrPrivacyUnsupported is privacy mode on a system with no virtual display driver.
Functions ¶
func ElevatedGPUNameCommand ¶
ElevatedGPUNameCommand is the one-line PowerShell command a user runs from an elevated prompt to make SudoVDA render on adapterName by default. It restarts the driver, which removes every SudoVDA display.
func IsolateDisplay ¶
Types ¶
type DisplaySpec ¶
type DisplaySpec struct {
Width, Height int // even
RefreshMilliHz int // 120000
ID GUID // stable per client: MonitorID(clientFingerprint)
Name string
Serial string
RenderAdapter gpu.LUID // 0 = leave the driver's choice
HDR bool // turn Windows advanced color on (true) or off (false)
// ScalePct is the Windows display scale to set, in percent: the step
// nearest it (100 is unscaled). 0 leaves Windows's choice, which for
// SudoVDA's small reported size is often 200%: games in borderless
// windows then see half the display.
ScalePct int
Primary bool
AttachTimeout time.Duration // default 5 s
}
type Driver ¶
type Driver struct{}
func (*Driver) CreateDisplay ¶
func (d *Driver) CreateDisplay(DisplaySpec) (*VirtualDisplay, error)
type GUID ¶
GUID has the memory layout of a Windows GUID.
type Info ¶
type Info struct {
DevicePath string
Protocol Version
Watchdog time.Duration // 0 = disabled in the registry
RegistryGPUName string // HKLM\SOFTWARE\SudoMaker\SudoVDA\gpuName, read only
MaxMonitors int // registry maxMonitors, default 10
}
func DriverInfo ¶
type VirtualDisplay ¶
type VirtualDisplay struct {
ID GUID
IddAdapter gpu.LUID // SudoVDA's IddCx adapter (from ADD)
TargetID uint32
GDIName string // \\.\DISPLAYn
RenderAdapter gpu.LUID // the DXGI adapter whose output this is, verified
Width, Height int
RefreshMilliHz int
HDR bool
// ScalePct is the Windows display scale in effect, in percent; 0 when
// the spec left it alone. ScaleErr says why it is not the spec's.
ScalePct int
ScaleErr error
// contains filtered or unexported fields
}
func (*VirtualDisplay) Close ¶
func (v *VirtualDisplay) Close() error
func (*VirtualDisplay) Resize ¶
func (v *VirtualDisplay) Resize(w, h int) error