Blame SOURCES/0002-output-kms-Don-t-attemp-to-add-common-modes-on-conne.patch

1679d1
From cd8b90a7a7185c3f177469d1a37654a9e8539cd1 Mon Sep 17 00:00:00 2001
1679d1
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
1679d1
Date: Thu, 29 Sep 2022 14:23:55 +0200
1679d1
Subject: [PATCH 2/2] output/kms: Don't attemp to add common modes on
1679d1
 connectors without modes
1679d1
1679d1
We have no way to sanely add safe modes if there are no modes we can
1679d1
compare with, thus don't try.
1679d1
1679d1
Fixes the following crash:
1679d1
1679d1
 #0 are_all_modes_equally_sized at ../src/backends/native/meta-output-kms.c:284
1679d1
 #1 maybe_add_fallback_modes at ../src/backends/native/meta-output-kms.c:310
1679d1
 #2 init_output_modes at ../src/backends/native/meta-output-kms.c:347
1679d1
 #3 meta_output_kms_new at ../src/backends/native/meta-output-kms.c:414
1679d1
 #4 init_outputs at ../src/backends/native/meta-gpu-kms.c:332
1679d1
 #5 meta_gpu_kms_read_current at ../src/backends/native/meta-gpu-kms.c:368
1679d1
 #6 meta_gpu_kms_new at ../src/backends/native/meta-gpu-kms.c:403
1679d1
 #7 create_gpu_from_udev_device at ../src/backends/native/meta-backend-native.c:461
1679d1
 #8 init_gpus at ../src/backends/native/meta-backend-native.c:551
1679d1
 #9 meta_backend_native_initable_init at ../src/backends/native/meta-backend-native.c:632
1679d1
1679d1
Fixes: 877cc3eb7d44e2886395151f763ec09bea350444
1679d1
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2127801
1679d1
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2646>
1679d1
(cherry picked from commit 2c8adb19660cb2cd53381372833e088962437d3b)
1679d1
---
1679d1
 src/backends/native/meta-output-kms.c | 3 +++
1679d1
 1 file changed, 3 insertions(+)
1679d1
1679d1
diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
1679d1
index 9adc20bfd9..058ab7c053 100644
1679d1
--- a/src/backends/native/meta-output-kms.c
1679d1
+++ b/src/backends/native/meta-output-kms.c
1679d1
@@ -250,6 +250,9 @@ maybe_add_fallback_modes (const MetaKmsConnectorState *connector_state,
1679d1
                           MetaGpuKms                  *gpu_kms,
1679d1
                           MetaKmsConnector            *kms_connector)
1679d1
 {
1679d1
+  if (!connector_state->modes)
1679d1
+    return;
1679d1
+
1679d1
   if (!connector_state->has_scaling)
1679d1
     return;
1679d1
 
1679d1
-- 
1679d1
2.37.1
1679d1