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