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

Related