]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-device-manager: Add syspath_is_simpledrm () helper
authorHans de Goede <hdegoede@redhat.com>
Tue, 4 Jun 2024 19:16:31 +0000 (21:16 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 7 Jun 2024 15:21:00 +0000 (17:21 +0200)
Add a helper to determine if a udev syspath is a simpledrm device.
This is a preparation patch to for making simpledrm devices their
own renderer-type.

src/libply-splash-core/ply-device-manager.c

index d75ac6c58575908598b7116d8a3dc6c99063a603..4c48f606fb514910cc466457167a57e88495dc03 100644 (file)
@@ -340,10 +340,14 @@ remove_input_device_from_renderers (ply_device_manager_t *manager,
 }
 
 static bool
-verify_drm_device (struct udev_device *device)
+syspath_is_simpledrm (const char *syspath)
 {
-        const char *id_path;
+        return ply_string_has_suffix (syspath, "simple-framebuffer.0/drm/card0");
+}
 
+static bool
+verify_drm_device (struct udev_device *device)
+{
         /*
          * Simple-framebuffer devices driven by simpledrm lack information
          * like panel-rotation info and physical size, causing the splash
@@ -352,8 +356,7 @@ verify_drm_device (struct udev_device *device)
          * To avoid this treat simpledrm devices as fbdev devices and only
          * use them after the timeout.
          */
-        id_path = udev_device_get_property_value (device, "ID_PATH");
-        if (!ply_string_has_prefix (id_path, "platform-simple-framebuffer"))
+        if (!syspath_is_simpledrm (udev_device_get_syspath (device)))
                 return true; /* Not a SimpleDRM device */
 
         /*