Files
mac_linuxgpu/scripts/test-display-agent.sh
geramyloveless f09557da66 host: display-agent --dry-run
MacLinuxGPUHost display-agent --dry-run [--once] [--interval ms] [--init]
follows the GPU's connected monitors through an observer client. It polls
the cached connector state (selector 84 STATUS) and, when the hotplug
epoch moves, probes, reads each connected monitor's mode list (MODES)
and EDID (sysfs), and prints the CGVirtualDisplay it would create, then
the add, update and remove changes against what it had. It creates no
display; without --dry-run it refuses.

The plan takes the identity and colour from the EDID: the monitor name
(else PNP ID and product), the PNP ID word as vendor, the product, the
serial (or a stable hash of the serial string), the CIE primaries and
white point. It takes the modes from the driver's list for the link:
progressive only, duplicates dropped, preferred first, and the largest
mode as max pixels. The size comes from the driver's display_info (else
the EDID's). hiDPI is 0. A monitor with no valid EDID or no progressive
mode is reported and skipped.

The model (report/modes/EDID decoding, the plan, the agent's changes)
moves to host/DisplayAgent.swift, Foundation only, which the Xcode
target now builds; test-display-agent compiles it with a test of its
own. docs/macos-displays.md records what of the frame path exists.
2026-10-03 14:51:43 -07:00

11 lines
423 B
Bash
Executable File

#!/usr/bin/env bash
# The display agent's model (host/DisplayAgent.swift) against synthetic
# driver replies and EDIDs (linuxu/tests/test_display_agent.swift).
set -euo pipefail
cd "$(dirname "$0")/.."
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
cp linuxu/tests/test_display_agent.swift "$work/main.swift"
xcrun swiftc -O host/DisplayAgent.swift "$work/main.swift" -o "$work/test_display_agent"
"$work/test_display_agent"