From 3fb14035cd09bd71a07ad62d44b5a2a0cba193ac Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Sat, 11 Dec 2021 23:43:32 +0100 Subject: [PATCH] backends/drm: only use atomic gamma size with AMS For some reason the property exists with legacy, too. If you try to set legacy gamma with atomic gamma size it'll fail --- src/backends/drm/drm_object_crtc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/drm/drm_object_crtc.cpp b/src/backends/drm/drm_object_crtc.cpp index 31d974e189..b314c7c514 100644 --- a/src/backends/drm/drm_object_crtc.cpp +++ b/src/backends/drm/drm_object_crtc.cpp @@ -86,9 +86,11 @@ void DrmCrtc::setNext(const QSharedPointer &buffer) int DrmCrtc::gammaRampSize() const { - // limit atomic gamma ramp to 4096 to work around https://gitlab.freedesktop.org/drm/intel/-/issues/3916 - if (auto prop = getProp(PropertyIndex::Gamma_LUT_Size); prop && prop->current() <= 4096) { - return prop->current(); + if (gpu()->atomicModeSetting()) { + // limit atomic gamma ramp to 4096 to work around https://gitlab.freedesktop.org/drm/intel/-/issues/3916 + if (auto prop = getProp(PropertyIndex::Gamma_LUT_Size); prop && prop->current() <= 4096) { + return prop->current(); + } } return m_crtc->gamma_size; }