Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/backend/drm/DRM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,12 @@ bool Aquamarine::CDRMOutput::commitState(bool onlyTest) {
else
data.calculateMode(connector);

if ((data.modeset && STATE.ctm != Mat3x3()) || (COMMITTED & COutputState::eOutputStateProperties::AQ_OUTPUT_STATE_CTM))
// always re-send CTM on modeset, identity included, otherwise a stale matrix
// left by a previous compositor (e.g. kwin's color management) survives our
// session. prepareConnector builds a real identity blob when STATE.ctm is
// identity, so we never send blob_id=0 (which some drivers mishandle, see #256).
// (see #127)
if (data.modeset || (COMMITTED & COutputState::eOutputStateProperties::AQ_OUTPUT_STATE_CTM))
data.ctm = STATE.ctm;

bool ok = connector->commitState(data);
Expand Down
9 changes: 7 additions & 2 deletions src/backend/drm/impl/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,15 @@ bool Aquamarine::CDRMAtomicImpl::prepareConnector(Hyprutils::Memory::CSharedPoin
return false;
};

if (STATE.committed & COutputState::AQ_OUTPUT_STATE_GAMMA_LUT)
// re-send gamma/degamma on modeset so a previous compositor's lut does not
// bleed into our session. an empty STATE.gammaLut produces a zero blob, which
// clears the kernel state. only ride the modeset path when the prop actually
// exists, otherwise we'd log a spurious "no gamma_lut prop" error per modeset.
// (see #127)
if ((data.modeset && connector->crtc->props.values.gamma_lut) || (STATE.committed & COutputState::AQ_OUTPUT_STATE_GAMMA_LUT))
data.atomic.gammad = prepareGammaBlob(connector->crtc->props.values.gamma_lut, STATE.gammaLut, &data.atomic.gammaLut);

if (STATE.committed & COutputState::AQ_OUTPUT_STATE_DEGAMMA_LUT)
if ((data.modeset && connector->crtc->props.values.degamma_lut) || (STATE.committed & COutputState::AQ_OUTPUT_STATE_DEGAMMA_LUT))
data.atomic.degammad = prepareGammaBlob(connector->crtc->props.values.degamma_lut, STATE.degammaLut, &data.atomic.degammaLut);

if (data.ctm.has_value() && (data.modeset || (STATE.committed & COutputState::AQ_OUTPUT_STATE_CTM))) {
Expand Down
Loading