drm/atomic: fix gamma resetting

thanks @ikalco
This commit is contained in:
Vaxry 2024-07-12 10:52:05 +02:00
parent ee0dea62e2
commit 996cc6f6a4
1 changed files with 4 additions and 1 deletions

View File

@ -238,7 +238,10 @@ bool Aquamarine::CDRMAtomicImpl::prepareConnector(Hyprutils::Memory::CSharedPoin
if (STATE.committed & COutputState::AQ_OUTPUT_STATE_GAMMA_LUT) { if (STATE.committed & COutputState::AQ_OUTPUT_STATE_GAMMA_LUT) {
if (!connector->crtc->props.gamma_lut) // TODO: allow this with legacy gamma, perhaps. if (!connector->crtc->props.gamma_lut) // TODO: allow this with legacy gamma, perhaps.
connector->backend->backend->log(AQ_LOG_ERROR, "atomic drm: failed to commit gamma: no gamma_lut prop"); connector->backend->backend->log(AQ_LOG_ERROR, "atomic drm: failed to commit gamma: no gamma_lut prop");
else { else if (STATE.gammaLut.empty()) {
data.atomic.gammaLut = 0;
data.atomic.gammad = true;
} else {
std::vector<drm_color_lut> lut; std::vector<drm_color_lut> lut;
lut.resize(STATE.gammaLut.size() / 3); // [r,g,b]+ lut.resize(STATE.gammaLut.size() / 3); // [r,g,b]+