Blame SOURCES/0003-kms-crtc-Determine-gamma-support-given-the-gamma-len.patch

5c9faf
From 8d6e41fc9b5194fb24523c939de54a2af46b5d07 Mon Sep 17 00:00:00 2001
5c9faf
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
5c9faf
Date: Fri, 27 May 2022 18:19:27 +0200
5c9faf
Subject: [PATCH] kms/crtc: Determine gamma support given the gamma length
5c9faf
5c9faf
The property doesn't necessarily exist when using drivers that doesn't
5c9faf
support atomic mode setting, and the way it worked will break night
5c9faf
light and other gamma related features. This makes things use the gamma
5c9faf
length; if it is higher than 0, it definitely supports it one way or the
5c9faf
other, i.e. GAMMA_LUT with the atomic backend, and drmModeCrtcSetGamma()
5c9faf
with the legacy/simple backend.
5c9faf
5c9faf
Fixes: 364572b95c8354ac66674064a8058aa98bc0bbef
5c9faf
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2287
5c9faf
(cherry picked from commit a2ebd10f049d888e451938e23a035ed97e0c8eff)
5c9faf
5c9faf
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2452>
5c9faf
---
5c9faf
 src/backends/native/meta-kms-crtc.c | 2 +-
5c9faf
 1 file changed, 1 insertion(+), 1 deletion(-)
5c9faf
5c9faf
diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c
5c9faf
index 24f5a2d7400..0513af947c9 100644
5c9faf
--- a/src/backends/native/meta-kms-crtc.c
5c9faf
+++ b/src/backends/native/meta-kms-crtc.c
5c9faf
@@ -96,7 +96,7 @@ meta_kms_crtc_is_active (MetaKmsCrtc *crtc)
5c9faf
 gboolean
5c9faf
 meta_kms_crtc_has_gamma (MetaKmsCrtc *crtc)
5c9faf
 {
5c9faf
-  return !!meta_kms_crtc_get_prop_id (crtc, META_KMS_CRTC_PROP_GAMMA_LUT);
5c9faf
+  return crtc->current_state.gamma.size > 0;
5c9faf
 }
5c9faf
 
5c9faf
 static void
5c9faf
-- 
5c9faf
2.36.1
5c9faf