vdd

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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")
)
View Source
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 Available

func Available() bool

func ElevatedGPUNameCommand

func ElevatedGPUNameCommand(adapterName string) string

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

func IsolateDisplay(string) (func() error, error)

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 Open

func Open() (*Driver, error)

func (*Driver) Close

func (d *Driver) Close() error

func (*Driver) CreateDisplay

func (d *Driver) CreateDisplay(DisplaySpec) (*VirtualDisplay, error)

func (*Driver) Err

func (d *Driver) Err() <-chan error

func (*Driver) Remove

func (d *Driver) Remove(GUID) error

func (*Driver) SetRenderAdapter

func (d *Driver) SetRenderAdapter(gpu.LUID) error

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]byte
}

GUID has the memory layout of a Windows GUID.

func MonitorID

func MonitorID(seed []byte) GUID

MonitorID derives a stable monitor GUID from a client identity, so Windows remembers that monitor's scaling and HDR settings per client.

func (GUID) String

func (g GUID) String() string

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

func DriverInfo() (Info, error)

type Monitor

type Monitor struct {
	IddAdapter gpu.LUID
	TargetID   uint32
	GDIName    string
	Name       string
}

Monitor is a SudoVDA monitor that Windows shows on the desktop, whoever added it.

func Monitors

func Monitors() ([]Monitor, error)

type Version

type Version struct {
	Major, Minor, Incremental uint8
	Test                      bool
}

func (Version) String

func (v Version) String() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL