Blame SOURCES/0002-crtc-kms-Don-t-add-gamma-to-the-update-if-unsupporte.patch

5c9faf
From 69c40c6d126a5c804db54ce0afe581362e4fd33b Mon Sep 17 00:00:00 2001
5c9faf
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
5c9faf
Date: Tue, 12 Apr 2022 18:37:29 +0800
5c9faf
Subject: [PATCH 2/2] crtc/kms: Don't add gamma to the update if unsupported by
5c9faf
 the CRTC
5c9faf
5c9faf
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2197
5c9faf
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2360>
5c9faf
---
5c9faf
 src/backends/native/meta-crtc-kms.c | 6 +++++-
5c9faf
 1 file changed, 5 insertions(+), 1 deletion(-)
5c9faf
5c9faf
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
5c9faf
index f1bc79146..953f023ce 100644
5c9faf
--- a/src/backends/native/meta-crtc-kms.c
5c9faf
+++ b/src/backends/native/meta-crtc-kms.c
5c9faf
@@ -201,10 +201,14 @@ meta_crtc_kms_maybe_set_gamma (MetaCrtcKms   *crtc_kms,
5c9faf
   MetaKms *kms = meta_kms_device_get_kms (kms_device);
5c9faf
   MetaKmsUpdate *kms_update;
5c9faf
   MetaKmsCrtcGamma *gamma;
5c9faf
+  MetaKmsCrtc *kms_crtc = meta_crtc_kms_get_kms_crtc (crtc_kms);
5c9faf
 
5c9faf
   if (crtc_kms->is_gamma_valid)
5c9faf
     return;
5c9faf
 
5c9faf
+  if (!meta_kms_crtc_has_gamma (kms_crtc))
5c9faf
+    return;
5c9faf
+
5c9faf
   gamma = meta_monitor_manager_native_get_cached_crtc_gamma (monitor_manager_native,
5c9faf
                                                              crtc_kms);
5c9faf
   if (!gamma)
5c9faf
@@ -212,7 +216,7 @@ meta_crtc_kms_maybe_set_gamma (MetaCrtcKms   *crtc_kms,
5c9faf
 
5c9faf
   kms_update = meta_kms_ensure_pending_update (kms, kms_device);
5c9faf
   meta_kms_update_set_crtc_gamma (kms_update,
5c9faf
-                                  meta_crtc_kms_get_kms_crtc (crtc_kms),
5c9faf
+                                  kms_crtc,
5c9faf
                                   gamma->size,
5c9faf
                                   gamma->red,
5c9faf
                                   gamma->green,
5c9faf
-- 
5c9faf
2.35.1
5c9faf