# Display System

The Beyond drives **two micro-OLED panels** (left and right eye) through a Synaptics **VXR7200** display SoC that receives DisplayPort 1.4 input and outputs dual MIPI DSI streams.

## Dual Micro-OLED Panel Control

- OLED initialization with manufacturer-recommended startup sequence and temperature compensation loaded at boot; OSC Tracking settings updated per SeeYA recommendations (v0.3.13)
- I2C control at address `0x98`, with open-drain mode set before ID reads
- Per-panel serial number readback (14-byte OLED ID via `^` HID command)
- Display flip/inversion support (vertical flip via `P` HID command)
- Short delay after display-on command before sending final dimming command (per manufacturer recommendation)

**Source files:** `src/Devices/oled_control.c/h`

## Video Modes

| Mode Enum | Resolution | Framerate | DSC Required | Notes |
|-----------|-----------|-----------|--------------|-------|
| `H2544_V2544_75Hz` | 2544x2544 | 75 Hz | Yes | Default preferred mode |
| `H2544_V2544_72Hz` | 2544x2544 | 72 Hz | Yes | Added v0.2.14, disabled (VXR7200 bug) |
| `H2544_V2544_60Hz` | 2544x2544 | 60 Hz | Yes | Requires VXR firmware v03+ |
| `H1920_V1920_90Hz` | 1920x1920 | 90 Hz | No | |
| `H1920_V1920_60Hz` | 1920x1920 | 60 Hz | No | |
| `H2560_V2560_30Hz` | 2560x2560 | 30 Hz | No | |
| `Colorbar_Test` | — | — | No | Factory test pattern |

Video mode is detected automatically by reading the VXR7200 receive buffer MSA (Main Stream Attributes) registers for H/V total, H/V active, and color depth. Frame rate is computed from pixel clock multiplier/divider and internal clock.

## EDID Management

The firmware dynamically writes EDID data to the VXR7200 RAM at three locations:
- `0x3000` — Main EDID RAM
- `0x3200` — MST TX0 (left eye)
- `0x3380` — MST TX1 (right eye)

EDID mode sets selectable via HID `d` command or config tag `0x0D`:

| Selection | Enum | Available Modes |
|-----------|------|-----------------|
| Default | `EDID_DEFAULT` | Both 75 Hz and 90 Hz |
| 90 Hz only | `EDID_90HZ_ONLY` | 90 Hz only |
| 75 Hz only | `EDID_75HZ_ONLY` | 75 Hz only |
| 72 Hz only | `EDID_72HZ_ONLY` | 72 Hz only |

75 Hz was made the preferred default resolution (v0.2.13) because AMD GPUs fail to find the Beyond's monitor if the SteamVR Watchman JSON and Windows OS resolutions don't match.

**Source files:** `src/edid.h`, `src/video_proc.c/h`

## Brightness Control

- **Range:** 0 (barely visible) to 1023 (maximum), 10-bit resolution
- **Default:** 266 (~26% of max), defined as `DEFAULT_OLED_BRIGHTNESS`
- **Method:** Blanking period adjustment via OLED panel registers
- **Retry logic:** Up to 3 retries to ensure both panels match (v0.2.8)
- **Startup brightness:** Configurable via config tag `0x0A`, stored persistently
- **Dimming modes by video mode:**
  - 60 Hz: Pulsed emission (v0.2.25, replaces black frame insertion)
  - 30 Hz FATP: Multi-pulse emission (v0.2.12, avoids visible strobing)

HID command: `I` (0x49) with 16-bit big-endian brightness value.

## Display Stream Compression (DSC)

- DSC status detected by reading PPS (Picture Parameter Set) from VXR7200 TX0/TX1 at offsets `0x0780`/`0x0800`
- PPS data is 88 bytes starting at byte offset 5
- Required for 2544x2544 resolution modes
- DSC disable command available (`VXR_Disable_DSC`)
- DSC status reported in periodic telemetry (bit 3 of display status)

## DisplayPort Reception

The VXR7200 handles DP 1.4 reception. The MCU reads link status:

| Link Rate | Value | Bandwidth |
|-----------|-------|-----------|
| RBR | 1 | 1.62 Gbps |
| HBR | 2 | 2.7 Gbps |
| HBR2 | 3 | 5.4 Gbps |
| HBR3 | 4 | 8.1 Gbps |

- Lane count: 1–4, reported in periodic telemetry
- Per-lane PHY error counters at registers `0x22011C`–`0x220128`
- MST (Multi-Stream Transport): TX0 = left eye, TX1 = right eye
- Video enable status per TX channel checked via `TX0_VID_MODE_ADDRESS` / `TX1_VID_MODE_ADDRESS`

## Display Status Bitfield

Reported in the periodic HID telemetry report (bytes 24–25):

| Bits | Field | Description |
|------|-------|-------------|
| 0 | Displays On | 1 = displays currently active |
| 1 | Proximity On | 1 = user detected near headset |
| 2 | Prox Timer Expired | 1 = 5-minute dim timer elapsed |
| 3 | DSC Enabled | 1 = Display Stream Compression active |
| 4–7 | Video Mode | Enum value (0=Unknown through 7=Colorbar) |
| 8–11 | DP Link Rate | 0=Unknown, 1=RBR, 2=HBR, 3=HBR2, 4=HBR3 |
| 12–15 | DP Lane Count | Number of active DisplayPort lanes |

## Proximity-Driven Display Behavior

When the proximity sensor detects the user has removed the headset:

1. Display dims to minimum brightness immediately
2. After 5 minutes without user presence, displays fully power off
3. This two-stage approach reduces the temporary blue color shift that occurs when OLEDs turn back on (v0.2.7)

Fan and RGB LED also follow display state — they turn on/off with the video signal (v0.2.6).
