drm: clear stale color state on modeset#297
Conversation
A previous compositor (kwin etc.) can leave HDR, gamma, degamma and CTM properties set on a connector when it exits. Aquamarine only re-emitted these on user commits, so anything we don't actively manage stayed at the previous compositor's value, manifesting as washed-out colors or shifted saturation when starting Hyprland after kwin. HDR (hyprwm#250) and CTM-with-non-identity (hyprwm#256) were already covered. Extend the modeset path to also: - re-send gamma_lut/degamma_lut on modeset; an empty STATE.gammaLut produces a zero blob, which clears the kernel state. only ride this path when the prop actually exists, otherwise we'd log a spurious "no gamma_lut prop" error on every modeset for connectors without programmable gamma. - re-send CTM unconditionally on modeset, identity included, so the kernel always replaces a stale matrix with our current one. the blob builder produces a real identity matrix when STATE.ctm == Mat3x3(), so we never send blob_id=0 (which hyprwm#256 documented as problematic). Fixes hyprwm#127.
|
Hey, a heads up that I think it might've introduced a black-screen on some setups, wanted to flag it in case I'm reading the path wrong. I'm running a Hyprland 0.55-based fork with The PR's commit message says the blob builder produces identity when Easy fix would be treating a default-constructed |
A previous compositor (kwin etc.) can leave HDR, gamma, degamma and CTM
properties set on a connector when it exits. Aquamarine only re-emitted
these on user commits, so anything we don't actively manage stayed at
the previous compositor's value, manifesting as washed-out colors or
shifted saturation when starting Hyprland after kwin.
HDR (#250) and CTM-with-non-identity (#256) were already covered. Extend
the modeset path to also:
gamma_lut/degamma_luton modeset; an emptySTATE.gammaLutproduces a zero blob, which clears the kernel state. only ride this
path when the prop actually exists, otherwise we'd log a spurious
no gamma_lut properror on every modeset for connectors withoutprogrammable gamma.
kernel always replaces a stale matrix with our current one. the blob
builder produces a real identity matrix when
STATE.ctm == Mat3x3(),so we never send
blob_id=0(which drm: re-send ctm blob on modeset #256 documented as problematic).Fixes #127.