[mutter] monitor-manager/native: Bail if gamma LUT size differs
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager/native: Bail if gamma LUT size differs
- Date: Thu, 1 Sep 2022 14:52:09 +0000 (UTC)
commit 15bbded86b70f86682f4cdc324199344885e4b94
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Oct 26 11:09:41 2021 +0200
monitor-manager/native: Bail if gamma LUT size differs
Don't attempt to set a CRTC GAMMA LUT with a different size than what is
already there.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
src/backends/native/meta-monitor-manager-native.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/backends/native/meta-monitor-manager-native.c
b/src/backends/native/meta-monitor-manager-native.c
index f967fbf15b..74349888b8 100644
--- a/src/backends/native/meta-monitor-manager-native.c
+++ b/src/backends/native/meta-monitor-manager-native.c
@@ -493,6 +493,7 @@ meta_monitor_manager_native_set_crtc_gamma (MetaMonitorManager *manager,
META_MONITOR_MANAGER_NATIVE (manager);
MetaCrtcKms *crtc_kms;
MetaKmsCrtc *kms_crtc;
+ const MetaKmsCrtcState *crtc_state;
g_autofree char *gamma_ramp_string = NULL;
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
@@ -501,6 +502,17 @@ meta_monitor_manager_native_set_crtc_gamma (MetaMonitorManager *manager,
crtc_kms = META_CRTC_KMS (crtc);
kms_crtc = meta_crtc_kms_get_kms_crtc (META_CRTC_KMS (crtc));
+ crtc_state = meta_kms_crtc_get_current_state (kms_crtc);
+
+ if (size != crtc_state->gamma.size)
+ {
+ MetaKmsDevice *kms_device = meta_kms_crtc_get_device (kms_crtc);
+
+ g_warning ("Tried to set a different gamma LUT size on %u (%s)",
+ meta_kms_crtc_get_id (kms_crtc),
+ meta_kms_device_get_path (kms_device));
+ return;
+ }
g_hash_table_replace (manager_native->crtc_gamma_cache,
GUINT_TO_POINTER (meta_crtc_get_id (crtc)),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]