backends/drm: don't set gamma with legacy unless really necessary
It seems to have a pretty large performance impact
This commit is contained in:
parent
568f9fb666
commit
d1bc39a6ea
2 changed files with 7 additions and 3 deletions
|
@ -168,6 +168,7 @@ private:
|
|||
|
||||
bool m_modesetPresentPending = false;
|
||||
bool m_didLegacyScanoutHack = false;
|
||||
std::shared_ptr<DrmGammaRamp> m_currentLegacyGamma;
|
||||
|
||||
struct State
|
||||
{
|
||||
|
|
|
@ -132,9 +132,12 @@ DrmPipeline::Error DrmPipeline::applyPendingChangesLegacy()
|
|||
return err;
|
||||
}
|
||||
}
|
||||
if (m_pending.gamma && drmModeCrtcSetGamma(gpu()->fd(), m_pending.crtc->id(), m_pending.gamma->lut().size(), m_pending.gamma->lut().red(), m_pending.gamma->lut().green(), m_pending.gamma->lut().blue()) != 0) {
|
||||
qCWarning(KWIN_DRM) << "Setting gamma failed!" << strerror(errno);
|
||||
return errnoToError();
|
||||
if (m_pending.gamma && m_currentLegacyGamma != m_pending.gamma) {
|
||||
if (drmModeCrtcSetGamma(gpu()->fd(), m_pending.crtc->id(), m_pending.gamma->lut().size(), m_pending.gamma->lut().red(), m_pending.gamma->lut().green(), m_pending.gamma->lut().blue()) != 0) {
|
||||
qCWarning(KWIN_DRM) << "Setting gamma failed!" << strerror(errno);
|
||||
return errnoToError();
|
||||
}
|
||||
m_currentLegacyGamma = m_pending.gamma;
|
||||
}
|
||||
if (m_connector->contentType.isValid()) {
|
||||
m_connector->contentType.setEnumLegacy(m_pending.contentType);
|
||||
|
|
Loading…
Reference in a new issue