native/gpu: Handle drmModeSetCrtc() failing gracefully
authorJonas Ådahl <jadahl@gmail.com>
Tue, 24 Apr 2018 09:26:33 +0000 (09:26 +0000)
committerSimon McVittie <smcv@debian.org>
Tue, 31 Jul 2018 14:35:03 +0000 (15:35 +0100)
If drmModeSetCrtc() is called with no fb, mode or connectors for some
CRTC it may still fail, and we should handle that gracefully instead of
assuming it failed to set a non-disabled state.

Closes https://gitlab.gnome.org/GNOME/mutter/issues/70

(cherry picked from commit 6e953e2725d5d5b10d14c7bd479bd99f6853addc)

Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/70
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1754949
Applied-Upstream: https://gitlab.gnome.org/GNOME/mutter/commit/44682a2cc555

Gbp-Pq: Name native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch

src/backends/native/meta-gpu-kms.c

index 259cd71227900de42d37cc7e5a5b522e14b3d533..1d1c288094e312099384325ac0b4be6d671a184c 100644 (file)
@@ -143,7 +143,10 @@ meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
                       connectors, n_connectors,
                       mode) != 0)
     {
-      g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
+      if (mode)
+        g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
+      else
+        g_warning ("Failed to disable CRTC");
       g_free (connectors);
       return FALSE;
     }