Explainer

Which layer is dimming your screen: hardware, software, or neither

Two apps can both say “brightness 40%” and produce completely different pictures. The reason is that brightness is carried by different layers, and only one of them touches the backlight.

The four states

A working implementation has to model this explicitly, because the whole point is the hop from hardware down to software. There are four states, and they are not interchangeable:

Why “unknown” is not “unavailable”

Collapsing those two into one state is how an app ends up telling you a display is unsupported before it has ever tried. Keeping them apart costs one word in the source and saves a wrong diagnosis.

The delays are part of the design

Fallback is not a single retry. Panels need a moment after wake before they answer DDC/CI at all — replaying the instant the notification lands is exactly why naive wake handlers fail. A real implementation waits 2.5 seconds after wake, and then retries after 1, 2 and 4 seconds.

Why the ladder is kept testable

The retry/fallback ladder is written free of the window toolkit and of any concrete DDC type: the caller injects both the writer and the sleeper. That is what lets the ladder itself be exercised on a machine whose panel ignores DDC/CI entirely — which is the only kind of machine that would otherwise never reach the code.

Honest limits

Quick answers

Why do two apps both show 40% brightness but produce different pictures?
Because brightness is carried by different layers — DDC/CI backlight, gamma table or an overlay — and only the backlight path touches the hardware.

What does an “unknown” state mean?
That the app has not tried that path yet. It is different from “unavailable”, and merging the two makes an app call a display unsupported before it ever tries.

Why does a wake handler need a delay and retries?
A panel needs a moment after wake before it answers DDC/CI. A reliable implementation waits about 2.5 seconds, then retries at 1, 2 and 4 seconds.

Related