Blame SOURCES/0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch

ff210d
From bdfcf889f8cda47190d98fa8a3e401a1db38074c Mon Sep 17 00:00:00 2001
ff210d
From: Ray Strode <rstrode@redhat.com>
ff210d
Date: Tue, 7 Nov 2017 13:49:30 -0500
ff210d
Subject: [PATCH] device-manager: fall back to text mode if graphical devices
ff210d
 fail
ff210d
ff210d
Right now we assume if we find a /dev/dri/card0 that it will work.
ff210d
That may not be true. The proprietary nvidia driver, for instance,
ff210d
provides /dev/dri/card0 but disables modesetting by default.
ff210d
ff210d
This commit makes sure we fall back to text mode if /dev/dri/card0
ff210d
is insufficient for our needs.
ff210d
ff210d
https://bugs.freedesktop.org/show_bug.cgi?id=103612
ff210d
---
ff210d
 src/libply-splash-core/ply-device-manager.c | 26 ++++++++++++---------
ff210d
 1 file changed, 15 insertions(+), 11 deletions(-)
ff210d
ff210d
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
ff210d
index b4c33d4..cf56f4e 100644
ff210d
--- a/src/libply-splash-core/ply-device-manager.c
ff210d
+++ b/src/libply-splash-core/ply-device-manager.c
ff210d
@@ -47,7 +47,7 @@
ff210d
 static void create_devices_from_udev (ply_device_manager_t *manager);
ff210d
 #endif
ff210d
 
ff210d
-static void create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
+static bool create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
                                                            const char           *device_path,
ff210d
                                                            ply_terminal_t       *terminal,
ff210d
                                                            ply_renderer_type_t   renderer_type);
ff210d
@@ -212,11 +212,12 @@ fb_device_has_drm_device (ply_device_manager_t *manager,
ff210d
         return has_drm_device;
ff210d
 }
ff210d
 
ff210d
-static void
ff210d
+static bool
ff210d
 create_devices_for_udev_device (ply_device_manager_t *manager,
ff210d
                                 struct udev_device   *device)
ff210d
 {
ff210d
         const char *device_path;
ff210d
+        bool created = false;
ff210d
 
ff210d
         device_path = udev_device_get_devnode (device);
ff210d
 
ff210d
@@ -245,12 +246,14 @@ create_devices_for_udev_device (ply_device_manager_t *manager,
ff210d
                                 terminal = manager->local_console_terminal;
ff210d
                         }
ff210d
 
ff210d
-                        create_devices_for_terminal_and_renderer_type (manager,
ff210d
-                                                                    device_path,
ff210d
-                                                                    terminal,
ff210d
-                                                                    renderer_type);
ff210d
+                        created = create_devices_for_terminal_and_renderer_type (manager,
ff210d
+                                                                                 device_path,
ff210d
+                                                                                 terminal,
ff210d
+                                                                                 renderer_type);
ff210d
                 }
ff210d
         }
ff210d
+
ff210d
+        return created;
ff210d
 }
ff210d
 
ff210d
 static void
ff210d
@@ -310,8 +313,7 @@ create_devices_for_subsystem (ply_device_manager_t *manager,
ff210d
                                 node = udev_device_get_devnode (device);
ff210d
                                 if (node != NULL) {
ff210d
                                         ply_trace ("found node %s", node);
ff210d
-                                        found_device = true;
ff210d
-                                        create_devices_for_udev_device (manager, device);
ff210d
+                                        found_device = create_devices_for_udev_device (manager, device);
ff210d
                                 }
ff210d
                         } else {
ff210d
                                 ply_trace ("device doesn't have a devices tag");
ff210d
@@ -656,7 +658,7 @@ create_text_displays_for_terminal (ply_device_manager_t *manager,
ff210d
           manager->text_display_added_handler (manager->event_handler_data, display);
ff210d
 }
ff210d
 
ff210d
-static void
ff210d
+static bool
ff210d
 create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
                                                const char           *device_path,
ff210d
                                                ply_terminal_t       *terminal,
ff210d
@@ -670,7 +672,7 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
 
ff210d
         if (renderer != NULL) {
ff210d
                 ply_trace ("ignoring device %s since it's already managed", device_path);
ff210d
-                return;
ff210d
+                return true;
ff210d
         }
ff210d
 
ff210d
         ply_trace ("creating devices for %s (renderer type: %u) (terminal: %s)",
ff210d
@@ -686,7 +688,7 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
                         renderer = NULL;
ff210d
 
ff210d
                         if (renderer_type != PLY_RENDERER_TYPE_AUTO)
ff210d
-                                return;
ff210d
+                                return false;
ff210d
                 }
ff210d
 
ff210d
                 if (renderer != NULL) {
ff210d
@@ -743,6 +745,8 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ff210d
                 ply_trace ("activating keyboards");
ff210d
                 ply_keyboard_watch_for_input (keyboard);
ff210d
         }
ff210d
+
ff210d
+        return true;
ff210d
 }
ff210d
 
ff210d
 static void
ff210d
-- 
ff210d
2.17.1
ff210d